/* Tích Công — hệ thống giao diện.
 * Hướng thiết kế: bảng điều hành sáng, xám pha xanh lạnh, MỘT màu nhấn xanh dương.
 * Xanh lá chỉ dùng cho "đã xong / tiền", vàng chỉ để cảnh báo. Chuyển động có mục đích:
 * dấu tích được vẽ, vòng tiến độ đầy dần, ô STT "đóng dấu", dòng chảy công việc di chuyển. */

:root {
  --bg: #EEF2F8; --surface: #FFFFFF; --surface-2: #F6F8FC; --track: #E3E9F3;
  --line: #E1E7F0; --line-2: #CBD5E4;
  --ink: #0D1B2E; --ink-2: #44546D; --ink-3: #74839A;
  --accent: #2A78D6; --accent-strong: #1C5CAB; --accent-soft: #E6F0FC; --accent-line: #B7D1F3;
  --good: #0CA30C; --good-ink: #066306; --good-soft: #E4F5E4;
  --warn: #FAB219; --warn-ink: #805508; --warn-soft: #FFF3D4;
  --bad: #D03B3B; --bad-ink: #A12828; --bad-soft: #FCEBEB;
  --series: #2A78D6; --series-muted: #B7D1F3;
  --p-fb: #2A78D6; --p-tt: #1BAF7A; --p-th: #6250D6; --p-yt: #E34948; --p-ig: #E87BA4;
  --a0b: #DCEAFB; --a0i: #1C4F95; --a1b: #FDE3D7; --a1i: #8F3A16; --a2b: #D6F3E7; --a2i: #0B6A47;
  --a3b: #FBEDC7; --a3i: #7A5200; --a4b: #FADCE8; --a4i: #8E2C57; --a5b: #E4DFFA; --a5i: #3F3190;
  --earn-bg: #0D1B2E; --earn-fg: #FFFFFF; --earn-fg2: #A9B8CF; --earn-acc: #8FC0FF; --earn-chip: rgba(255, 255, 255, .1);
  --toast-act: #8FC0FF;
  --shadow: 0 1px 2px rgba(13, 27, 46, .05), 0 12px 28px -16px rgba(13, 27, 46, .18);
  --r: 14px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage Grotesque', 'Be Vietnam Pro', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090E16; --surface: #111925; --surface-2: #162030; --track: #223046;
    --line: #202D41; --line-2: #2D3E57;
    --ink: #E8EDF5; --ink-2: #A9B6CA; --ink-3: #7B8AA2;
    --accent: #3987E5; --accent-strong: #86B6EF; --accent-soft: #13253F; --accent-line: #28477A;
    --good: #0CA30C; --good-ink: #62D562; --good-soft: #0F2F17;
    --warn: #FAB219; --warn-ink: #F2C25E; --warn-soft: #382C0C;
    --bad: #E66767; --bad-ink: #F29C9C; --bad-soft: #381818;
    --series: #3987E5; --series-muted: #26466F;
    --a0b: #17315A; --a0i: #9CC3F5; --a1b: #4A2412; --a1i: #F4B592; --a2b: #0F3A2A; --a2i: #7ED9B2;
    --a3b: #4A3608; --a3i: #F2CB6B; --a4b: #4A1C32; --a4i: #F2A1C2; --a5b: #2B2559; --a5i: #B7AEF2;
    --earn-bg: #16243A; --earn-fg: #E8EDF5; --earn-fg2: #9DADC4; --earn-acc: #86B6EF; --earn-chip: rgba(255, 255, 255, .08);
    --toast-act: #1C5CAB;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -16px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090E16; --surface: #111925; --surface-2: #162030; --track: #223046;
  --line: #202D41; --line-2: #2D3E57;
  --ink: #E8EDF5; --ink-2: #A9B6CA; --ink-3: #7B8AA2;
  --accent: #3987E5; --accent-strong: #86B6EF; --accent-soft: #13253F; --accent-line: #28477A;
  --good: #0CA30C; --good-ink: #62D562; --good-soft: #0F2F17;
  --warn: #FAB219; --warn-ink: #F2C25E; --warn-soft: #382C0C;
  --bad: #E66767; --bad-ink: #F29C9C; --bad-soft: #381818;
  --series: #3987E5; --series-muted: #26466F;
  --a0b: #17315A; --a0i: #9CC3F5; --a1b: #4A2412; --a1i: #F4B592; --a2b: #0F3A2A; --a2i: #7ED9B2;
  --a3b: #4A3608; --a3i: #F2CB6B; --a4b: #4A1C32; --a4i: #F2A1C2; --a5b: #2B2559; --a5i: #B7AEF2;
  --earn-bg: #16243A; --earn-fg: #E8EDF5; --earn-fg2: #9DADC4; --earn-acc: #86B6EF; --earn-chip: rgba(255, 255, 255, .08);
  --toast-act: #1C5CAB;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -16px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; height: 38px; padding: 0 12px; min-width: 0; max-width: 100%; }
input[type="checkbox"] { height: auto; width: 16px; height: 16px; accent-color: var(--accent); padding: 0; }
input:focus, select:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374839A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.muted { color: var(--ink-3); }
.muted.sm { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ico { flex: none; }

/* ---------- nút, chip, thanh ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-3); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn.block { width: 100%; }
.btn.live { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; }
.link-btn { color: var(--accent-strong); font-weight: 600; font-size: 13px; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.st-accent { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-line); }
.chip.st-warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.chip.st-good { background: var(--good-soft); color: var(--good-ink); border-color: transparent; }
.chip.as-btn { cursor: pointer; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.chip-btn:hover { background: var(--surface-2); color: var(--ink); }
.plat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.plat i { width: 8px; height: 8px; border-radius: 50%; }
.av { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; line-height: 1; letter-spacing: .01em; }
.av-0 { background: var(--a0b); color: var(--a0i); } .av-1 { background: var(--a1b); color: var(--a1i); } .av-2 { background: var(--a2b); color: var(--a2i); }
.av-3 { background: var(--a3b); color: var(--a3i); } .av-4 { background: var(--a4b); color: var(--a4i); } .av-5 { background: var(--a5b); color: var(--a5i); }
.av-x { width: 28px; height: 28px; background: var(--track); color: var(--ink-3); }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 1s var(--ease), background .4s; }
.bar.full i { background: var(--good); }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring-track { stroke: var(--track); }
.ring-fill { stroke: var(--accent); transition: stroke-dashoffset 1.1s var(--ease), stroke .4s; }
.ring-fill.full { stroke: var(--good); }
.ring-c { position: relative; text-align: center; line-height: 1.05; }
.ring-c b { font-weight: 700; font-size: 14px; }
.ring-c small { font-size: 11px; color: var(--ink-3); }
.ring-big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ring-big small { font-size: 13px; color: var(--ink-3); margin-left: 1px; }
.stack { display: inline-flex; }
.stack .av { box-shadow: 0 0 0 2px var(--surface); margin-left: -7px; }
.stack .av:first-child { margin-left: 0; }
.stack .more { margin-left: 6px; font-size: 12px; color: var(--ink-3); align-self: center; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); position: relative; flex: none; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: pulse 1.8s ease-out infinite; }

/* ---------- logo, splash ---------- */
.logo-bg { fill: var(--accent); }
.logo-check { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s .15s var(--ease) forwards; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }

/* ---------- khung ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { display: flex; flex-direction: column; gap: 16px; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 6px; }
.brand b { font: 700 18px/1.1 var(--display); letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; color: var(--ink-3); }
.nav { display: grid; gap: 2px; }
.nav-i { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; font-weight: 600; color: var(--ink-2); text-align: left; transition: background .15s, color .15s; }
.nav-i:hover { background: var(--surface-2); color: var(--ink); }
.nav-i.on { background: var(--accent-soft); color: var(--accent-strong); }
.demo { margin-top: auto; border: 1px dashed var(--line-2); border-radius: 14px; padding: 12px; display: grid; gap: 10px; font-size: 13px; background: var(--surface-2); }
.demo-h { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.demo-row { display: grid; gap: 5px; color: var(--ink-2); font-size: 12.5px; }
.demo select { width: 100%; height: 34px; font-size: 13px; }
.main { min-width: 0; }
.topbar, .tabbar { display: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px max(28px, env(safe-area-inset-left, 0px)) 64px max(28px, env(safe-area-inset-right, 0px)); animation: pageIn .5s var(--ease) backwards; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-h h1 { font: 700 30px/1.1 var(--display); letter-spacing: -.02em; }
.page-h .sub { color: var(--ink-2); margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); font-size: 13px; margin: 0 0 8px -4px; padding: 4px 8px 4px 2px; border-radius: 8px; }
.back:hover { color: var(--ink); }

/* ---------- thẻ, lưới ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.scroll-x { overflow-x: auto; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { font: 700 15px/1.3 var(--font); }
.card-h .muted { font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.grid2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.sec-h h2 { font: 700 17px var(--display); }
.sec-t { font: 700 14px var(--font); margin: 18px 0 8px; }

.kpis { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kpi { padding: 18px 20px; display: grid; align-content: start; gap: 6px; position: relative; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kpi-v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: baseline; gap: 2px; }
.kpi-v small { font-size: 16px; color: var(--ink-3); font-weight: 600; }
.kpi.hero .kpi-v { font-size: clamp(36px, 4.6vw, 52px); }
.kpi-s { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-spark { position: absolute; right: 12px; top: 38px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.delta.up { color: var(--good-ink); background: var(--good-soft); }
.delta.down { color: var(--bad-ink); background: var(--bad-soft); }
.flow-card { margin-top: 16px; }
.flow { width: 100%; }
.fn-bg { fill: var(--surface-2); stroke: var(--line); }
.fn-tick { fill: var(--c); }
.fn-warn { --c: var(--warn); } .fn-accent { --c: var(--accent); } .fn-good { --c: var(--good); } .fn-ink { --c: var(--ink-3); }
.fn-l { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--font); }
.fn-v { fill: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-family: var(--font); }
.fl { fill: none; stroke: var(--accent-line); stroke-linecap: round; }
.fp { fill: var(--accent); }

.feed { list-style: none; padding: 0; display: grid; }
.feed li { display: flex; gap: 11px; align-items: flex-start; padding: 8px 0; animation: feedIn .55s var(--ease) both; }
.feed li + li { border-top: 1px solid var(--line); }
.feed p { font-size: 13.5px; line-height: 1.4; }
.feed time { font-size: 12px; color: var(--ink-3); }
.feed-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.fi-good { background: var(--good-soft); color: var(--good-ink); } .fi-warn { background: var(--warn-soft); color: var(--warn-ink); }
.fi-accent { background: var(--accent-soft); color: var(--accent-strong); } .fi-ink { background: var(--track); color: var(--ink-2); }
.rows { list-style: none; padding: 0; display: grid; gap: 4px; }
.row-btn { width: 100%; text-align: left; display: grid; gap: 8px; padding: 10px 10px; margin: 0 -10px; border-radius: 12px; transition: background .15s; }
.row-btn:hover { background: var(--surface-2); }
.row-t { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.row-s { display: flex; gap: 10px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.rank { list-style: none; padding: 0; display: grid; gap: 12px; }
.rank li { display: flex; gap: 10px; align-items: center; }
.rk { width: 18px; text-align: center; font: 700 13px var(--mono); color: var(--ink-3); }
.rk-m { flex: 1; min-width: 0; display: grid; gap: 6px; }

/* ---------- biểu đồ ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.grid { stroke: var(--line); stroke-width: 1; }
.grid.base { stroke: var(--line-2); }
.ax { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.ax-hi { fill: var(--ink); font-weight: 700; }
.dlab { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); }
.cbar { transform-box: fill-box; transform-origin: 50% 100%; animation: barUp .8s var(--ease) both; animation-delay: calc(var(--i) * 32ms); }
.cbar.past { fill: var(--series-muted); }
.cbar.hi { fill: var(--series); }
.bar-zero { fill: var(--track); }
.tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--surface); padding: 7px 11px; border-radius: 9px; font-size: 12px; pointer-events: none; white-space: nowrap; display: grid; gap: 1px; z-index: 3; box-shadow: var(--shadow); }
.tip b { font-weight: 700; } .tip em { font-style: normal; opacity: .75; }
.spark-area { fill: var(--series); opacity: .13; }
.spark-line { stroke: var(--series); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s .1s var(--ease) forwards; }
.spark-dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }

/* ---------- toast, modal, tab con ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 150; display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--surface); padding: 11px 8px 11px 14px; border-radius: 13px; box-shadow: var(--shadow); animation: toastIn .4s var(--ease) both; font-size: 13.5px; }
.toast-msg { flex: 1; min-width: 0; }
.toast.tk-good > .ico:first-child { color: #52C452; }
.toast.tk-error > .ico:first-child { color: #FF8A8A; }
.toast-act { font-weight: 700; color: var(--toast-act); padding: 4px 8px; border-radius: 8px; }
.toast-act:hover { background: rgba(127, 127, 127, .2); }
.toast-x { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; opacity: .6; }
.toast-x:hover { opacity: 1; }
.modal-bg { position: fixed; inset: 0; background: rgba(8, 14, 24, .5); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .2s both; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: modalIn .35s var(--ease) backwards; }   /* backwards (không phải both): xong hiệu ứng thì bỏ transform, nếu không danh sách chọn (position: fixed) trong hộp thoại bị lệch theo vị trí hộp */
.modal.wide { width: min(700px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 16px 6px 20px; }
.modal-h h3 { font: 700 18px var(--display); }
.modal-b { padding: 8px 20px 18px; overflow: auto; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 3px; gap: 2px; background: var(--track); border-radius: 12px; }
.seg button { height: 32px; padding: 0 13px; border-radius: 9px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 27, 46, .12); }
.seg em { font-style: normal; font-size: 11.5px; padding: 0 6px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); line-height: 18px; }
.seg button.on em { background: var(--accent-soft); color: var(--accent-strong); }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty h4 { font: 700 15px var(--font); color: var(--ink); margin-top: 6px; }
.empty p { max-width: 360px; font-size: 13.5px; }
.empty .btn { margin-top: 10px; }
.ea-a { fill: var(--accent-soft); stroke: var(--accent-line); stroke-width: 1.5; }
.ea-b { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.ea-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s .3s var(--ease) forwards; }
.ea-float { animation: floaty 4.5s ease-in-out infinite; }

/* ---------- jobs ---------- */
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 16px; }
.jcard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; animation: cardIn .55s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.jcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.jcard.paused { background: var(--surface-2); }
.jc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jcard h3 { font: 700 17px/1.25 var(--display); letter-spacing: -.01em; }
.jc-price { font-weight: 700; margin-top: -4px; } .jc-price span { color: var(--ink-3); font-weight: 500; }
.jc-mid { display: flex; align-items: center; gap: 16px; margin: 4px 0; }
.jc-mid dl { display: grid; grid-template-columns: repeat(3, auto); gap: 2px 16px; }
dt { font-size: 11.5px; color: var(--ink-3); }
dd { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
dd small { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.jc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 4px; min-height: 30px; }
.jcard.new { border: 1.5px dashed var(--line-2); background: transparent; align-items: center; justify-content: center; text-align: center; color: var(--ink-2); min-height: 220px; gap: 6px; }
.jcard.new:hover { border-color: var(--accent); color: var(--accent-strong); box-shadow: none; }
.jcard.new span { font-size: 13px; color: var(--ink-3); }

.summary { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px 24px; flex: 1; min-width: 260px; }
.stats dd { font-size: 24px; letter-spacing: -.01em; }
.c-good { color: var(--good-ink); } .c-warn { color: var(--warn-ink); }
.posts { display: grid; gap: 12px; margin-top: 16px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; animation: cardIn .5s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.pc-h { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 18px; grid-template-areas: "n t s c" "n b b c"; gap: 6px 14px; align-items: center; padding: 14px 16px 10px; text-align: left; }
.pc-n { grid-area: n; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 700; }
.pc-t { grid-area: t; display: grid; min-width: 0; }
.pc-t a { font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-s { grid-area: s; display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.pc-h .bar { grid-area: b; }
.chev { grid-area: c; color: var(--ink-3); transition: transform .3s var(--ease); }
.pcard.open .chev { transform: rotate(180deg); }
.pc-pend { display: flex; gap: 10px; align-items: baseline; padding: 0 16px 14px 62px; font-size: 12.5px; color: var(--ink-3); }
.pc-pend code { color: var(--ink); word-break: break-word; }
.pc-body { padding: 6px 16px 16px; border-top: 1px solid var(--line); animation: expand .4s var(--ease) both; }
.tally { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; padding-top: 14px; }
.tile { position: relative; height: 44px; border-radius: 10px; font: 600 13px var(--mono); display: grid; place-items: center; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); transition: transform .15s, background .3s, color .3s, border-color .3s; animation: tileIn .45s var(--ease) both; animation-delay: calc(var(--i) * 12ms); }
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.tile.free { border-style: dashed; color: var(--ink-3); background: transparent; }
.tile.sel { outline: 2px solid var(--ink); outline-offset: 2px; }
.tile.fresh { animation: stampIn .8s var(--ease) both; }
.td { position: absolute; right: 4px; bottom: 4px; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--surface); }
.tile.done .td { box-shadow: 0 0 0 1.5px var(--accent); }
.td.av-0 { background: var(--a0i); } .td.av-1 { background: var(--a1i); } .td.av-2 { background: var(--a2i); }
.td.av-3 { background: var(--a3i); } .td.av-4 { background: var(--a4i); } .td.av-5 { background: var(--a5i); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); padding-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-2); }
.lg.done { background: var(--accent); border-color: var(--accent); } .lg.free { border-style: dashed; }

/* ---------- bảng ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { font-weight: 600; font-size: 12px; color: var(--ink-3); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .w-bar { width: 22%; min-width: 120px; }
.tbl .ck { width: 38px; padding-right: 0; }
.tbl tr.sel { background: var(--accent-soft); }
.tbl tr.warn-row td { background: var(--warn-soft); }
.tbl .clamp { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.compact td, .tbl.compact th { padding: 9px 12px; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.money { font-weight: 700; }
.tasks-tbl tbody tr { cursor: pointer; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 12px; }
.search { position: relative; display: block; flex: 1 1 200px; max-width: 320px; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--ink-3); }
.search input { width: 100%; padding-left: 34px; }
.pills { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pill { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.pill:hover { border-color: var(--ink-3); }
.pill.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; animation: expand .3s var(--ease); }
.bulk select { height: 34px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; }
.pager div { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- form ---------- */
.fld { display: grid; gap: 6px; margin-bottom: 12px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fld em { color: var(--bad); font-style: normal; margin-left: 3px; }
.fld.need select { border-color: var(--warn); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld input, .fld select { width: 100%; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check.box { align-items: flex-start; padding: 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.check.box div { display: grid; gap: 2px; font-size: 13px; }
.checks { display: grid; gap: 8px; margin-top: 10px; }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.note.pad { margin-top: 14px; }
.note svg { margin-top: 2px; color: var(--ink-3); }
.alert.err { display: flex; gap: 8px; align-items: flex-start; background: var(--bad-soft); color: var(--bad-ink); padding: 10px 12px; border-radius: 10px; margin-top: 12px; max-width: 560px; }
.kv { display: grid; gap: 10px; margin-bottom: 14px; }
.kv > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: center; }
.kv dd { font-size: 14px; font-weight: 500; }
.kv a { display: inline-flex; align-items: center; gap: 4px; word-break: break-all; }
.quote { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; justify-items: start; }
.quote p { line-height: 1.55; }

/* ---------- nhập Excel ---------- */
.stepper { display: flex; justify-content: space-between; position: relative; list-style: none; padding: 0; margin: 0 0 26px; max-width: 520px; }
.st-line { position: absolute; left: 16px; right: 16px; top: 15px; height: 2px; background: var(--line-2); }
.st-line i { display: block; height: 100%; background: var(--accent); width: calc(var(--p) * 100%); transition: width .6s var(--ease); }
.stepper li { position: relative; display: grid; justify-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.st-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); font-weight: 700; transition: all .3s; }
.stepper li.cur { color: var(--ink); } .stepper li.cur .st-dot { border-color: var(--accent); color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper li.done { color: var(--ink); } .stepper li.done .st-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.import-1 { display: grid; justify-items: start; gap: 4px; max-width: 760px; }
.dz { width: 100%; border: 2px dashed var(--line-2); border-radius: 20px; padding: 28px 20px; display: grid; justify-items: center; gap: 8px; text-align: center; background: var(--surface); transition: border-color .2s, background .2s; }
.dz.drag { border-color: var(--accent); background: var(--accent-soft); }
.dz h3 { font: 700 19px var(--display); } .dz p { color: var(--ink-2); margin-bottom: 8px; }
.or { width: 100%; display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.hint { margin-top: 22px; width: 100%; } .hint h4 { font: 700 14px var(--font); margin-bottom: 8px; }
.hint ul { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.ia-sheet { fill: var(--surface-2); stroke: var(--line-2); } .ia-head { fill: var(--line-2); }
.ia-cell { fill: var(--track); animation: cellPulse 3.6s ease-in-out infinite; animation-delay: var(--d); }
.ia-flow { stroke: var(--accent); animation: dash 1s linear infinite; }
.ia-out { fill: var(--surface); stroke: var(--line-2); } .ia-line { fill: var(--line-2); }
.ia-card { transform-box: fill-box; transform-origin: center; animation: iaPop 3.6s var(--ease) infinite; }
.ia-card.c1 { animation-delay: .3s; } .ia-card.c2 { animation-delay: 1s; } .ia-card.c3 { animation-delay: 1.7s; }
.im-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.map-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.map h3 { font: 700 15px var(--font); margin-bottom: 14px; }
.preview th.mapped { background: var(--accent-soft); color: var(--accent-strong); }
.preview th em { display: block; font-style: normal; font-size: 11px; font-weight: 700; }
.preview td { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview td.mapped { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.wiz-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-row.tight { margin: 4px 0 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-row.tight .stat b { font-size: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; gap: 2px; }
.stat b { font-size: 24px; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat > span { font-size: 12.5px; color: var(--ink-2); }
.stat.big { grid-column: span 2; } .stat.big b { font-size: 30px; }
.stat.warn { background: var(--warn-soft); border-color: transparent; }
.issues { list-style: none; padding: 0; display: grid; gap: 9px; }
.issues li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.issues .error svg { color: var(--bad); } .issues .warn svg { color: var(--warn-ink); margin-top: 1px; }
.ok-line { display: flex; gap: 8px; align-items: center; color: var(--good-ink); font-weight: 600; }

/* ---------- lương ---------- */
.months { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; }
.month { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; color: var(--ink-2); }
.month:hover { border-color: var(--ink-3); }
.month.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.dot-warn { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; margin: 4px 0 16px; animation: expand .4s var(--ease); }
.banner > div { flex: 1; display: grid; gap: 1px; min-width: 0; } .banner span { font-size: 13px; opacity: .9; }
.banner.good { background: var(--good-soft); color: var(--good-ink); } .banner.warn { background: var(--warn-soft); color: var(--warn-ink); } .banner.info { background: var(--accent-soft); color: var(--accent-strong); }
.pay th.jh span { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; }
.pay .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pay thead .sticky, .pay tfoot .sticky, .pay .price-row .sticky { background: var(--surface-2); }
.pay tbody tr { cursor: pointer; animation: rowIn .45s var(--ease) both; animation-delay: calc(var(--i) * 30ms); }
.pay tbody tr:hover .sticky { background: var(--surface-2); }
.price-row td { font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 6px; padding-bottom: 8px; }
.pay .zero { color: var(--line-2); }
.stamp-bg { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; background: rgba(8, 14, 24, .5); animation: fade .2s both; }
.stamp { color: var(--accent-strong); background: var(--surface); border-radius: 20px; padding: 14px; transform: rotate(-6deg); animation: stampDrop .8s var(--ease) both; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); max-width: 92vw; }
.stamp-t { font: 800 54px var(--display); fill: currentColor; letter-spacing: .02em; }
.stamp-s { font: 700 18px var(--font); fill: currentColor; letter-spacing: .08em; }
.ctv-tbl tr.off td { opacity: .55; }
.ctv-tbl tr.off td:nth-last-child(-n+2) { opacity: 1; }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); }
.code:hover { border-color: var(--accent); color: var(--ink); }
.switch { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; vertical-align: middle; }
.switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch.on { background: var(--good); } .switch.on i { transform: translateX(16px); }
.sw-l { margin-left: 8px; font-size: 12.5px; }

/* ---------- CTV (điện thoại) ---------- */
.phone { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px)); }
.ph-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0 8px; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 5; }
.ph-h small { display: block; color: var(--ink-3); font-size: 12.5px; }
.ph-h b { font-size: 16px; }
.ph-demo { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border-radius: 99px; padding: 4px 11px; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 12px; }
.ph-m { flex: 1; padding-bottom: 104px; min-width: 0; }
.ph-m .page { padding: 0; max-width: none; }
.ph-tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(16px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
.ph-tabs button { flex: 1; max-width: 260px; display: grid; justify-items: center; gap: 2px; padding: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-radius: 12px; }
.ph-tabs button.on { color: var(--accent-strong); }
.earn { --fg: var(--earn-fg); --fg2: var(--earn-fg2); --acc: var(--earn-acc); --chip: var(--earn-chip); background: var(--earn-bg); color: var(--fg); border-radius: 22px; padding: 20px 20px 16px; overflow: hidden; }
.earn.calm { --fg: var(--ink); --fg2: var(--ink-2); --acc: var(--accent); --chip: var(--track); background: var(--surface); border: 1px solid var(--line); }
.earn-l { font-size: 13px; color: var(--fg2); font-weight: 600; }
.earn-v { font-size: 42px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 6px 0 4px; }
.earn-s { font-size: 13px; color: var(--fg2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.earn-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 14px; gap: 10px; }
.pill-today { display: inline-flex; gap: 6px; align-items: center; padding: 6px 11px; border-radius: 99px; background: var(--chip); font-size: 12.5px; font-weight: 600; }
.pill-today.on { color: var(--acc); }
.earn .spark-line { stroke: var(--acc); } .earn .spark-area { fill: var(--acc); } .earn .spark-dot { fill: var(--acc); stroke: var(--earn-bg); }
.cjobs { display: grid; gap: 10px; }
.cjob { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; animation: cardIn .5s var(--ease) both; animation-delay: calc(var(--i) * 50ms); transition: transform .15s; }
.cjob:active { transform: scale(.985); } .cjob.off { opacity: .7; }
.cj-m { flex: 1; min-width: 0; display: grid; gap: 4px; } .cj-m > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cj-s { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.go { color: var(--ink-3); }
.cj-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 14px; }
.cj-h h1 { font: 700 24px/1.15 var(--display); letter-spacing: -.015em; margin-bottom: 6px; }
.cgroup { margin-top: 14px; }
.cgroup > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.cgroup > header > div { display: grid; }
.tcard { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 10px; transition: background .35s, border-color .35s; animation: cardIn .45s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.tcard.done { background: var(--surface-2); border-color: transparent; }
.tcard.done .tc-body { color: var(--ink-3); }
.tc-main { flex: 1; min-width: 0; }
.tc-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.stt { font: 600 12px var(--mono); background: var(--ink); color: var(--surface); padding: 2px 8px; border-radius: 6px; }
.dir { font-size: 12px; color: var(--accent-strong); background: var(--accent-soft); padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.when { font-size: 12px; color: var(--good-ink); display: inline-flex; gap: 4px; align-items: center; }
.tc-body { font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tc-act { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tick { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 2.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; position: relative; transition: background .25s, border-color .25s, transform .15s; }
.tick svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .4s .05s var(--ease); }
.tick:active { transform: scale(.9); }
.tick:not(.on):hover { border-color: var(--good); }
.tick:not(.on) svg { stroke: var(--line-2); stroke-dashoffset: 0; }
.tick:not(.on):hover svg { stroke: var(--good); }
.tick.on { background: var(--good); border-color: var(--good); }
.tick.on svg { stroke-dashoffset: 0; stroke: #fff; }
.tick.pop::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2.5px solid var(--good); animation: ripple .8s var(--ease) forwards; pointer-events: none; }
.all-done { display: flex; align-items: center; gap: 8px; color: var(--good-ink); font-weight: 600; padding: 6px 2px; }
.fx-coin { position: fixed; z-index: 220; pointer-events: none; font-weight: 800; font-size: 17px; color: var(--good-ink); background: var(--surface); border: 1.5px solid var(--good); padding: 4px 11px; border-radius: 99px; animation: coinUp 1.15s var(--ease) forwards; box-shadow: var(--shadow); white-space: nowrap; }
.finish { display: grid; justify-items: center; gap: 6px; padding: 30px 0 10px; text-align: center; }
.fin-c { fill: var(--good-soft); stroke: var(--good); stroke-width: 2.5; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw160 .9s var(--ease) forwards; }
.fin-p { stroke: var(--good); stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .55s .7s var(--ease) forwards; }

/* ---------- keyframes ---------- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes draw160 { to { stroke-dashoffset: 0; } }
@keyframes barUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes tileIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes stampIn { 0% { transform: scale(1.55); box-shadow: 0 0 0 0 var(--accent); } 55% { transform: scale(.9); } 100% { transform: scale(1); box-shadow: 0 0 0 14px transparent; } }
@keyframes expand { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }
@keyframes coinUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 18% { opacity: 1; transform: translate(-50%, -80%) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -230%) scale(1); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes dash { to { stroke-dashoffset: -20; } }
@keyframes cellPulse { 0%, 100% { fill: var(--track); } 35% { fill: var(--accent-line); } 60% { fill: var(--track); } }
@keyframes iaPop { 0%, 8% { opacity: .25; transform: scale(.94); } 22%, 72% { opacity: 1; transform: scale(1); } 100% { opacity: .25; transform: scale(.94); } }
@keyframes stampDrop { 0% { opacity: 0; transform: rotate(-16deg) scale(2.8); } 50% { opacity: 1; transform: rotate(-6deg) scale(.92); } 72% { transform: rotate(-6deg) scale(1.04); } 100% { transform: rotate(-6deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi.hero { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .kpi.hero + .kpi { border-left: 0; }
  .grid2, .grid2.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); align-content: start; }   /* không để thanh trên cùng giãn ra chiếm phần màn hình còn trống khi trang ngắn */
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); position: sticky; top: env(safe-area-inset-top, 0px); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); z-index: 10; }
  .topbar .brand { padding: 0; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
  .tabbar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); border-radius: 12px; }
  .tabbar button.on { color: var(--accent-strong); }
  .page { padding: 12px max(16px, env(safe-area-inset-right, 0px)) 104px max(16px, env(safe-area-inset-left, 0px)); }
  .page-h h1 { font-size: 26px; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .map-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:last-child { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .kpi { padding: 14px 16px; } .kpi-v { font-size: 26px; } .kpi-spark { display: none; }
  .fn-l { font-size: 11px; } .fn-v { font-size: 22px; }
  .pc-h { grid-template-columns: auto minmax(0, 1fr) 18px; grid-template-areas: "n t c" "s s s" "b b b"; }
  .pc-s { justify-content: flex-start; }
  .pc-pend { padding-left: 16px; }
  .fld-row { grid-template-columns: minmax(0, 1fr); }
  .stat.big { grid-column: 1 / -1; }
  .jc-mid dl { gap: 2px 12px; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .modal-bg { align-items: end; padding: 0; grid-template-columns: minmax(0, 1fr); } .modal, .modal.wide { width: 100%; min-width: 0; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-f { flex-wrap: wrap; } .modal-f .grow { flex: 1 1 0; }   /* nhiều nút ở chân hộp (vd. xem ảnh nghiệm thu) thì xuống dòng, không đẩy hộp rộng hơn màn hình */
  .stamp-t { font-size: 48px; }
}


/* ---------- đăng nhập, tài khoản, vai trò, nhật ký ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth.single { grid-template-columns: minmax(0, 1fr); }
.auth-art { background: var(--earn-bg); color: var(--earn-fg); padding: 36px 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.auth-art .brand b { color: var(--earn-fg); font: 700 20px var(--display); }
.auth-art h2 { font: 700 30px/1.15 var(--display); letter-spacing: -.02em; margin: 26px 0 10px; max-width: 420px; }
.auth-art p { color: var(--earn-fg2); max-width: 380px; }
.auth-art small { color: var(--earn-fg2); }
.auth-svg { width: min(360px, 100%); height: auto; display: block; }
.auth-main { display: grid; place-items: center; padding: 32px max(20px, env(safe-area-inset-right, 0px)) 32px max(20px, env(safe-area-inset-left, 0px)); }
.auth-card { width: min(400px, 100%); display: grid; gap: 4px; }
.auth-card h1 { font: 700 28px var(--display); letter-spacing: -.02em; margin: 6px 0 0; }
.auth-card > p.muted { margin-bottom: 14px; }
.auth-card .brand.sm { display: none; margin-bottom: 20px; padding: 0; }
.auth.single .brand.sm { display: flex; }
.auth-card .btn { margin-top: 4px; }
.btn.lg { height: 44px; font-size: 15px; }
.small { font-size: 12.5px; }
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 3px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-3); border-radius: 8px; }
.pw-eye:hover { color: var(--ink); }
.pw-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.acct { margin-top: auto; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; background: var(--surface-2); }
.acct.flat { margin-top: 12px; }
.acct-h { display: flex; gap: 10px; align-items: center; min-width: 0; }
.acct-h > div { min-width: 0; display: grid; }
.acct-h b, .acct-h small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-h small { color: var(--ink-3); font-size: 12px; }
.acct-b { display: flex; gap: 6px; flex-wrap: wrap; }
.sheet-nav { display: grid; gap: 2px; margin-bottom: 8px; }
.ph-acct { margin-top: 28px; }
.stack-t { display: grid; line-height: 1.25; }
.stack-t small { color: var(--ink-3); font-size: 12px; }
code.mini { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.users-tbl tr.off td { opacity: .55; }
.users-tbl tr.off td:nth-last-child(-n+2) { opacity: 1; }
.cred { display: grid; gap: 10px; margin-bottom: 14px; }
.cred > div { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.cred span { color: var(--ink-3); font-size: 12.5px; min-width: 100px; }
.cred code { font-family: var(--mono); font-weight: 600; flex: 1; word-break: break-all; }
.cred code.big { font-size: 17px; letter-spacing: .02em; }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn-ink); }
.note.warn svg { color: var(--warn-ink); }
.role-desc { margin: -4px 0 12px; }
.roles-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.role-list { padding: 8px; display: grid; gap: 2px; }
.role-i { text-align: left; padding: 10px 12px; border-radius: 10px; display: grid; gap: 2px; }
.role-i:hover { background: var(--surface-2); }
.role-i.on { background: var(--accent-soft); }
.role-n { display: flex; gap: 8px; align-items: center; }
.role-n em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 7px; }
.role-i small { color: var(--ink-3); font-size: 12px; }
.role-edit .note { margin-bottom: 14px; }
.perm-groups { display: grid; gap: 14px; margin-top: 4px; }
.perm-groups fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px 10px; margin: 0; min-width: 0; }
.perm-groups legend { font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.perm > span { display: grid; gap: 1px; flex: 1; }
.perm small { color: var(--ink-3); font-size: 12px; }
.perm.dis { cursor: not-allowed; opacity: .7; }
.perm > svg { color: var(--ink-3); margin-top: 2px; }
.role-foot { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.grow { flex: 1; }
.btn.danger { color: var(--bad-ink); border-color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
.pager.center { justify-content: center; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); }
.audit-tbl td { vertical-align: top; }
@media (max-width: 880px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-card .brand.sm { display: flex; }
  .roles-grid { grid-template-columns: minmax(0, 1fr); }
}

.role-tools { display: flex; align-items: center; gap: 12px; margin: -2px 0 14px; flex-wrap: wrap; }

.gs { width: 100%; display: grid; gap: 10px; }
.gs h3 { font: 700 17px var(--display); }
.gs-row { display: flex; gap: 8px; }
.gs-row input { flex: 1; min-width: 0; }
.gs .alert.err { margin-top: 0; max-width: none; }
@media (max-width: 640px) { .gs-row { flex-direction: column; } }

/* ---------- CTV: thẻ nv rõ ràng, nút lớn ---------- */
.tcard.tc2 { display: block; scroll-margin-top: 112px; }
.tcard.tc2 .tc-body { display: block; -webkit-line-clamp: unset; overflow: visible; font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; margin: 2px 0 0; }
.tc-acts { display: grid; gap: 8px; margin-top: 14px; }
.tc-done { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); color: var(--good-ink); font-weight: 600; font-size: 13.5px; }
.tc-done > span { display: inline-flex; align-items: center; gap: 6px; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.good:hover:not(:disabled) { background: var(--good); filter: brightness(.93); border-color: var(--good); }
.btn.lg { height: 48px; font-size: 15px; }
.link-btn.center { text-align: center; justify-self: center; padding: 4px 8px; color: var(--ink-2); }
.cj-sum { margin: -4px 0 14px; color: var(--ink-2); }
.cgroup > header .remain { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.cgroup > header .remain code { color: var(--ink); font-weight: 600; word-break: break-word; }
.cgroup > header .remain.cg-gap { display: block; line-height: 1.45; } .cgroup > header .remain.cg-gap svg { margin-right: 4px; vertical-align: -2px; color: var(--ink-3); }
.cgroup > header .remain.cg-gap.cg-wait { color: var(--warn-ink); } .cgroup > header .remain.cg-gap.cg-wait svg { color: var(--warn-ink); }
.resume { margin-bottom: 4px; justify-content: flex-start; gap: 12px; height: auto; padding: 10px 16px; text-align: left; }
.resume .rs-t { display: grid; min-width: 0; line-height: 1.3; }
.resume .rs-t small { font-weight: 500; opacity: .9; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- hướng dẫn lần đầu ---------- */
.start { margin-bottom: 16px; }
.start.big { max-width: 720px; padding: 22px 24px; }
.start-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.start-h h2 { font: 700 20px var(--display); letter-spacing: -.01em; }
.start-h p { margin-top: 4px; }
.steps { list-style: none; padding: 0; display: grid; gap: 4px; }
.steps li { display: flex; gap: 14px; padding: 12px; border-radius: 12px; }
.steps li.cur { background: var(--accent-soft); }
.steps li.done b { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--line-2); }
.steps b { display: block; font-size: 15px; }
.steps p { color: var(--ink-2); font-size: 13.5px; margin: 2px 0 8px; max-width: 560px; }
.steps li:not(.cur) p { margin-bottom: 0; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--track); color: var(--ink-2); margin-top: 1px; }
.steps li.cur .step-n { background: var(--accent); color: #fff; }
.steps li.done .step-n { background: var(--good-soft); color: var(--good-ink); }
.banner .btn { flex: none; }
.hint-need { display: flex; gap: 6px; align-items: center; margin-top: 12px; font-size: 13px; }
.wiz-foot .wf-l { display: flex; gap: 8px; }

/* ---------- CTV: thanh tiến độ ghim khi cuộn, gộp post đã xong ---------- */
.cj-strip { position: sticky; top: calc(62px + env(safe-area-inset-top, 0px)); z-index: 4; margin: 0 -16px; padding: 7px 16px 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; background: var(--bg); border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease); height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; border-bottom-color: transparent; }
.cj-strip.on { opacity: 1; transform: none; height: auto; padding-top: 7px; padding-bottom: 8px; border-bottom-color: var(--line); }
.cj-strip b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cj-strip span { font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cj-strip .bar { grid-column: 1 / -1; height: 4px; }
.done-posts { margin-top: 20px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--good-soft); color: var(--good-ink); font-weight: 600; text-align: left; }
.done-posts span { flex: 1; }
.done-posts em { font-style: normal; font-size: 13px; text-decoration: underline; }

/* ---------- admin: bớt rối, dễ thấy việc cần làm ---------- */
.start-slim { flex-wrap: wrap; }
.start-slim > div { min-width: 220px; }
.banner .link-btn { flex: none; color: inherit; opacity: .8; }
.sel-all { display: none; margin: 0 0 10px; }
.bulk { position: sticky; top: 10px; z-index: 6; box-shadow: 0 8px 20px -12px rgba(13, 27, 46, .35); }
.pay th.jh span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 150px; min-width: 80px; line-height: 1.3; }
.pay th.jh { vertical-align: bottom; }
.pay .go { width: 28px; padding-left: 0; color: var(--ink-3); text-align: right; }
.pay tbody tr:hover .go { color: var(--accent-strong); }
.row-acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px 14px; }
.row-acts > * { white-space: nowrap; flex: none; }
.row-acts .ln { display: grid; gap: 2px; justify-items: start; }
.users-tbl td.acts { width: 1%; }
.pay-cards { display: none; }
.pay-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left; color: var(--ink-3); }
.pay-card .pc-m { flex: 1; min-width: 0; display: grid; }
.pay-card .pc-m b { color: var(--ink); }
.pay-card small { color: var(--ink-3); font-size: 12.5px; }
.pay-card .pc-v { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .pay-wrap { display: none; }
  .pay-cards { display: grid; gap: 8px; }
}
/* Điện thoại: bảng nhiều cột chuyển thành từng thẻ, không phải cuộn ngang để tìm nút bấm */
@media (max-width: 880px) { .bulk { top: 64px; } }
@media (max-width: 640px) {
  .sel-all { display: flex; }
  .tbl.cardify, .tbl.cardify tbody, .tbl.cardify tr, .tbl.cardify td { display: block; width: 100%; }
  .tbl.cardify thead { display: none; }
  .tbl.cardify tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl.cardify tbody tr:last-child { border-bottom: 0; }
  .tbl.cardify td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; min-width: 0; }
  .tbl.cardify td[data-l]::before { content: attr(data-l); color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-align: left; flex: none; }
  .tbl.cardify td:first-child { justify-content: flex-start; text-align: left; padding-bottom: 8px; }
  .tbl.cardify td.acts { justify-content: flex-start; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .tbl.cardify td.ck { width: 100%; padding-right: 0; }
  .tbl.cardify td.clamp { display: block; max-width: none; white-space: normal; text-align: left; }
  .tbl.cardify td.clamp::before { display: block; margin-bottom: 2px; }
  .tbl.cardify .row-acts { justify-content: flex-start; flex-wrap: wrap; }
  .tbl.cardify .row-acts .ln { display: flex; gap: 14px; flex-wrap: wrap; }
  .tbl.cardify td.nowrap { white-space: normal; }
}

/* ---------- quản lý job/nv trên web, trả lương, phiếu lương ---------- */
textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.5; }
textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.target-job { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 12px; }
.target-job b { font-size: 16px; }
.task-edit { display: grid; }
.te-foot { display: flex; justify-content: flex-end; gap: 8px; }
.q-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn.danger-o { color: var(--bad-ink); border-color: var(--bad); background: transparent; }
.pay-st { white-space: nowrap; }
.pay-card .chip { margin-top: 4px; justify-self: start; }
.pd-status { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.pd-list { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pd-list summary { cursor: pointer; padding: 11px 14px; font-weight: 600; background: var(--surface-2); }
.pd-list[open] summary { border-bottom: 1px solid var(--line); }
.pd-list .tbl { font-size: 13px; }
.sel-row { padding: 8px 2px 4px; }
.pay-pick { max-height: 280px; overflow: auto; margin: 6px 0 14px; padding-right: 4px; }
.pay-pick .check { padding: 6px 2px; }
.slip { display: grid; gap: 14px; }
.slip-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.slip-brand { display: flex; align-items: center; gap: 8px; }
.slip-t { text-align: right; }
.slip-t h2 { font: 700 17px var(--display); letter-spacing: .02em; }
.slip-t p { color: var(--ink-2); font-size: 13px; }
.slip-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.slip-kv > div { display: grid; gap: 1px; }
.slip-kv dt { font-size: 12px; color: var(--ink-3); }
.slip-det { display: grid; gap: 10px; }
.sd-job b { display: block; margin-bottom: 2px; }
.sd-job p { font-size: 13.5px; line-height: 1.6; }
.sd-p { font-weight: 600; margin-right: 4px; }
.sd-job code { font-family: var(--mono); font-size: 12.5px; word-break: break-word; }
.slip-f { font-size: 12px; color: var(--ink-3); padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .slip-kv { grid-template-columns: minmax(0, 1fr); } .slip-h { flex-direction: column; align-items: flex-start; } .slip-t { text-align: left; } }

/* In bảng lương và phiếu lương */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #000; font-size: 12px; }
  .side, .topbar, .tabbar, .toasts, .page-act, .months, .no-print, .pay-cards, .pay .go, .back, .live, .banner .btn { display: none !important; }
  .app { display: block; }
  .page { padding: 0 !important; max-width: none !important; animation: none !important; }
  .card, .stat, .banner { box-shadow: none !important; }
  .pay-wrap { overflow: visible !important; }
  .pay tbody tr { animation: none !important; }
  .pay .sticky { position: static !important; }
  body.printing-slip * { visibility: hidden; }
  body.printing-slip .slip, body.printing-slip .slip * { visibility: visible; }
  body.printing-slip .modal-bg, body.printing-slip .modal, body.printing-slip .modal-b { position: static !important; display: block !important; overflow: visible !important; max-height: none !important; width: auto !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; animation: none !important; }
  body.printing-slip .slip { position: absolute; left: 0; top: 0; width: 100%; }
  body.printing-slip .modal-h, body.printing-slip .modal-f { display: none !important; }
}

.ctv-tbl td.r, .ctv-tbl .sw-l { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 641px) { .ctv-tbl .sw-l { display: none; } }

/* ---------- ảnh kết quả ---------- */
label.btn.attach { cursor: pointer; background: var(--accent); border-color: var(--accent); color: #fff; }
label.btn.attach:hover { background: var(--accent-strong); }
label.dis, label.btn.dis { opacity: .5; pointer-events: none; }
label.link-btn { cursor: pointer; }
.proof-hint { margin: -2px 2px 2px; font-size: 12.5px; color: var(--ink-2); text-align: center; }
.proof-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); }
.proof-row > div { display: grid; gap: 2px; min-width: 0; }
.proof-row b { display: inline-flex; align-items: center; gap: 6px; color: var(--good-ink); font-size: 14px; }
.proof-thumb { flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--track); padding: 0; }
.proof-thumb img, .proof-mini img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.proof-mini { flex: none; width: 34px; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); padding: 0; }
.proof-big { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line); }
.proof-thumb.lg { width: 96px; height: 96px; vertical-align: middle; }
.proof-thumb-cell { display: inline-flex; align-items: center; justify-content: center; height: 28px; max-width: 90px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface); padding: 1px 4px; cursor: pointer; overflow: hidden; vertical-align: middle; transition: transform 0.12s, border-color 0.12s; }
.proof-thumb-cell:hover { transform: scale(1.08); border-color: var(--accent); }
.proof-thumb-cell img { height: 24px; width: auto; border-radius: 3px; display: block; }
.proof-badge-btn { font-size: 11px; font-weight: 600; color: var(--accent); padding: 2px 6px; border-radius: 4px; background: var(--surface-2, rgba(37, 99, 235, 0.08)); line-height: 18px; white-space: nowrap; }
.proof-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--ink-3); vertical-align: middle; }
.proof-btn { display: inline-flex; align-items: center; gap: 5px; }
.tc-done { flex-wrap: wrap; }

/* ---------- tạo job, bảng task, chọn hàng loạt ---------- */
.cc-0 { --cb: var(--a0b); --ci: var(--a0i); } .cc-1 { --cb: var(--a1b); --ci: var(--a1i); } .cc-2 { --cb: var(--a2b); --ci: var(--a2i); }
.cc-3 { --cb: var(--a3b); --ci: var(--a3i); } .cc-4 { --cb: var(--a4b); --ci: var(--a4i); } .cc-5 { --cb: var(--a5b); --ci: var(--a5i); }
.nj { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.nj-main { display: grid; gap: 16px; min-width: 0; } .nj-side { display: grid; gap: 16px; position: sticky; top: 16px; min-width: 0; }
.nj-card { padding: 18px 20px; }
.nj-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.nj-h h2 { font: 700 17px var(--display); } .nj-h p { font-size: 13px; margin-top: 1px; }
.nj-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; }
.tw { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tw-col { display: grid; gap: 10px; align-content: start; } .tw-col > b { font-size: 12.5px; color: var(--ink-2); }
.tw-col .dtf, .fld .dtf { width: 100%; }
.qchips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qchip { height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.qchip:hover { border-color: var(--accent); color: var(--accent-strong); }
.tw-sum { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; }
.tw-sum svg { flex: none; margin-top: 2px; }
.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.warn-t { color: var(--warn-ink); display: flex; gap: 5px; align-items: center; margin-top: 6px; }
.cpick { display: grid; gap: 12px; }
.cp-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 4px; }
.cp-n { font-size: 13px; color: var(--ink-2); } .cp-n b { color: var(--ink); font-size: 15px; }
.cp-head { display: grid; gap: 8px; } .cp-head .search { max-width: none; } .cp-head .pill { height: 30px; font-size: 12.5px; } .cp-head .pill small { opacity: .7; margin-left: 2px; font-size: 11.5px; }
/* danh sách CTV: mỗi người một dòng, cuộn khi nhiều, không dàn dài cả trang */
.cp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; padding: 3px; margin: -3px; align-content: start; }
.cp-list.scrolls { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; border-radius: 10px; }
.crow { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 46px; padding: 0 12px 0 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; transition: background .18s, border-color .18s, transform .15s; }
.crow:hover { border-color: var(--ci, var(--ink-3)); background: var(--cb, var(--surface-2)); }
.crow:active { transform: scale(.985); }
.crow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.crow .bx { width: 20px; height: 20px; border-radius: 6px; border: 1.8px solid var(--line-2); display: grid; place-items: center; flex: none; background: var(--surface); color: var(--cb); transition: background .18s, border-color .18s; }
.crow.on { background: var(--cb); border-color: var(--ci); }
.crow.on .nm { color: var(--ci); }
.crow.on .bx { background: var(--ci); border-color: var(--ci); } .crow.on .bx svg { animation: ckPop .28s var(--ease); }
@keyframes ckPop { from { transform: scale(.3); opacity: 0; } }
.crow em { flex: none; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--ci); color: var(--cb); border-radius: 99px; padding: 0 8px; line-height: 20px; animation: ckPop .28s var(--ease); }
.cp-empty { grid-column: 1 / -1; padding: 14px 4px; text-align: center; }
/* ba cách chia luôn nằm gọn một hàng, kể cả trên điện thoại */
.cpick .seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); overflow: visible; }
.cpick .seg button { justify-content: center; padding: 0 6px; gap: 5px; min-width: 0; font-size: 13.5px; }
.cp-hint { font-size: 12.5px; color: var(--ink-2); margin: -4px 0 0; }
.split-prev { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sp-strip { display: flex; flex-wrap: wrap; gap: 3px; }
.sp-strip i { width: 10px; height: 16px; border-radius: 3px; background: var(--ci); animation: stripIn .5s var(--ease) both; } .sp-strip i.free { background: var(--track); }
@keyframes stripIn { from { transform: scaleY(.2); opacity: 0; } }
.nj-sum dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 14px; }
.nj-sum dt { font-size: 12px; color: var(--ink-3); } .nj-sum dd { font: 700 19px var(--display); font-variant-numeric: tabular-nums; }
.nj-sum h3 { font: 700 15px var(--display); }
.nj-errs { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; font-size: 12.5px; color: var(--warn-ink); }
.nj-errs li { display: flex; gap: 6px; align-items: center; }
.jc-when { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin: -6px 0 2px; }
.jt { display: flex; align-items: center; gap: 7px; margin: -10px 0 14px; font-size: 13px; color: var(--ink-2); }
.joblink { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; margin-left: 6px; }
.ctv-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.csc { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 7px; border-radius: 99px; border: 1.5px solid var(--line-2); background: var(--surface); text-align: left; transition: transform .15s, border-color .2s, background .2s; }
.csc > span { display: grid; line-height: 1.2; } .csc b { font-size: 13px; } .csc small { font-size: 11.5px; color: var(--ink-3); }
.csc:hover { transform: translateY(-1px); background: var(--cb, var(--surface-2)); border-color: var(--ci, var(--ink-3)); }
.csc.free { border-style: dashed; }
.bar-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 10px; }
.board-hint { display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--ink-3); margin: 0 0 10px; }
.selbar { position: sticky; bottom: 14px; z-index: 8; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 14px 0 0; background: var(--ink); color: var(--surface); border-radius: 14px; box-shadow: 0 14px 30px -10px rgba(13, 27, 46, .6); animation: selUp .25s var(--ease); }
@keyframes selUp { from { transform: translateY(14px); opacity: 0; } }
.selbar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: inherit; }
.selbar .btn:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.selbar .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.selbar .btn.danger-o { color: #FFB4B4; border-color: rgba(255, 140, 140, .5); }
.selbar .link-btn { color: inherit; opacity: .85; } .selbar .muted { color: inherit; opacity: .7; }
.selbar select { height: 34px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: inherit; }
.selbar select option { color: var(--ink); background: var(--surface); }
.sb-n b { font-size: 17px; } .sb-give { display: flex; gap: 6px; }
kbd { font: 600 10.5px var(--mono); padding: 1px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: .7; }
.board { position: relative; display: grid; gap: 16px; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.bsec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 16px; }
.bsec-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; padding-bottom: 12px; user-select: text; -webkit-user-select: text; }
.bs-t { font-weight: 700; font-size: 13.5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 7px; }
.tile { height: 46px; animation: none; border-color: transparent; }
.tile.todo { background: var(--cb); color: var(--ci); border-color: color-mix(in srgb, var(--ci) 40%, transparent); }
.tile.done { background: var(--ci); color: var(--surface); border-color: var(--ci); }
.tile.free { background: transparent; color: var(--ink-3); border: 1.5px dashed var(--line-2); }
.tile.sel { outline: none; transform: scale(.93); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--accent); }
.tile.sel::after { content: ''; position: absolute; inset: 0; border-radius: 9px; background: color-mix(in srgb, var(--accent) 22%, transparent); pointer-events: none; }
.tile:hover { transform: translateY(-2px); border-color: var(--ci, var(--accent)); } .tile.sel:hover { transform: scale(.93); }
.tk { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); color: var(--ci); display: grid; place-items: center; }
.tp { position: absolute; left: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--surface); opacity: .9; }
.lasso { position: fixed; display: none; z-index: 60; pointer-events: none; border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 6px; }
.board-legend { margin-top: 4px; }
.lg.todo { background: var(--a0b); border-color: var(--a0i); } .lg.done { background: var(--a0i); border-color: var(--a0i); }
.tasks-tbl tbody tr.sel { background: var(--accent-soft); }
.sec-t + .cpick { margin-top: 4px; }
@media (max-width: 1080px) { .nj { grid-template-columns: minmax(0, 1fr); } .nj-side { position: static; } .tw { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 880px) { .selbar { bottom: 78px; } }

/* CTV: job chưa tới giờ, sắp bắt đầu */
.wait { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 34px 10px 10px; }
.wait h1 { font: 700 22px/1.2 var(--display); margin-top: 6px; }
.wait .wt-r { fill: var(--accent-soft); stroke: var(--accent-line); stroke-width: 3; } .wait .wt-h { stroke: var(--accent-strong); }
.wt-big { font-size: 18px; } .wt-big b { color: var(--accent-strong); font-family: var(--display); }
.cjob.soon { background: var(--surface-2); border-style: dashed; }
.soon-ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn-ink); flex: none; }
.sub-h { font: 700 14px var(--font); color: var(--ink-2); margin: 18px 0 8px; }
.cj-end { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); margin: 0 0 10px; }

.banner { flex-wrap: wrap; } .banner > div { flex: 1 1 220px; }

/* ---------- đồ hoạ chuyển động (fx.js) ---------- */
/* màn đăng nhập: bảng task tự quét chọn, chia màu, tích xong, tiền chạy về từng người. Vòng lặp 12 giây. */
.auth-svg { width: min(420px, 100%); animation: floaty 7s ease-in-out infinite; overflow: visible; }
.a-lbl { fill: var(--earn-fg2); font: 600 12px var(--font); letter-spacing: .02em; }
.a-v { fill: var(--earn-fg); font: 700 26px var(--display); letter-spacing: -.01em; opacity: 0; }
.a-v.v0 { animation: aV0 12s linear infinite; } .a-v.v1 { animation: aV1 12s linear infinite; } .a-v.v2 { animation: aV2 12s linear infinite; }
@keyframes aV0 { 0%, 30% { opacity: 1; } 33%, 93% { opacity: 0; } 97%, 100% { opacity: 1; } }
@keyframes aV1 { 0%, 31% { opacity: 0; } 34%, 56% { opacity: 1; } 59%, 100% { opacity: 0; } }
@keyframes aV2 { 0%, 57% { opacity: 0; } 60%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
.at { fill: transparent; fill-opacity: 1; stroke: var(--earn-fg2); stroke-opacity: .32; stroke-width: 1.5; animation: atCycle 12s ease-in-out infinite; animation-delay: var(--d); }
.at.free { stroke-dasharray: 4 4; animation: none; }
@keyframes atCycle {
  0%, 12% { fill: transparent; stroke-opacity: .32; }
  20% { fill: var(--c); fill-opacity: .3; stroke-opacity: .7; }
  30%, 80% { fill: var(--c); fill-opacity: .88; stroke-opacity: 0; }
  92%, 100% { fill: transparent; fill-opacity: 1; stroke-opacity: .32; }
}
.ak { fill: none; stroke: var(--earn-bg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: akCycle 12s ease-in-out infinite; animation-delay: var(--d); }
@keyframes akCycle { 0%, 36% { stroke-dashoffset: 30; } 44%, 80% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: 30; } }
.a-lasso { fill: var(--earn-acc); fill-opacity: .1; stroke: var(--earn-acc); stroke-width: 1.4; stroke-dasharray: 5 4; transform-box: fill-box; transform-origin: 0 0; opacity: 0; animation: aLasso 12s ease-in-out infinite; }
@keyframes aLasso { 0%, 3% { opacity: 0; transform: scale(.02, .02); } 6% { opacity: 1; transform: scale(.02, .02); } 18% { opacity: 1; transform: scale(1, 1); } 24%, 100% { opacity: 0; transform: scale(1, 1); } }
.a-coin { opacity: 0; transform: translate(var(--x), 290px); animation: aCoin 12s ease-in infinite; animation-delay: var(--d); }
.a-coin circle { fill: var(--warn); } .a-coin text { fill: #5A3B00; font: 700 9px var(--font); }
@keyframes aCoin { 0%, 38% { opacity: 0; transform: translate(var(--x), 286px); } 42% { opacity: 1; } 56% { opacity: 1; transform: translate(var(--x), 322px); } 60%, 100% { opacity: 0; transform: translate(var(--x), 328px); } }
.a-av circle { fill: var(--c); fill-opacity: .28; } .a-av text { fill: var(--earn-fg); font: 700 11px var(--font); }
.a-av { transform-box: fill-box; transform-origin: center; animation: aAv 12s ease-in-out infinite; animation-delay: var(--d); }
@keyframes aAv { 0%, 40% { transform: scale(1); } 47% { transform: scale(1.18); } 54%, 100% { transform: scale(1); } }
.a-av circle { animation: aAvC 12s ease-in-out infinite; animation-delay: var(--d); }
@keyframes aAvC { 0%, 38% { fill-opacity: .28; } 48%, 85% { fill-opacity: .95; } 96%, 100% { fill-opacity: .28; } }
.a-av text { animation: aAvT 12s ease-in-out infinite; animation-delay: var(--d); }
@keyframes aAvT { 0%, 38% { fill: var(--earn-fg); } 48%, 85% { fill: var(--earn-bg); } 96%, 100% { fill: var(--earn-fg); } }

/* bầu trời theo giờ ở đầu trang Tổng quan */
.sky { width: 148px; height: auto; flex: none; display: block; border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 10px 24px -14px rgba(13, 27, 46, .5); }
.sk-star { fill: #fff; animation: twinkle 3.2s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.5); } }
.sk-star { transform-box: fill-box; transform-origin: center; }
.sk-cloud.c1 { animation: cloudDrift 28s linear infinite; animation-delay: -9s; } .sk-cloud.c2 { animation: cloudDrift 44s linear infinite; animation-delay: -30s; }
@keyframes cloudDrift { from { transform: translateX(-30px); } to { transform: translateX(215px); } }
.sk-sun { animation: sunSpin 60s linear infinite; }
@keyframes sunSpin { to { transform: rotate(360deg); } }
.sk-moon { animation: moonBob 6s ease-in-out infinite; }
@keyframes moonBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2.5px); } }

/* đồng hồ đếm ngược tới giờ bắt đầu */
.dial { position: relative; display: grid; justify-items: center; gap: 8px; flex: none; }
.dial svg { width: 100%; height: auto; display: block; overflow: visible; }
.dl-trk { fill: var(--surface); stroke: var(--track); stroke-width: 7; }
.dl-prog { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.dl-pulse { fill: none; stroke: var(--accent); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: dlPulse 2.4s ease-out infinite; }
@keyframes dlPulse { 0% { transform: scale(.94); opacity: .55; } 100% { transform: scale(1.14); opacity: 0; } }
.dl-t { stroke: var(--line-2); stroke-width: 1.4; stroke-linecap: round; } .dl-t.big { stroke: var(--ink-3); stroke-width: 2.2; }
.dl-hand { stroke-linecap: round; } .dl-hand.m { stroke: var(--ink); stroke-width: 3.6; } .dl-hand.s { stroke: var(--accent); stroke-width: 1.8; }
.dl-hub { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.dl-num { display: grid; justify-items: center; line-height: 1.15; }
.dl-num b { font: 700 24px var(--mono); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.dl-num small { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.banner.has-dial { padding-top: 10px; padding-bottom: 10px; gap: 14px; }
.banner.has-dial > .dial { flex: none; gap: 0; } .has-dial .dl-num { display: none; } .has-dial .dl-pulse { animation-duration: 3s; }
.wait .dial { margin-bottom: 4px; }

/* pháo giấy */
.burst { position: fixed; left: 50%; top: 40%; width: 0; height: 0; z-index: 90; pointer-events: none; }
.burst i { position: absolute; left: 0; top: 0; border-radius: 2px; background: var(--c); opacity: 0; animation: burstOut 2.5s cubic-bezier(.12, .65, .3, 1) var(--d) forwards; }
.burst i.rd { border-radius: 50%; }
@keyframes burstOut {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.4); }
  62% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 150px)) rotate(calc(var(--r) * 1.7)) scale(.9); }
}

/* minh hoạ chia task */
.deal { width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.dl-stack { animation: floaty 3.4s ease-in-out infinite; }
.dl-stack rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; } .dl-stack rect.top { fill: var(--accent-soft); stroke: var(--accent-line); }
.dl-stack path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: .75; }
.dl-path { fill: none; stroke: var(--ci); stroke-opacity: .4; stroke-width: 1.6; stroke-dasharray: 3 5; animation: dash 1.4s linear infinite; }
.dl-dot { fill: var(--ci); opacity: 0; }
.dl-av { fill: var(--cb); stroke: var(--ci); stroke-width: 1.5; } .dl-ini { fill: var(--ci); font: 700 9px var(--font); } .dl-more { fill: var(--ink-3); font: 600 11px var(--font); }

/* sóng nền thẻ thu nhập */
.earn { position: relative; isolation: isolate; }
.earn > *:not(.waves) { position: relative; z-index: 1; }
.waves { position: absolute !important; left: 0; right: 0; bottom: 0; width: 100%; height: 76px; z-index: 0; pointer-events: none; }
.waves path { fill: var(--acc); }
.waves .w1 { opacity: .1; animation: waveX 9s linear infinite; } .waves .w2 { opacity: .07; transform: translateX(-60px); animation: waveX2 14s linear infinite; }
@keyframes waveX { to { transform: translateX(-180px); } }
@keyframes waveX2 { from { transform: translateX(-60px); } to { transform: translateX(-240px); } }

/* khung chờ khi tải */
.skel { padding: 4px 18px; }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); } .sk-row:last-child { border-bottom: 0; }
.sk-row i { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--track) 30%, var(--surface-2) 50%, var(--track) 70%); background-size: 240% 100%; animation: shimmer 1.5s linear infinite; animation-delay: calc(var(--i, 0) * 90ms); }
.sk-av { width: 38px; height: 38px; border-radius: 50% !important; flex: none; } .sk-pill { width: 66px; height: 22px; border-radius: 99px !important; flex: none; }
.sk-row > span { flex: 1; display: grid; gap: 8px; min-width: 0; } .sk-row > span i { height: 12px; } .sk-row > span i.s2 { height: 9px; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* thanh điều hướng: chỉ báo trượt mượt */
.nav { position: relative; }
.nav-ind { position: absolute; left: 0; right: 0; top: 0; border-radius: 10px; background: var(--accent-soft); pointer-events: none; transition: transform .38s var(--ease), height .3s var(--ease), opacity .2s; }
.nav .nav-i { position: relative; z-index: 1; }
.nav.has-ind .nav-i.on { background: transparent; }

/* bảng task: ô nảy khi đổi, thẻ xem nhanh khi rê chuột */
.tile.pop { animation: tilePop .6s var(--ease); }
@keyframes tilePop { 0% { transform: scale(1); } 28% { transform: scale(1.26); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ci, var(--accent)) 35%, transparent); } 60% { transform: scale(.94); } 100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; } }
.tpop { position: fixed; z-index: 70; width: 288px; max-width: calc(100vw - 20px); padding: 11px 13px; display: grid; gap: 7px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 38px -14px rgba(13, 27, 46, .45); pointer-events: none; animation: tpopIn .16s var(--ease); font-size: 13px; user-select: none; }
@keyframes tpopIn { from { opacity: 0; margin-top: 4px; } }
.tpop header { display: flex; align-items: center; gap: 8px; min-width: 0; } .tpop header b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpop p { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tpop small { display: flex; align-items: center; gap: 5px; }

/* thanh công cụ: gợi ý + chọn nhanh trên một hàng */
.hint-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.hint-row .board-hint { margin: 0; flex: 1 1 320px; }


/* ảnh đại diện chồng nhau không bị cắt chữ */
.stack .av { box-shadow: 0 0 0 2.5px var(--surface); margin-left: -5px; font-size: 10px !important; }

@media (max-width: 880px) {
  .sky { width: 112px; border-radius: 14px; }
  .auth-svg { width: min(340px, 100%); }
}
@media (max-width: 560px) { .page-act .sky { display: none; } }
/* điện thoại: vòng tiến độ nằm cạnh các số, không để trống nửa thẻ */
@media (max-width: 560px) {
  .summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 18px; }
  .summary .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; min-width: 0; }
  .summary .stats dd { font-size: 20px; } .summary .stats > div:last-child { grid-column: 1 / -1; }
}

/* dải "Làm tiếp" của CTV: tách khỏi thẻ thu nhập, có vệt sáng lướt qua */
.resume { margin-top: 10px; border-radius: 16px; position: relative; overflow: hidden; isolation: isolate; }
.resume::after { content: ''; position: absolute; top: 0; bottom: 0; width: 46%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-18deg); animation: shine 5.5s ease-in-out 1.2s infinite; pointer-events: none; }
@keyframes shine { 0%, 62% { left: -60%; } 100% { left: 130%; } }
.resume .ico { animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

/* ---------- CTV: task theo 3 bước, chỉ task đang làm được mở rộng ---------- */
.trow { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 14px; margin-bottom: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); animation: tileIn .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); transition: border-color .15s, background .15s, transform .12s; scroll-margin-top: 112px; }
.trow:hover { border-color: var(--accent-line); background: var(--surface-2); } .trow:active { transform: scale(.99); }
.tr-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 14px; }
.tr-go { color: var(--ink-3); flex: none; }
.tcard.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow); animation: cardOpen .35s var(--ease); }
@keyframes cardOpen { from { transform: scale(.985); opacity: .6; } }
@keyframes dotBeat { 50% { transform: scale(1.55); opacity: .55; } }
.tcard.compact .tc-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.5; }
.quest { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.qs { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.qs:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 32px; bottom: -10px; width: 2px; border-radius: 2px; background: var(--line-2); }
.qs.ok:not(:last-child)::before { background: var(--good); }
.qn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; border: 2px solid var(--line-2); color: var(--ink-3); background: var(--surface); position: relative; z-index: 1; transition: background .25s, border-color .25s, color .25s, box-shadow .25s; }
.qs.cur .qn { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.qs.ok .qn { background: var(--good); border-color: var(--good); color: #fff; } .qs.ok .qn svg { animation: ckPop .3s var(--ease); }
.qb { display: grid; gap: 6px; min-width: 0; align-content: start; }
.qb .link-btn { text-align: left; font-size: 12.5px; padding: 2px 0; }
.q-row { display: flex; gap: 8px; min-width: 0; } .q-row > .btn.block { flex: 1 1 0; width: auto; min-width: 0; padding: 0 10px; }   /* mở bài và chỉ sao chép chữ nằm chung một hàng */
.qb .q-copy { flex: none; width: 48px; height: 48px; padding: 0; font-size: 14px; color: var(--accent-strong); border-color: var(--accent-line, var(--line-2)); background: var(--accent-soft, var(--surface)); }
.qb .q-copy:active { transform: scale(.98); }
.quest .btn { justify-content: center; }
.quest label.btn.attach:not(.primary) { background: var(--surface); color: var(--ink); border-color: var(--line-2); } .quest label.btn.attach:not(.primary):hover { background: var(--surface-2); }
.quest .proof-hint { text-align: left; margin: 0; }
.btn.good.ready { animation: readyPulse 1.8s ease-in-out infinite; }
@keyframes readyPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- menu tài khoản gọn ---------- */
.amenu { position: relative; }
.am-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px 8px 8px; border-radius: 14px; text-align: left; transition: background .15s; }
.am-side { margin-top: auto; } .am-side .am-btn { border: 1px solid var(--line); background: var(--surface-2); } .am-btn:hover { background: var(--track); }
.am-t { display: grid; min-width: 0; flex: 1; } .am-t b, .am-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .am-t small { color: var(--ink-3); font-size: 12px; }
.am-car { color: var(--ink-3); flex: none; transition: transform .2s; } .amenu.open .am-car { transform: rotate(180deg); }
.am-pop { position: absolute; z-index: 40; min-width: 240px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 40px -14px rgba(13, 27, 46, .45); padding: 6px; display: grid; gap: 2px; animation: popIn .16s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.am-side .am-pop { left: 0; right: 0; bottom: calc(100% + 8px); } .am-head .am-pop { left: 0; top: calc(100% + 8px); }
.am-head .am-btn { width: auto; padding: 0; gap: 2px; background: none; border: 0; border-radius: 99px; } .am-head .am-btn:hover { background: none; }
.am-id { display: grid; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); } .am-id small { color: var(--ink-3); font-size: 12px; }
.am-pop a, .am-pop button { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 10px; border-radius: 10px; font-weight: 600; color: var(--ink); text-align: left; }
.am-pop a:hover, .am-pop button:hover { background: var(--surface-2); text-decoration: none; } .am-pop .am-out { color: var(--bad-ink); }

/* ---------- chỉnh nhỏ cho admin ---------- */
.grid2:not(.even) { align-items: start; }
.jtools { align-items: center; justify-content: space-between; margin-top: 0; } .jtools .search { flex: 0 1 260px; }
details.tips { display: inline; } details.tips > summary { display: inline; color: var(--accent-strong); cursor: pointer; font-weight: 600; } details.tips[open] > span { display: block; margin-top: 4px; }

/* ---------- ô chọn (Select) dùng chung ---------- */
.sel { position: relative; display: inline-block; min-width: 0; max-width: 100%; vertical-align: middle; }
.fld .sel { display: block; }
.sel-tool { flex: 0 1 190px; min-width: 150px; }
.sel-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.sel-btn:hover:not(:disabled) { border-color: var(--ink-3); }
.sel-btn:focus-visible, .sel-btn.open { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-line); }
.sel-btn:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.sel-btn.sm { height: 32px; font-size: 13px; border-radius: 9px; padding-left: 10px; }
.sel-btn.ph .sel-v { color: var(--ink-3); }
.sel-btn.act { width: auto; font-weight: 600; }
.sel-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-car { flex: none; color: var(--ink-3); transition: transform .2s var(--ease); } .sel-btn.open .sel-car { transform: rotate(180deg); }
.sel-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.fld.need .sel-btn { border-color: var(--warn); }
.sel-back { position: fixed; inset: 0; z-index: 199; background: rgba(8, 14, 24, .45); animation: fade .2s both; }
.sel-pop { position: fixed; z-index: 200; display: flex; flex-direction: column; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 22px 48px -16px rgba(13, 27, 46, .5), 0 2px 6px rgba(13, 27, 46, .08); overflow: hidden; animation: selIn .16s var(--ease); }
.sel-pop.up { animation-name: selInUp; }
@keyframes selIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes selInUp { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.sel-s { display: flex; align-items: center; gap: 8px; flex: none; height: 46px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.sel-s input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; outline: none; font: inherit; color: var(--ink); }
.sel-l { display: grid; gap: 2px; align-content: start; padding: 6px; overflow-y: auto; outline: none; overscroll-behavior: contain; }
.sel-o { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 9px; text-align: left; color: var(--ink); }
.sel-o.act { background: var(--track); }
.sel-o.on { background: var(--accent-soft); color: var(--accent-strong); } .sel-o.on.act { background: color-mix(in srgb, var(--accent-soft) 65%, var(--track)); }
.sel-o.dis { opacity: .45; cursor: not-allowed; }
.sel-cb { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 5px; background: var(--surface); color: #fff; } .sel-cb.on { background: var(--accent); border-color: var(--accent); }
.sel-f { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); } .sel-f .grow { flex: 1; }
.sel-t { display: grid; flex: 1; min-width: 0; } .sel-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sel-o.on .sel-t b { font-weight: 700; }
.sel-t small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-o em { flex: none; font-style: normal; font-size: 11.5px; font-weight: 700; line-height: 20px; padding: 0 8px; border-radius: 99px; background: var(--track); color: var(--ink-2); } .sel-o.act em { background: var(--surface); }
.sel-ck { flex: none; color: var(--accent-strong); animation: ckPop .25s var(--ease); }
.sel-g { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sel-none { padding: 18px 10px; text-align: center; color: var(--ink-3); font-size: 13px; }
.sel-sh { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 10px 8px 4px 18px; font-size: 15px; }
.sel-pop.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 76vh; border-width: 1px 0 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheetUp .26s var(--ease); }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px); } }
.sel-pop.sheet .sel-o { min-height: 52px; font-size: 15.5px; }
.sel-pop.sheet .sel-s { height: 52px; } .sel-pop.sheet .sel-s input { font-size: 16px; }
.selbar .sel-btn { height: 34px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: inherit; }
.selbar .sel-btn.ph .sel-v, .selbar .sel-car { color: inherit; opacity: .78; }
.hint-row .sel-btn.act { height: 32px; }
@media (max-width: 880px) { .sel-btn { height: 44px; } .sel-btn.sm { height: 40px; } .selbar .sel-btn { height: 40px; } .hint-row .sel-btn.act { height: 40px; } }

/* ---------- xoá CTV (xoá mềm), mục Đã xoá ---------- */
.chip.del { height: 18px; padding: 0 7px; font-size: 11px; background: transparent; color: var(--ink-3); border: 1px dashed var(--line-2); margin-left: 6px; vertical-align: middle; }
.del-list { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 10px; }
.del-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.del-list li svg { flex: none; margin-top: 2px; color: var(--ink-3); } .del-list li b { color: var(--ink); }
.del-list li.keep { background: var(--good-soft); color: var(--good-ink); } .del-list li.keep svg, .del-list li.keep b { color: var(--good-ink); }
.icon-btn.danger-h:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad-ink); }
.ctv-tbl .acts { white-space: nowrap; }

/* ---------- reply comment: nhập, xem trước, hiển thị cho admin và CTV ---------- */
.tt-ar { flex: none; color: var(--ink-3); }
.tt-q { flex: none; max-width: 40%; font-style: normal; font-size: 11.5px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 99px; padding: 1px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bad-t { color: var(--bad-ink); display: flex; gap: 6px; align-items: flex-start; } .bad-t svg { flex: none; margin-top: 2px; }
.tile .tr { position: absolute; right: 3px; bottom: 3px; width: 13px; height: 13px; border-radius: 4px; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ci, var(--ink-2)); }
.tpop .tp-r { display: flex; gap: 6px; align-items: flex-start; color: var(--accent-strong); font-size: 12.5px; background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; } .tpop .tp-r svg { flex: none; margin-top: 2px; }
.rp-chip { display: inline-flex; align-items: center; gap: 3px; margin-right: 4px; padding: 0 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.reply-box { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.reply-box header { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--accent-strong); }
.reply-box blockquote { margin: 6px 0 0; padding: 0 0 0 10px; border-left: 3px solid var(--accent-line); color: var(--ink-2); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-ed { margin: 4px 0 12px; } .fld-inline { display: flex; gap: 8px; } .fld-inline input { flex: 1; min-width: 0; }
.tr-rp { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); border-radius: 99px; padding: 1px 8px; }
.tr-rp.tr-to { max-width: 72%; } .tr-rp.tr-to span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* dòng thu gọn của task trả lời: thụt vào theo cấp, vạch trái màu nhấn; trả lời đang đợi bình luận chính thì khoá */
.trow.is-rep { width: calc(100% - var(--lv, 1) * 14px); margin-left: calc(var(--lv, 1) * 14px); border-left: 3px solid var(--accent-line); flex-wrap: wrap; row-gap: 5px; }
.trow.is-rep .stt { flex: none; white-space: nowrap; }
.trow.is-rep .tr-go { margin-left: auto; }
.trow.is-rep .tr-t { order: 2; flex: 1 1 100%; }   /* dòng 1: STT, trả lời ai; dòng 2: nội dung */
.trow.is-rep .tr-why { margin-left: auto; }
.trow.locked { background: var(--surface-2); border-style: dashed; border-left-style: solid; cursor: default; }
.trow.locked:hover { background: var(--surface-2); border-color: var(--line); border-left-color: var(--accent-line); } .trow.locked:active { transform: none; }
.trow.locked .tr-t { color: var(--ink-3); }
.trow.locked.is-rep { padding-top: 8px; padding-bottom: 8px; }
.tr-k { flex: none; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 8px; white-space: nowrap; }
.tr-k.has { display: inline-flex; align-items: center; padding: 0 0 0 8px; overflow: hidden; }
.tr-k.has i { font-style: normal; display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 0 8px 0 6px; align-self: stretch; background: var(--accent-soft); color: var(--accent-strong); }
.trow.is-rep .tr-sw { margin-left: auto; } .trow.is-rep .tr-rp.tr-to { flex: 0 1 auto; min-width: 0; }
.tr-why { flex: none; display: inline-flex; align-items: center; gap: 4px; max-width: 60%; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-why.wait { border-color: transparent; background: var(--warn-soft); color: var(--warn-ink); }
/* task cần tài khoản khác: vẫn nằm trong post, mờ hơn, có nút đổi tài khoản khi biết tài khoản làm được */
.trow.other { background: var(--surface-2); border-style: dashed; cursor: default; padding-top: 8px; padding-bottom: 8px; }
.trow.other:hover { background: var(--surface-2); border-color: var(--line); } .trow.other:active { transform: none; }
.trow.other .tr-t { color: var(--ink-3); }
.tr-sw { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 62%; min-height: 32px; padding: 3px 10px 3px 4px; border: 1px solid var(--accent-line, var(--line-2)); border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.tr-sw span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Task trả lời ở trang CTV: mô phỏng chỗ bình luận trên bài (bình luận đã có phía trên, bình luận cần trả lời, rồi bình luận mình sắp đăng) */
.th-sim { --bubble: color-mix(in srgb, var(--track) 70%, var(--surface)); --step: 40px; margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.th-h { display: flex; align-items: flex-start; gap: 7px; padding: 9px 12px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); color: var(--accent-strong); font-size: 13.5px; line-height: 1.4; }
.th-h svg { flex: none; margin-top: 1px; }
.th-list { list-style: none; margin: 0; padding: 0 12px 2px; }
.th-c { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 12px 0 0 calc(var(--x) * var(--step)); }
.th-c > .acv, .th-c > .th-av0 { flex: none; position: relative; z-index: 1; }
/* đường nối: từ ảnh bình luận phía trên chạy xuống rồi uốn sang ảnh của trả lời */
.th-c:not(:last-child)::after { content: ''; position: absolute; left: calc(var(--ck, 0px) + var(--x) * var(--step) + var(--av) / 2 - 1px); top: calc(12px + var(--av) + 3px); bottom: 0; border-left: 2px solid var(--line-2); }
.th-c:not(:first-child)::before { content: ''; position: absolute; left: calc(var(--ck, 0px) + var(--px) * var(--step) + var(--pav) / 2 - 1px); top: 0; width: calc((var(--x) - var(--px)) * var(--step) - var(--pav) / 2 - 3px); height: calc(12px + var(--av) / 2); border: 0 solid var(--line-2); border-left-width: 2px; border-bottom-width: 2px; border-bottom-left-radius: 12px; }
.th-c.th-same::before { left: calc(var(--ck, 0px) + var(--x) * var(--step) + var(--av) / 2 - 1px); width: 0; height: 12px; border-bottom-width: 0; border-radius: 0; }   /* cùng cột với bình luận trên (cấp sâu): chỉ nối thẳng xuống */
.th-c.th-me::before { border-color: var(--accent); border-style: dashed; }
.th-av0 { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--track); color: var(--ink-3); }
.th-av0.hollow { background: var(--surface); border: 1.5px dashed var(--line-2); }
.th-m { flex: 0 1 auto; min-width: 0; }
.th-bub { display: inline-block; max-width: 100%; padding: 7px 12px 8px; border-radius: 16px; background: var(--bubble); color: var(--ink); font-size: 14px; line-height: 1.45; vertical-align: top; }
.th-n { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; font-size: 13px; font-weight: 700; line-height: 1.35; }
.th-n > span:first-child { overflow-wrap: anywhere; }
.th-tag { font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--surface); border-radius: 99px; padding: 0 7px; line-height: 18px; white-space: nowrap; }
.th-tag.me { background: var(--accent); color: #fff; }
.th-tx { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.th-tx.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.th-more { display: block; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; } .th-more:hover { text-decoration: underline; }
.th-img { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.th-pic { display: block; width: 72px; height: 54px; margin-top: 6px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--track); cursor: zoom-in; }
.th-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th-act { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 4px 0 0 12px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.th-stt { font-weight: 500; } .th-stt.me { color: var(--accent-strong); font-weight: 600; }
.th-target .th-bub { box-shadow: 0 0 0 2px var(--accent); }
.th-me .th-bub { background: var(--accent-soft); outline: 1.5px dashed var(--accent); outline-offset: -1.5px; }
.th-pend .th-bub { background: transparent; outline: 1.5px dashed var(--line-2); outline-offset: -1.5px; color: var(--ink-2); }
.th-foot { padding: 4px 12px 12px; }
.th-tag.ok { display: inline-flex; align-items: center; gap: 3px; color: var(--good-ink); background: var(--good-soft); }
.th-cp { flex: none; margin-left: auto; display: inline-flex; gap: 3px; padding-top: 1px; }
.tcard > .th-sim .th-cp { flex-direction: column; gap: 3px; padding-top: 0; }   /* trong thẻ đang làm: hai nút xếp dọc để bong bóng chữ rộng hơn */
.tcard > .th-sim .th-cp button { width: 32px; height: 30px; }
.th-cp button { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.th-cp button:active { transform: scale(.94); }
.th-cp button.go { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-line); }
.th-me .th-cp button.go { color: #fff; background: var(--accent); border-color: var(--accent); }
.th-chg { padding: 3px 10px; border: 0; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; min-height: 28px; }
.tcard > .th-sim { --step: 26px; margin-bottom: 12px; border: 0; border-radius: 0; background: none; overflow: visible; }   /* trong thẻ đang làm: bỏ khung lồng khung, thụt ít lại để bong bóng chữ rộng hết cỡ trên điện thoại */
.tcard > .th-sim .th-list { padding: 0; }
/* nút tick trước từng bình luận của CTV: xếp thẳng một cột bên trái, ảnh đại diện mới thụt theo cấp trả lời */
.tcard > .th-sim { --ck: 36px; }
.tcard > .th-sim .th-c { padding-left: 0; }
.th-ck-slot { flex: none; width: 30px; height: var(--av); margin-right: calc(var(--x) * var(--step)); display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.th-ck { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); color: transparent; }
.th-ck.go { border-color: var(--good); border-width: 2.5px; background: var(--good-soft); cursor: pointer;   /* chưa bấm thì không vẽ dấu tick, kẻo tưởng đã làm rồi */ animation: ckBeat 1.8s ease-in-out infinite; }
.th-ck.go:active { transform: scale(.9); }
.th-ck { position: relative; } .th-ck.go::after { content: ''; position: absolute; inset: -9px; }   /* vùng chạm rộng hơn hình vẽ cho dễ bấm bằng ngón tay */
.th-ck.go.hot { border-width: 3px; animation-duration: 1s; }
.th-hint { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-3); font-weight: 600; }
.th-hint.hot { color: var(--good-ink); font-weight: 700; }
.th-ck.ok { border-color: var(--good); background: var(--good); color: #fff; }
@keyframes ckBeat { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--good) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .th-ck.go { animation: none; } }
.tcard > .pic-card { margin: 0 0 4px; }
.tcard > .th-sim .th-c { gap: 6px; }
.tcard > .th-sim .th-c:first-child { padding-top: 2px; }
.tcard > .th-sim .th-m { flex: 1 1 0; }
.tcard > .th-sim .th-bub { display: block; padding: 7px 10px 8px; }
.tcard > .th-sim .th-act { margin-left: 10px; }
.tcard > .th-warn { margin: 0 0 4px; flex-wrap: wrap; align-items: center; } .tcard > .th-warn > span { flex: 1 1 200px; min-width: 0; } .tcard > .th-warn .btn { flex: none; }
.tcard > .th-warn.sw { margin-bottom: 10px; background: var(--accent-soft); color: var(--ink-2); } .th-warn.sw b { color: var(--ink); }
.tcard > .accbar.pick { margin: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tr-k.rep { display: inline-flex; align-items: center; gap: 3px; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
.th-how, .th-rule, .th-warn { display: flex; align-items: flex-start; gap: 7px; margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.th-how svg, .th-rule svg, .th-warn svg { flex: none; margin-top: 2px; color: var(--accent-strong); }
.th-how b, .th-rule b { color: var(--ink); }
.th-warn { padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: var(--warn-ink); } .th-warn svg { color: var(--warn-ink); }
@media (max-width: 520px) { .th-sim { --step: 36px; } .th-list { padding: 0 10px 2px; } .th-foot { padding: 2px 10px 10px; } .th-bub { font-size: 14.5px; } }

.pw-custom { margin-top: 12px; }

/* ---------- bảng task kiểu Excel (UI.TaskSheet) ---------- */
.sheet { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; overflow: clip; box-shadow: var(--shadow); }
.sheet-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); position: relative; z-index: 6; }
.sheet-bar .sb-l, .sheet-bar .sb-r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.sheet-bar .sb-r { justify-content: flex-end; }
.sb-n { font-size: 13px; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 99px; padding: 4px 11px; }
.btn.icon { width: 32px; padding: 0; } .ico.flip { transform: scaleX(-1); }
.sheet-help { display: inline-block; position: relative; margin-left: 4px; font-size: 13px; }
.sheet-help > summary { display: inline-flex; padding: 4px 8px; border-radius: 8px; list-style: none; } .sheet-help > summary::-webkit-details-marker { display: none; }
.sheet-help > summary:hover { background: var(--surface-2); }
.sheet-help[open] > div { display: block; position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 86vw); z-index: 30; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .4); padding: 10px 14px; font-size: 12.5px; color: var(--ink-2); }
.sheet-help p { margin: 6px 0; line-height: 1.5; } .sheet-help b { color: var(--ink); }

.sheet-wrap { overflow: auto; max-height: min(66vh, 720px); min-height: 150px; background: var(--surface); scrollbar-gutter: stable; overscroll-behavior: contain; }
.sheet-box { outline: none; position: relative; }
.sheet-box:focus-within { box-shadow: inset 0 0 0 1px var(--accent-line); }
.sheet-tbl { table-layout: fixed; border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; user-select: none; -webkit-user-select: none; }
.sheet-tbl th { position: sticky; top: 0; z-index: 4; height: 34px; padding: 0 10px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line); white-space: nowrap; }
.sheet-tbl th.sel-col { cursor: pointer; } .sheet-tbl th.sel-col:hover { color: var(--accent-strong); background: var(--accent-soft); }
.sheet-tbl th.h-stt, .sheet-tbl td.c-stt { text-align: center; } .sheet-tbl th.h-stt { left: 0; }
.sheet-tbl th.h-stt { z-index: 5; padding: 0; }
.sheet-tbl td.cell { position: relative; vertical-align: top; padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); height: 40px; cursor: cell; }
.sheet-tbl td.cell.c-stt { position: sticky; left: 0; z-index: 3; background: var(--surface-2); color: var(--ink-3); font: 600 12.5px var(--mono); cursor: pointer; border-right: 1px solid var(--line-2); }
.stt-c { display: block; padding: 11px 0 0; }
.sheet-tbl td.c-stt:hover { color: var(--accent-strong); background: var(--accent-soft); }
.sheet-tbl td.c-stt.s-rin { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 3px 0 0 var(--accent); }
.sheet-tbl tr.done td.c-stt { color: var(--good-ink); }
.sheet-tbl tr.bad td.c-stt { box-shadow: inset 3px 0 0 var(--bad); }
.sheet-tbl tr.blank td.cell:not(.c-stt) { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.sheet-tbl tr.blank .stt-c { opacity: .55; }
.sheet-tbl tr.done .cv { color: var(--ink-3); }
.rerr { position: absolute; top: 4px; right: 4px; color: var(--bad); display: inline-flex; }

.sheet-tbl td.cell.s-in { background: var(--accent-soft); }
.sheet-tbl td.cell.s-in.s-act { background: var(--surface); }
.sheet-tbl td.cell.s-in::after { content: ''; position: absolute; inset: 0; pointer-events: none; border: 0 solid var(--accent); z-index: 2; }
.sheet-tbl td.cell.s-in.s-t::after { border-top-width: 2px; } .sheet-tbl td.cell.s-in.s-b::after { border-bottom-width: 2px; }
.sheet-tbl td.cell.s-in.s-l::after { border-left-width: 2px; } .sheet-tbl td.cell.s-in.s-r::after { border-right-width: 2px; }
.sheet-tbl td.cell.s-in.s-act::before { content: ''; position: absolute; inset: 2px; pointer-events: none; border: 1px solid var(--accent-line); z-index: 2; }
.sheet-tbl td.c-stt.s-in::after { display: none; }

.cv { padding: 10px 11px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; min-height: 40px; }
.c-content .cv { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cv.ph { color: var(--ink-3); } .cv.sm { font-size: 12.5px; }
.cv.link { display: flex; align-items: center; gap: 6px; color: var(--accent-strong); font-weight: 600; white-space: nowrap; overflow: hidden; }
.cv.link > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.cv.link.inh { color: var(--ink-3); font-weight: 500; } .cv .ar { color: var(--ink-3); }
.cv .rp { display: inline-flex; vertical-align: -1px; margin-right: 5px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 6px; padding: 1px 4px; }
.cv.wh { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; } .cv.wh span { overflow: hidden; text-overflow: ellipsis; }
.cv.ghost { visibility: hidden; }
.c-image { padding: 4px 6px !important; white-space: nowrap; }
.c-status { padding: 9px 8px !important; white-space: nowrap; }
.img-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-3); overflow: hidden; vertical-align: middle; cursor: pointer; }
.img-btn:hover { border-color: var(--accent); color: var(--accent-strong); } .img-btn.noimg { border-style: dashed; width: 40px; height: 32px; margin: 3px 3px; }
.img-btn img { width: 100%; height: 100%; object-fit: cover; display: block; } .img-btn img.bad { visibility: hidden; }
.img-tag { font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); margin-left: 6px; vertical-align: middle; }
.ctv-ed { padding: 3px 4px; } .ctv-ed .sel { display: block; } .ctv-ed .sel-btn { height: 34px; }

.sheet-box textarea.ed, .sheet-box textarea.kb { position: absolute; z-index: 8; margin: 0; resize: none; font: inherit; line-height: 1.45; color: var(--ink); outline: none; user-select: text; -webkit-user-select: text; }
.sheet-box textarea.kb { left: 0; top: 0; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; caret-color: transparent; overflow: hidden; }
.sheet-box textarea.ed { min-width: 120px; height: auto; padding: 10px 11px; overflow: auto; border: 2px solid var(--accent); border-radius: 0; background: var(--surface); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .35); }
.sheet-empty { padding: 36px 16px; text-align: center; color: var(--ink-3); }
.sheet.ro td.cell { cursor: default; }

.img-prev { display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 14px; }
.img-prev img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; }
.img-ed { display: grid; gap: 14px; }

@media (max-width: 880px) {
  .sheet-wrap { max-height: 62vh; }
  .sheet-tbl td.cell { height: 46px; }
  .sheet-bar { padding: 8px; }
  .btn.icon { width: 38px; }
}
/* ảnh đi kèm trong thẻ task của CTV: thẻ gọn có ảnh thu nhỏ, nút sao chép/tải và hướng dẫn dán */
.pic-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 6px 10px; align-items: center; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.pic-th { position: relative; width: 52px; height: 52px; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.pic-th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pic-zoom { position: absolute; right: 3px; bottom: 3px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(13, 27, 46, .62); color: #fff; }
.pic-act { display: flex; flex-wrap: wrap; gap: 6px; }   /* hai nút Sao chép ảnh và Tải ảnh có chữ, nằm ngay cạnh ảnh nhỏ */
.pic-tip { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.pic-how { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); }
.pic-how summary { width: max-content; cursor: pointer; color: var(--accent-strong); font-weight: 600; } .pic-how p { margin: 6px 0 0; line-height: 1.5; }
.tr-pic { flex: none; display: inline-flex; color: var(--ink-3); }
.page:has(.nj-sheet), .page:has(.fill) { max-width: 1680px; }   /* trang có bảng thì dùng hết bề ngang */
.nj-head { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; margin: -6px 0 12px; }
.nj-head .back { margin: 0 0 0 -4px; } .nj-head h1 { font: 700 22px/1.1 var(--display); letter-spacing: -.01em; } .nj-sub { font-size: 13px; }
.nj2 { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: calc(100vh - 28px); }
.nj-info { padding: 8px 12px; position: relative; z-index: 12; }
.nj-grid { display: grid; grid-template-columns: auto minmax(0, 3fr) 170px minmax(200px, 1.2fr); gap: 8px 10px; align-items: center; }
.nj-grid .fld { margin: 0; gap: 4px; } .nj-grid .fld > span { font-size: 12px; } .nj-grid input { height: 36px; } .nj-grid .sel-btn { height: 36px; }
.fld.need input { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.nj-time-w { position: relative; grid-template-columns: minmax(0, 1fr); }
.nj-tbtn { width: 100%; height: 36px; justify-content: flex-start; gap: 8px; padding: 0 10px; font-weight: 600; font-size: 13px; color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-line); }
.nj-tbtn .nj-tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.nj-tbtn.open { border-color: var(--accent); }
.nj-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: min(620px, 92vw); padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45); }
.nj-tw { padding: 0; } .nj-pop-n { display: flex; gap: 8px; margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2); } .nj-pop-n svg { flex: none; margin-top: 2px; color: var(--accent-strong); }
.nj-pop-f { display: flex; justify-content: flex-end; margin-top: 10px; }
.nj-sheet { flex: 1 1 auto; min-width: 0; min-height: 340px; display: flex; flex-direction: column; }
.nj-sheet .sheet { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.nj-sheet .sheet-wrap { flex: 1 1 0; min-height: 0; height: auto; max-height: none; }
.nj-go { display: flex; align-items: center; justify-content: flex-end; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.nj-err { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: min(460px, 100%); color: var(--warn-ink); font-size: 13px; }
.nj-err > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nj-err em { flex: none; font-style: normal; font-weight: 700; font-size: 12px; background: var(--warn-soft); border-radius: 99px; padding: 1px 8px; }
@media (max-width: 1100px) { .nj-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .nj-title, .nj-name, .nj-link { grid-column: 1 / -1; } }
@media (max-width: 560px) { .nj-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 880px) { .nj-pop { position: static; width: auto; margin-top: 8px; box-shadow: none; } .nj-sheet { min-height: 420px; } .nj2 { min-height: 0; } }
.nj-foot { position: sticky; bottom: 10px; z-index: 20; display: grid; gap: 6px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px -14px rgba(13, 27, 46, .35); }
.btn.lg:not(.block) { width: auto; }   /* .lg còn là ô chú thích 14px ở nơi khác */
.nj-bar > .btn { flex: none; }
.nj-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; }
.nj-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; color: var(--ink-2); }
.nj-stats b { font: 700 16px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 880px) { .nj-foot { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); padding: 10px 12px; } .nj-bar .btn { width: 100%; } .nj-stats .opt { display: none; } .nj-go { justify-content: stretch; } .nj-go .btn { flex: 1; } .nj-sheet .sheet-wrap { height: clamp(280px, 60vh, 700px); } }
@media (prefers-reduced-motion: reduce) { .sheet-tbl * { transition: none !important; } }

/* ---------- tài khoản mạng xã hội của CTV ---------- */
.acv { position: relative; display: inline-grid; flex: none; }
.acv > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--surface-2); }
.acv-p { position: absolute; right: -2px; bottom: -2px; width: 34%; height: 34%; min-width: 9px; min-height: 9px; border-radius: 50%; border: 2px solid var(--surface); }
.sa-add .fld { margin-bottom: 6px; } .sa-add .fld-inline input { min-width: 0; } .sa-add .small { margin: 4px 0 0; }
.sa-card { padding: 16px; margin-bottom: 14px; }
.sa-intro { margin: 0 0 12px; font-size: 13.5px; }
.sa-group { margin-bottom: 16px; }
.sa-tabs { display: grid; gap: 2px; padding: 3px; margin: 0 0 12px; background: var(--track); border-radius: 12px; }
.sa-tabs button { min-width: 0; height: 56px; padding: 0 3px; border-radius: 9px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: background .2s, color .2s; }
.sa-tabs button:hover { color: var(--ink); }
.sa-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 27, 46, .12); }
.sa-tabs .plogo { display: block; transition: opacity .2s, filter .2s; } .sa-tabs button.z:not(.on) .plogo { opacity: .5; filter: grayscale(.55); }
.sa-tabs em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-3); line-height: 14px; font-variant-numeric: tabular-nums; }
.sa-tabs button.on em { color: var(--accent-strong); } .sa-tabs button.z em { font-weight: 500; opacity: .75; }
.sa-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
@media (max-width: 420px) { .sa-tabs { padding: 2px; gap: 1px; } .sa-tabs button { padding: 0 2px; } }
.sa-lh { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; } .sa-lh .sub-h { margin: 0; }
.sa-q { height: 34px; width: 240px; max-width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; }
.sa-res { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--track); font-size: 13.5px; display: grid; gap: 4px; }
.sa-res p { margin: 0; } .sa-res > p:first-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .sa-res > p:first-child .icon-btn { margin-left: auto; width: 26px; height: 26px; }
.sa-bad { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); } .sa-bad code { font-size: 12px; overflow-wrap: anywhere; }
.sa-wait { color: var(--accent-strong) !important; } .sa-ro { margin-top: 12px; } .sa-ro section + section .sub-h { margin-top: 14px; } .sa-ro section:first-child .sub-h { margin-top: 0; }
.sa-list { list-style: none; padding: 0; margin: 0; }
.sa-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sa-row:last-child { border-bottom: 0; } .sa-row.gone { opacity: .55; } .sa-row.need { background: var(--warn-soft); }
.sa-t { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; justify-items: start; }
.sa-t b { overflow-wrap: anywhere; } .sa-t small { color: var(--ink-3); font-size: 12.5px; }
.sa-t .fld-inline { width: 100%; gap: 6px; } .sa-t .fld-inline input { height: 36px; } .sa-t .fld-inline .btn { flex: none; }
.sa-act { display: flex; gap: 2px; flex: none; }
.link-btn.warn { color: var(--warn-ink); text-align: left; }
.icon-btn.danger:hover { color: var(--bad-ink); background: var(--bad-soft); }
.sa-list.ro .sa-row { padding: 9px 0; }
@media (max-width: 560px) { .sa-row { flex-wrap: wrap; row-gap: 4px; } .sa-t { flex-basis: calc(100% - 60px); } .sa-act { width: 100%; justify-content: flex-end; margin-top: -2px; } .sa-list.ro .sa-act { width: auto; } }
.sa-nudge { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin: 12px 0; border-radius: 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.sa-nudge-t { flex: 1; display: grid; gap: 1px; } .sa-nudge-t small { color: var(--ink-2); font-size: 12.5px; }
.q-t { display: block; margin: 2px 0 8px; font-size: 14px; }
.apick { display: grid; gap: 8px; min-width: 0; }
.apick .sel { display: block; }
.sel-btn.apick-btn { height: 56px; padding: 0 12px 0 10px; border-width: 1.5px; border-radius: 14px; font-size: 14.5px; }
.sel-btn.apick-btn:hover:not(:disabled) { border-color: var(--ink-3); } .sel-btn.apick-btn.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sel-btn.apick-btn.ph { color: var(--ink-2); }
.sel-v2 { display: grid; gap: 1px; line-height: 1.2; text-align: left; min-width: 0; } .sel-v2 b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sel-v2 small { color: var(--ink-3); font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-o.pin { margin-bottom: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; color: var(--accent-strong); }
.sel-o.pin .sel-t b { font-weight: 700; } .sel-o.pin .sel-t small { color: var(--ink-3); }
.sel-o.pin > svg { flex: none; box-sizing: content-box; width: 20px; height: 20px; padding: 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.apick-empty { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--surface); text-align: left; transition: border-color .15s, background .15s; }
.apick-empty:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.apick-plus { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.apick-et { display: grid; gap: 2px; min-width: 0; } .apick-et b { color: var(--accent-strong); } .apick-et small { color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }
.sa-m-p { margin: 0 0 12px; font-size: 13.5px; }
.tc-acc { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; min-width: 0; }

/* ---------- trang job: dải tiến độ gọn, ưu tiên kiểu Bảng ---------- */
.ring-sm { font-size: 12.5px; font-weight: 700; } .ring-sm small { font-size: 9px; color: var(--ink-3); }
.ctv-strip.compact { margin: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.ctv-strip.compact .csc { flex: none; gap: 7px; padding: 3px 11px 3px 4px; border-width: 1px; } .ctv-strip.compact .csc b { font-size: 12.5px; } .ctv-strip.compact .csc small { font-size: 11px; }
.tool-i { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--ink-3); border-radius: 8px; cursor: help; } .tool-i:hover, .tool-i:focus-visible { color: var(--accent-strong); background: var(--accent-soft); outline: none; }
.jtools { margin-bottom: 10px; }
.fill { display: flex; flex-direction: column; min-height: 380px; }
.fill > .sheet { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.fill .sheet-wrap { flex: 1 1 0; min-height: 0; height: auto; max-height: none; }
@media (max-width: 880px) { .fill { min-height: 460px; } }

.banner.slim { padding: 8px 14px; gap: 10px; margin-bottom: 10px; } .banner.slim > div { display: flex; gap: 2px 12px; align-items: baseline; flex-wrap: wrap; } .banner.slim > div > span { font-size: 12.5px; }

/* bảng: thanh nội dung ô (như thanh công thức Excel), nút Trả lời, thụt chữ theo cấp trả lời, hàng chọn thêm bằng Ctrl */
.sheet-tbl td.cell.s-ex:not(.c-stt) { background: var(--accent-soft); }
.sheet-tbl td.cell.s-ex.s-act { background: var(--surface); }
/* bảng: ô Trả lời (nhãn trỏ về hàng gốc + nút trả lời tiếp), hàng vừa được nhảy tới, hộp soạn trả lời */
@keyframes rowFlash { from { background-color: color-mix(in srgb, var(--accent) 30%, var(--surface)); } to { background-color: var(--surface); } }
.sheet-tbl tr.flash td.cell:not(.c-stt) { animation: rowFlash 1.9s ease-out; }
.proof-hint.warn { display: flex; align-items: flex-start; gap: 6px; color: var(--warn-ink, var(--ink-2)); } .proof-hint.warn svg { flex: none; margin-top: 2px; }
.tc-acc.forced { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--accent-line); background: var(--accent-soft); }
.rc-quote { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; border-left: 3px solid var(--accent-line); background: var(--surface-2); }
.rc-quote b { font-size: 12.5px; color: var(--ink-2); }
.rc-quote p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rc-img { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.rc-th { display: flex; align-items: center; gap: 10px; width: 100%; } .rc-th img { max-width: 60%; max-height: 120px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.rc-link { flex: 1 1 200px; min-width: 0; height: 32px; }

/* trang job: header một khối gọn (tên, nền tảng, trạng thái, tiến độ, hành động) nhường chỗ cho bảng */
.jh2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id right" "meta meta"; align-items: center; gap: 6px 12px; margin: 0 0 8px; }
.jh-id { grid-area: id; } .jh-meta { grid-area: meta; } .jh-right { grid-area: right; display: flex; align-items: center; justify-content: flex-end; gap: 6px 12px; }
@media (min-width: 1700px) { .jh2 { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "id meta right"; gap: 8px 16px; } }
.jh-id { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 0 1 auto; }
.jh-back { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; margin-left: -6px; border-radius: 9px; color: var(--ink-2); }
.jh-back:hover { background: var(--surface-2); color: var(--ink); }
.jh-id h1 { margin: 0; min-width: 0; max-width: min(46ch, 100%); font: 700 21px/1.2 var(--display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jh-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.jh-price { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; } .jh-price small { margin-left: 1px; font-weight: 500; color: var(--ink-3); }
.jh-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.jh-chip.info { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-line); }
.jh-chip.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.jh-chip.as-btn { cursor: pointer; } .jh-chip.as-btn:hover, .jh-chip.as-btn.on { border-color: var(--accent); color: var(--accent-strong); }
.jh-posts { position: relative; }
.jh-pop.r { left: auto; right: 0; }
.jh-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(380px, 86vw); padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .4); }
.jh-pop ul { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; }
.jh-pop li { display: flex; align-items: center; gap: 4px; }
.jh-pop li a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--accent-strong); font-size: 13px; font-weight: 600; }
.jh-pop li a:hover { background: var(--accent-soft); }
.jh-pop .n { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); font: 600 11.5px var(--mono); }
.jh-pop .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jh-pop small { flex: none; padding-right: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.jh-prog { display: flex; align-items: center; gap: 8px; }
.jh-prog > div { display: grid; line-height: 1.15; }
.jh-prog b { font: 700 15px var(--display); font-variant-numeric: tabular-nums; } .jh-prog b .of { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.jh-prog small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.jh-free.sel-btn { color: var(--warn-ink); background: var(--warn-soft); border-color: transparent; }
.jh-act { display: flex; flex-wrap: wrap; gap: 6px; }
.jh-act .btn.sm { gap: 6px; }
.jh2 ~ .bar-tools { margin: 0 0 8px; }
.jh2 ~ .ctv-strip.compact { margin-bottom: 8px; }
.banner.slim.has-dial { padding-top: 6px; padding-bottom: 6px; }
/* trang có bảng lấp đầy màn hình: bớt khoảng đệm quanh trang để bảng cao hơn */
.page:has(.fill), .page:has(.nj-sheet) { padding-top: 14px; padding-bottom: 14px; }
@media (max-width: 880px) { .page:has(.fill), .page:has(.nj-sheet) { padding-top: 12px; padding-bottom: 104px; } }
@media (max-width: 640px) { .jh2 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "meta" "right"; } .jh-right { justify-content: flex-start; flex-wrap: wrap; } .jh-lb { display: none; } .jh-act .btn.sm { padding: 0 10px; } .jh-id h1 { font-size: 19px; } }

/* bảng trên máy tính: hàng và thanh công cụ gọn hơn để thấy nhiều dòng hơn (điện thoại giữ cỡ chạm lớn) */
@media (min-width: 881px) {
  .sheet-bar { padding: 5px 8px; gap: 4px 10px; }
  .sheet-bar .btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
  .sheet-tbl th { height: 30px; }
  .sheet-tbl td.cell { height: 36px; }
  .cv { padding: 8px 11px; min-height: 36px; }
  .stt-c { padding-top: 9px; }
  .c-image { padding: 2px 6px !important; }
  .img-btn { width: 44px; height: 32px; border-radius: 8px; }
  .img-btn.noimg { width: 36px; height: 28px; margin: 3px 4px; }
  .c-status { padding: 6px 8px !important; }
      .rerr { top: 3px; }
}
.bar-tools .search { flex: 1 1 150px; min-width: 120px; max-width: 340px; }
.jh2 ~ .bar-tools .pill { height: 30px; padding: 0 11px; }
@media (min-width: 881px) { .img-btn { vertical-align: top; } .img-btn.noimg { margin: 2px 4px; } }
@media (max-width: 1699px) { .jh-lb { display: none; } .jh-act .btn.sm, .jh-act .sel-btn.jh-exp { width: 32px; padding: 0; justify-content: center; } .jh-act .jh-exp .sel-v, .jh-act .jh-exp .sel-car { display: none; } }

/* trang Tạo job: tiêu đề và thông tin job trên một hàng, nhãn nằm trong ô nhập để dành chỗ cho bảng */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nj-title { display: flex; align-items: center; gap: 2px; }
.nj-title h1 { margin: 0; font: 700 20px/1.1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.nj-grid .fld { position: relative; }
.affix { position: relative; display: block; }
.affix input { width: 100%; padding-right: 54px; }
.affix i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--ink-3); pointer-events: none; }
@media (max-width: 1100px) { .nj-title h1 { font-size: 22px; } }

/* tay nắm điền ở góc dưới phải vùng chọn (kéo xuống để sao chép như Excel) */
.fh { position: absolute; right: -4px; bottom: -4px; width: 9px; height: 9px; background: var(--accent); border: 1.5px solid var(--surface); border-radius: 2px; cursor: crosshair; z-index: 4; }
.sheet-tbl td.cell.s-in.s-b.s-r { z-index: 3; }
@media (hover: none) { .fh { display: none; } }

/* thanh công cụ của bảng: badge số hàng, nút, ô chọn cùng một chiều cao */
.sheet-bar .sb-n { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; line-height: 1; white-space: nowrap; }
.sheet-bar .sb-n b { font-size: 14px; line-height: 1; }
@media (min-width: 881px) { .sheet-bar .sb-n { height: 28px; } .sheet-bar .sel-btn.sm { height: 28px; font-size: 12.5px; } }
@media (max-width: 880px) { .sheet-bar .sb-n, .sheet-bar .sel-btn.sm { height: 38px; } }

/* giảm chuyển động: màn đăng nhập đứng yên ở khung đẹp nhất, các hiệu ứng trang trí tắt hẳn */
@media (prefers-reduced-motion: reduce) {
  .at:not(.free) { fill: var(--c); fill-opacity: .88; stroke-opacity: 0; }
  .ak { stroke-dashoffset: 0; } .a-lasso, .a-coin { display: none; }
  .a-av circle { fill-opacity: .95; } .a-av text { fill: var(--earn-bg); }
  .a-v.v0, .a-v.v1 { opacity: 0; } .a-v.v2 { opacity: 1; }
  .dl-pulse, .burst, .dl-dot { display: none; }
  .waves .w1, .waves .w2 { transform: none; }
}

/* ---------- điện thoại: chữ và nút đủ lớn, ô nhập không bị iOS phóng to ---------- */
@media (max-width: 880px) {
  body { font-size: 15px; }
  input:not([type="checkbox"]), select, textarea { font-size: 16px; height: 44px; }
  textarea { height: auto; }
  input[type="checkbox"] { width: 20px; height: 20px; }
  .btn { height: 44px; }
  .btn.sm { height: 38px; }
  .btn.lg { height: 48px; }
  .seg button { height: 38px; }
  .pill { height: 36px; }
  .month { height: 38px; }
  .icon-btn { width: 40px; height: 40px; }
  .nav-i { height: 46px; }
  .search svg { top: 14px; }
  .steps li { padding: 12px 8px; }
}

/* ===== Sheet, ghi chú, Người soạn, hộp Chia…, CTV chọn tài khoản trước ===== */
/* ghi chú: ô soạn và phần hiển thị */
.note-body { font-size: 14.5px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.note-body > :first-child { margin-top: 0; } .note-body > :last-child { margin-bottom: 0; }
.note-body p { margin: 0 0 .65em; } .note-body h2 { margin: 1em 0 .4em; font-size: 17px; line-height: 1.3; } .note-body h3 { margin: .9em 0 .35em; font-size: 15.5px; }
.note-body ul, .note-body ol { margin: 0 0 .7em; padding-left: 1.4em; } .note-body li { margin: .15em 0; }
.note-body blockquote { margin: .7em 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--accent-line); color: var(--ink-2); }
.note-body a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.note-body img { display: block; max-width: 100%; height: auto; margin: .6em 0; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.note-body code, .note-body pre { font-family: var(--mono); font-size: .92em; background: var(--surface-2); border-radius: 6px; padding: 1px 5px; } .note-body pre { padding: 8px 10px; white-space: pre-wrap; }
.note-empty { margin: 0; padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--ink-3); text-align: center; font-size: 13.5px; }
.rte { border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); overflow: clip; }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 3; }
.rte-b { display: inline-grid; place-items: center; width: 34px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.rte-b:hover { background: var(--surface); color: var(--ink); } .rte-b.on { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }
.rte-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line-2); }
.rte-busy { margin-left: auto; padding: 0 8px; font-size: 12.5px; color: var(--accent-strong); }
.rte-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--accent-soft); } .rte-link input { flex: 1 1 220px; min-width: 0; height: 34px; }
.rte-area { min-height: 220px; max-height: 56vh; overflow: auto; padding: 14px 16px; outline: none; }
.rte-area.is-empty::before { content: attr(data-ph); color: var(--ink-3); pointer-events: none; position: absolute; }
.note-tabs { display: flex; gap: 6px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; } .note-tabs::-webkit-scrollbar { display: none; }
.note-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-weight: 600; cursor: pointer; }
.note-tab small { font-weight: 500; color: var(--ink-3); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-tab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); } .note-tab.on small { color: var(--accent-strong); opacity: .8; }
.note-dot, .st-note { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; } .note-dot { position: absolute; top: 7px; right: 7px; }
.note-warn { display: inline-flex; align-items: center; gap: 6px; color: var(--warn-ink); font-weight: 600; font-size: 13.5px; }

/* dải thẻ sheet dưới bảng */

/* hộp quản lý sheet */
.sm-intro { margin: 2px 0 12px; font-size: 13.5px; line-height: 1.55; }
.sm-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.sm-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); } .sm-row.busy { opacity: .65; }
.sm-main { display: grid; gap: 4px; min-width: 0; } .sm-name input { width: 100%; height: 34px; font-weight: 600; } .sm-cnt { font-size: 12.5px; color: var(--ink-3); } .sm-cnt b { color: var(--ink-2); }
.sm-ed { display: grid; gap: 3px; min-width: 0; } .sm-lb { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.sm-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; } .sm-act .btn { position: relative; }
.sm-add { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); } .sm-add .fld { margin: 0; }
@media (max-width: 720px) { .sm-row, .sm-add { grid-template-columns: 1fr; } .sm-act { justify-content: flex-start; } }

/* hộp Chia… */
.dist-intro { margin: 2px 0 12px; font-size: 13.5px; line-height: 1.55; }
.dist-sum { font-size: 13.5px; color: var(--ink-2); } .dist-sum.warn { color: var(--warn-ink); }
.dist-ctvs { margin-bottom: 12px; } .dist-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dist-h h4, .dist-prev h4 { margin: 0; font-size: 14.5px; } .dist-h h4 small, .dist-prev h4 small { margin-left: 4px; font-weight: 500; color: var(--ink-3); }
.dist-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; } .dist-quick .link-btn.on { font-weight: 700; text-decoration: underline; }
.dist-empty { display: grid; justify-items: center; gap: 4px; padding: 22px 14px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; color: var(--ink-3); font-size: 13.5px; } .dist-empty b { color: var(--ink-2); }
.dist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dist-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.dist-row .dr-t { display: grid; gap: 1px; min-width: 0; } .dist-row .dr-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dist-row .dr-t small { color: var(--ink-3); font-size: 12px; } .dist-row .dr-t small.bad { color: var(--bad); }
.dist-row .dr-q { display: inline-flex; align-items: center; gap: 4px; } .dist-row .dr-q input { width: 64px; height: 32px; text-align: center; font-weight: 700; font-size: 15px; -moz-appearance: textfield; } .dist-row .dr-q input::-webkit-outer-spin-button, .dist-row .dr-q input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dist-row .dr-q .btn { width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; }
.dist-row .dr-got { min-width: 86px; font-size: 12px; color: var(--good-ink); text-align: right; } .dist-row .dr-got.warn { color: var(--warn-ink); font-weight: 600; }
.dist-bal { display: grid; gap: 4px; margin-top: 8px; font-size: 13px; color: var(--ink-2); } .dist-bal.warn { color: var(--warn-ink); }
.dist-opt { margin-bottom: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.dist-tg { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; text-align: left; } .dist-tg small { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.dist-optb { display: grid; gap: 10px; padding: 0 12px 12px; } .dist-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--ink-2); }
.dist-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; } .dist-posts li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; } .dp-l { flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.dp-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11.5px; font-weight: 700; flex: none; }
.dist-chk { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; } .dist-chk input { margin-top: 3px; accent-color: var(--accent); } .dist-chk span { display: grid; gap: 2px; font-size: 13.5px; } .dist-chk small { color: var(--ink-3); font-size: 12.5px; }
.dist-prev { display: grid; gap: 10px; } .dist-scroll { overflow: auto; border: 1px solid var(--line-2); border-radius: 12px; max-height: 300px; }
.dist-tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; } .dist-tbl th, .dist-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.dist-tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 12px; color: var(--ink-3); } .dist-tbl thead th small { display: block; max-width: 90px; margin: 2px auto 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.dist-tbl th[scope="row"], .dist-tbl thead th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); } .dist-tbl thead th:first-child { background: var(--surface-2); z-index: 3; }
.dist-tbl th[scope="row"] { display: flex; align-items: center; gap: 8px; font-weight: 600; } .dist-tbl th[scope="row"] em { font-style: normal; font-size: 11px; font-weight: 500; padding: 0 6px; border-radius: 99px; background: var(--warn-soft); color: var(--warn-ink); }
.dist-tbl td.zero { color: var(--ink-3); } .dist-tbl .r { text-align: right; } .dist-tbl tfoot th, .dist-tbl tfoot td { background: var(--surface-2); border-bottom: 0; font-weight: 600; } .dist-tbl tfoot td.bad { color: var(--bad); }
.dist-issues { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); font-size: 13.5px; } .dist-issues svg { flex: none; margin-top: 2px; } .dist-issues ul { margin: 4px 0; padding-left: 18px; } .dist-issues p { margin: 4px 0 0; }
.dist-note { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
@media (max-width: 640px) { .dist-row { grid-template-columns: auto minmax(0, 1fr) auto; } .dist-row .dr-got { grid-column: 2 / 4; text-align: left; } }

/* Người soạn: danh sách sheet và trang sheet */
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sh-card { display: grid; gap: 8px; text-align: left; padding: 16px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; animation: cardIn .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); transition: transform .15s, border-color .15s; }
.sh-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.shc-h { display: flex; align-items: center; gap: 8px; color: var(--accent-strong); } .shc-h b { font-size: 16px; color: var(--ink); }
.shc-j { color: var(--ink-2); font-size: 13.5px; } .shc-s { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-3); } .shc-s b { color: var(--ink); }
.shc-n { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); line-height: 1.45; } .shc-n svg { flex: none; margin-top: 2px; }
.shc-go { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-strong); font-weight: 600; font-size: 13.5px; }
.sh-sec { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); } .sh-sec svg { color: var(--accent-strong); }
.sh-sec em { font-style: normal; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.sh-grid + .sh-sec { margin-top: 22px; }
.ns-new.mine { background: var(--accent-soft); color: var(--accent-strong); animation: none; } .shc-h .ns-new + .ns-new { margin-left: 0; }
.sp-h { margin-bottom: 10px; } .sp-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 12px; padding: 14px 16px; max-height: 38vh; overflow: auto; }
.sp-n h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }

/* CTV: chọn tài khoản trước, rồi làm các post hiện ra */
.accbar { margin: 10px 0 0; padding: 10px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); }
.accbar.empty { display: grid; gap: 10px; } .ab-h { display: grid; gap: 2px; margin-bottom: 8px; } .ab-h small { color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.ab-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-chip { position: relative; display: inline-flex; align-items: center; gap: 10px; flex: 1 1 168px; min-width: 168px; max-width: 260px; padding: 8px 12px 8px 8px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; scroll-snap-align: start; }
.ab-chip:hover { border-color: var(--accent-line); } .ab-chip.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); } .ab-chip.idle:not(.on) { opacity: .6; }
.ab-t { display: grid; gap: 1px; min-width: 0; } .ab-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; } .ab-t small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-ck { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; }
.ab-chip.add { border-style: dashed; background: transparent; } .ab-plus { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
.ab-none { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; margin: 8px 0 4px; border: 1px dashed var(--good); border-radius: 14px; background: var(--good-soft); color: var(--good-ink); font-size: 13.5px; line-height: 1.4; }
.ab-none > svg { flex: none; } .ab-none > div { flex: 1 1 180px; min-width: 0; display: grid; } .ab-none .btn { flex: 1 1 100%; justify-content: center; }
.accbar.one { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 10px 0 0; } .accbar.one .ab-t { flex: 1; min-width: 0; display: grid; line-height: 1.25; } .accbar.one .ab-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .accbar.one .ab-t small { color: var(--ink-3); font-size: 12px; } .accbar.one .ab-more { display: inline-flex; flex: none; }
.ab-q { width: 100%; height: 38px; margin-bottom: 8px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }   /* 16px: iPhone không tự phóng to khi chạm vào ô */
/* tấm chọn tài khoản trượt lên từ đáy; ctv.js đặt top/height của lớp nền và --vh theo phần màn hình còn thấy (visualViewport) để bàn phím ảo không che */
.bs-bg { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(8, 14, 24, .45); animation: fade .2s both; }
.accbar.bsheet { width: min(560px, 100%); max-height: min(78vh, calc(var(--vh, 100vh) - 12px)); display: flex; flex-direction: column; margin: 0; padding: 8px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .45); animation: bsUp .28s var(--ease) both; }
@keyframes bsUp { from { transform: translateY(100%); } }
.bs-grip { flex: none; width: 40px; height: 4px; margin: 2px auto 8px; border-radius: 4px; background: var(--line-2); }
.bsheet .ab-h { flex: none; } .bsheet .ab-h b { font-size: 17px; }
.bsheet .ab-q { flex: none; height: 44px; }
.bsheet .ab-list { flex-direction: column; flex-wrap: nowrap; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.bsheet .ab-chip { flex: none; width: 100%; min-width: 0; max-width: none; }
body:has(.bs-bg) .toasts { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); }   /* đang mở tấm chọn: thông báo nổi lên đầu màn hình cho khỏi đè lên danh sách */
.th-chg.need { background: var(--accent); color: #fff; }
.ab-list.many { max-height: 236px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.cg-n { font-weight: 500; font-size: 13px; margin-left: 4px; }
.drows { display: grid; } .drow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; } .drow .dr-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); } .drow .dr-m { color: var(--ink-3); font-size: 12px; }
.drow .dr-acts { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; } .drow.is-hidden .dr-t { color: var(--ink-3); }
.hid-dd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .drow { grid-template-columns: auto minmax(0, 1fr) auto; } .drow .tc-acc { grid-column: 2; } .drow .dr-acts { grid-column: 1 / -1; justify-content: flex-end; } }
.tr-rp.acc { background: var(--surface-2); color: var(--ink-2); border-color: var(--line-2); }
.jh-pop li .sel { flex: none; width: 168px; margin-right: 4px; } .jh-pop:has(.sel) { width: min(720px, 94vw); }
.jh-pop li .sel.jh-gap { width: 158px; }
@media (max-width: 640px) { .jh-pop li { flex-wrap: wrap; } .jh-pop li a { flex: 1 1 100%; } .jh-pop li .sel { flex: 1 1 140px; width: auto; } }
.jh-pop-f { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 4px; padding: 9px 10px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; background: transparent; color: var(--accent-strong); font-size: 13px; font-weight: 600; cursor: pointer; } .jh-pop-f:hover { background: var(--accent-soft); }
.ej-sec h4 { flex-wrap: wrap; row-gap: 2px; } .ej-sec h4 small { flex: 1 1 220px; line-height: 1.4; }
.ej-posts { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.ej-post { display: flex; align-items: center; gap: 8px; } .ej-post .n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); font: 600 11.5px var(--mono); }
.ej-pf { flex: 1; min-width: 0; display: grid; gap: 2px; } .ej-pf input { width: 100%; } .ej-pf small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 11.5px; }

/* nút trạng thái job (tạm dừng / chạy lại) ở trang job */
.jh-state { position: relative; gap: 7px; } .jh-state .jh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); animation: stateBeat 2s ease-out infinite; flex: none; }
.jh-state.is-paused { background: var(--warn-soft); border-color: var(--warn); color: var(--warn-ink); font-weight: 700; } .jh-state.is-paused:hover { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); }
@keyframes stateBeat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .jh-state .jh-dot { animation: none; } }
.jh-act .jh-state.is-paused { width: auto; padding: 0 12px; } .jh-act .jh-state.is-paused .jh-lb { display: inline; }
.jh-act .jh-state.is-live { width: auto; padding: 0 10px; gap: 6px; }

/* thẻ sheet: đổi tên và giao Người soạn ngay trên thẻ */

.ns-new { display: inline-flex; align-items: center; height: 19px; padding: 0 8px; border-radius: 99px; background: var(--warn); color: #3b2a00; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; animation: nsPulse 2.2s ease-in-out infinite; }
@keyframes nsPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .ns-new { animation: none; } }
.nav-n { margin-left: auto; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--warn); color: #3b2a00; font-size: 11.5px; font-style: normal; font-weight: 800; }
.tabbar > button { position: relative; } .tb-dot { position: absolute; top: 6px; left: calc(50% + 6px); width: 10px; height: 10px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); }
.shc-h .ns-new { flex: none; white-space: nowrap; } .shc-h b { min-width: 0; }
.sh-card.fresh { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent), var(--shadow); } .shc-h .ns-new { margin-left: auto; }

/* hộp ghi chú tự hiện khi vào trang */
.np { display: grid; gap: 14px; }
.np-n { padding: 12px 16px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.np-n h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--ink); }
.np-n h4 svg { flex: none; color: var(--accent-strong); } .np-n h4 small { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.np-n h4 .np-ed { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.np-chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none; } .np-chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.jh-note { position: relative; } .jh-note.fresh { border-color: var(--warn); }
.jh-ndot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); }
/* bảng dán từ Docs/Sheets trong ghi chú */
.note-body table { display: block; max-width: 100%; overflow-x: auto; margin: .2em 0 .9em; border-collapse: collapse; font-size: .96em; }
.note-body th, .note-body td { min-width: 96px; padding: 7px 11px; border: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.note-body th { background: var(--surface-2); font-weight: 700; }
.note-body td p, .note-body th p { margin: 0 0 .4em; } .note-body td > :last-child, .note-body th > :last-child { margin-bottom: 0; }
.nt-st { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line-2); } .nt-st.has { background: var(--good); }
.nm-who { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.45; } .nm-who svg { flex: none; margin-top: 2px; } .nm-who.warn { background: var(--warn-soft); color: var(--warn-ink); }
.sm-act .st-note { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; }

/* điện thoại: bảng không bị ép lùn bởi thanh công cụ; cả trang cuộn, bảng giữ chiều cao dễ thao tác */
@media (max-width: 880px) {
  .nj-sheet, .fill { min-height: 0; }
  .nj-sheet .sheet, .fill > .sheet { flex: 0 0 auto; }
  .nj-sheet .sheet-wrap, .fill .sheet-wrap { flex: 0 0 auto; height: clamp(300px, 58vh, 640px); max-height: none; }
}
.ab-ht { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ab-more { display: inline-flex; padding: 4px 10px; border: 0; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (max-width: 560px) {
  .ab-list { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
  .ab-chip { flex: 1 1 100%; max-width: none; min-width: 0; }
  .ab-chip { padding: 6px 10px 6px 6px; }
}

/* ---------- cộng tác trực tiếp: người khác đang xem / đứng / gõ / vừa sửa ---------- */
.pr-c0 { --pc: #d93f4a; } .pr-c1 { --pc: #db6a1f; } .pr-c2 { --pc: #a67c00; } .pr-c3 { --pc: #2a9d62; }
.pr-c4 { --pc: #1a97a0; } .pr-c5 { --pc: #8b5fd0; } .pr-c6 { --pc: #cf4590; } .pr-c7 { --pc: #9a6c48; }
.pr-mark { position: absolute; inset: 0; z-index: 4; pointer-events: none; border: 2px solid var(--pc); border-radius: 2px; background: color-mix(in srgb, var(--pc) 11%, transparent); }
.pr-mark b { position: absolute; top: -2px; right: -2px; max-width: calc(100% - 2px); height: 15px; padding: 0 6px; border-radius: 0 0 0 6px; background: var(--pc); color: #fff; font: 700 10px/15px var(--font); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-mark.k-edit { animation: pr-glow 1.2s ease-in-out infinite; }
.pr-mark.k-edit b::after { content: ' · đang gõ'; font-weight: 500; }
.pr-mark.k-flash { animation: pr-fade 5s ease-out forwards; background: color-mix(in srgb, var(--pc) 22%, transparent); }
.pr-mark.k-flash b::after { content: ' · vừa sửa'; font-weight: 500; }
.c-stt .pr-mark b, .c-status .pr-mark b { display: none; }
@keyframes pr-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc) 45%, transparent); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 0%, transparent); } }
@keyframes pr-fade { 0%, 62% { opacity: 1; } 100% { opacity: 0; } }

.lv-people { display: inline-flex; align-items: center; min-width: 0; }
.lv-av, .lv-more { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--bg); font: 700 10.5px var(--font); }
.lv-av { background: var(--pc); color: #fff; } .lv-av:first-child { margin-left: 0; }
.lv-more { background: var(--surface-2); color: var(--ink-2); border-color: var(--bg); }
.lv-av.typing { animation: pr-glow 1.2s ease-in-out infinite; }
.lv-dot { position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--pc); }
.lv-txt { margin-left: 8px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 1180px) { .lv-txt { display: none; } }
.sheet { position: relative; }
.lv-tick { position: absolute; left: 12px; bottom: 62px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 5px 13px 5px 5px; border-radius: 99px; background: var(--surface); color: var(--ink-2); border: 1px solid color-mix(in srgb, var(--pc) 55%, var(--line-2)); box-shadow: var(--shadow); font-size: 12.5px; pointer-events: none; animation: lv-in .26s ease-out; }
.lv-tick b { color: var(--ink); } .lv-tick > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-tav { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--pc); color: #fff; font: 700 9.5px var(--font); }
@keyframes lv-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sheet-conf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 12px; background: var(--warn-soft); color: var(--warn-ink); font-size: 13px; border-top: 1px solid var(--line); }
.sheet-conf svg { flex: none; } .sheet-conf .link-btn { margin-left: auto; font-weight: 600; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .pr-mark, .lv-av.typing, .lv-tick { animation: none !important; } .pr-mark.k-flash { opacity: .85; } }

/* ---------- chia soạn: nhiều Người soạn, mỗi người một vùng (link + số cmt) ---------- */
.modal.xl { width: min(1000px, 100%); }
.av-stack { display: inline-flex; align-items: center; flex: none; } .av-stack .av { box-shadow: 0 0 0 2px var(--surface-2); margin-left: -5px; } .av-stack .av:first-child { margin-left: 0; }
.av-more { margin-left: 4px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--ink-3); }

/* hộp quản lý sheet: mỗi sheet một thẻ */
.sm-list { gap: 10px; }
.sm-card { border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.sm-card:hover { border-color: var(--accent-line); box-shadow: 0 6px 18px -12px rgba(13, 27, 46, .35); }
.sm-card.busy { opacity: .6; pointer-events: none; }
.sm-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sm-name { flex: 1 1 200px; display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-3); }
.sm-name svg { flex: none; }
.sm-name input { flex: 1; width: auto; min-width: 0; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: 700 15px var(--font); }
.sm-name input:hover:not(:focus) { border-color: var(--line-2); }
.sm-name input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.sm-top .sm-cnt { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; } .sm-top .sm-cnt b { color: var(--ink); }
.sm-top .sm-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sm-bd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px; }
.sm-eds { list-style: none; margin: 0; padding: 0; flex: 1 1 340px; display: grid; gap: 7px; min-width: 0; }
.sm-eds li { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(0, 1.5fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.sm-eds li.more { display: block; color: var(--ink-3); font-size: 12.5px; }
.sm-e { display: inline-flex; align-items: center; gap: 7px; min-width: 0; } .sm-e b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.sm-q { white-space: nowrap; color: var(--ink-3); font-size: 12.5px; } .sm-q b { color: var(--ink); }
.sm-empty { flex: 1 1 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 12px; background: transparent; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.sm-empty:hover:not(:disabled) { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.sm-empty > span { display: grid; gap: 2px; } .sm-empty b { font-size: 14px; } .sm-empty small { color: var(--ink-3); font-size: 12.5px; font-weight: 400; line-height: 1.4; }
.sm-add { display: flex; align-items: flex-end; gap: 10px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; }
.sm-add .fld { flex: 1; min-width: 0; }
@media (max-width: 720px) { .sm-eds li { grid-template-columns: minmax(0, 1fr) auto; } .sm-eds .sm-l { grid-column: 1 / -1; order: 3; } .sm-add { flex-direction: column; align-items: stretch; } }

/* hộp Chia soạn: bảng người soạn × link × số cmt, kèm xem trước */
.sp-intro { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.sp-cards { display: grid; gap: 12px; }
.sp-card { position: relative; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.sp-card:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-card.bad { border-color: var(--bad); }
.sp-ch { display: grid; grid-template-columns: 20px 64px minmax(0, .8fr) minmax(0, 1.2fr) 236px 30px; align-items: center; gap: 10px; padding: 9px 10px 9px 6px; border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0; background: var(--surface-2); }   /* cùng lưới với .sp-cols nên ô link và ô giờ thẳng hàng giữa các thẻ */
.sp-pn { padding: 4px 0; border-radius: 7px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; letter-spacing: .03em; text-align: center; white-space: nowrap; }
.sp-pn.any { background: var(--line); color: var(--ink-2); }
.sp-cl, .sp-cs, .sp-cn { min-width: 0; }
.sp-nin { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; }
.sp-nin::placeholder { font-weight: 400; } .sp-nin:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-cap { display: none; margin-bottom: 3px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }   /* nhãn từng ô chỉ hiện trên điện thoại (máy tính đã có hàng tiêu đề cột) */
.sp-ch > .icon-btn { width: 30px; height: 30px; justify-self: end; }
.sp-whole .sp-ch { display: flex; flex-wrap: wrap; }
.sp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; } .sp-tools .btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); } .sp-count { margin-left: auto; }
.sp-paste { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--accent-line); border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.sp-paste-l { display: grid; gap: 2px; font-size: 13.5px; }
.sp-paste-l .muted { line-height: 1.45; }
.pg { position: relative; max-height: 320px; overflow: auto; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); user-select: none; -webkit-user-select: none; }
.pg-t { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.pg-t thead th { position: sticky; top: 0; z-index: 2; height: 30px; padding: 0 8px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); color: var(--ink-3); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.pg-t th.n { width: 38px; } .pg-t th:nth-child(2) { width: 38%; }
.pg-t td { position: relative; height: 32px; padding: 0 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; }
.pg-t td:last-child { border-right: 0; } .pg-t tbody tr:last-child td { border-bottom: 0; }
.pg-t td.n { text-align: center; background: var(--surface-2); color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; cursor: default; }
.pg-c.in { background: var(--accent-soft); } .pg-c.act { box-shadow: inset 0 0 0 2px var(--accent); }
.pg-c.tg { padding-right: 112px; } .pg-c .ps-t { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); max-width: 104px; }
.pg-ph { color: var(--ink-3); }
.pg-t tr.ps-nolink td.n, .pg-t tr.ps-bad td.n { background: var(--bad-soft); color: var(--bad-ink); } .pg-t tr.ps-bad .pg-c:last-child .pg-v { color: var(--bad-ink); }
.pg-kb { position: absolute; z-index: 3; margin: 0; padding: 6px 8px; border: 0; border-radius: 0; outline: none; resize: none; background: transparent; color: transparent; caret-color: transparent; font: inherit; font-size: 13px; line-height: 20px; overflow: hidden; opacity: 0; pointer-events: none; }
.pg-kb.on { opacity: 1; color: var(--ink); caret-color: var(--accent); background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent), 0 8px 18px -10px rgba(0, 0, 0, .35); pointer-events: auto; }
.ps-t { display: inline-block; max-width: 100%; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; font-style: normal; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); color: var(--ink-2); }
.ps-t.new { background: var(--good-soft); color: var(--good-ink); } .ps-t.rename { background: var(--accent-soft); color: var(--accent-strong); }
.ps-t.nolink, .ps-t.bad { background: var(--bad-soft); color: var(--bad-ink); } .ps-t.dup, .ps-t.had { background: var(--warn-soft); color: var(--warn-ink); }
.sp-paste-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; } .sp-paste-i { font-size: 12.5px; color: var(--ink-2); }
.sp-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); }
.sp-bulk-t { flex: 1 1 100%; font-size: 13px; font-weight: 700; }
.sp-bulk-g { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .sp-bulk-l { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.sp-bulk-ed { width: 200px; } .sp-bulk-ed > * { width: 100%; } .sp-bulk-tm { width: 236px; }
.sp-cols { display: grid; grid-template-columns: 20px 64px minmax(0, .8fr) minmax(0, 1.2fr) 236px 30px; gap: 10px; position: sticky; top: -8px; z-index: 4; margin: 0 0 10px; padding: 8px 11px 8px 7px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.sp-empty { margin: 0 0 12px; padding: 22px 16px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.modal.xl .modal-f { padding: 12px 20px; }   /* chân hộp thẳng lề với nội dung (nội dung lề 20px) */
.sp-card > .sp-note { padding: 8px 14px 0; }
.sp-subs { display: grid; gap: 6px; padding: 10px 10px 10px 34px; }
.sp-sub { position: relative; display: grid; grid-template-columns: minmax(150px, 1fr) 124px 36px; align-items: center; gap: 4px 10px; padding: 6px 8px 6px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.sp-sub::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 4px 4px 0; background: var(--pc); }
.sp-sub.bad { border-color: var(--bad); }
.sp-wn { display: flex; align-items: center; gap: 8px; min-width: 0; } .sp-wn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-addp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sp-q input.bad { border-color: var(--bad); }
.sp-c { min-width: 0; }
.sp-ed > * { width: 100%; }
.sp-lf { position: relative; display: flex; align-items: center; }
.sp-lin { width: 100%; height: 32px; padding: 0 32px 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 13px; text-overflow: ellipsis; }
.sp-lin:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-lin.bad { border-color: var(--bad); }
.sp-lbtn { position: absolute; right: 3px; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; }
.sp-lbtn:hover { background: var(--surface-2); color: var(--ink); }
.sp-lpop { position: fixed; z-index: 220; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45); }
.sp-lhd { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.sp-lit { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.sp-lit:hover, .sp-lit.on { background: var(--accent-soft); }
.sp-lit svg { flex: none; color: var(--ink-3); } .sp-lit.on svg { color: var(--accent-strong); }
.sp-lit > span { display: grid; gap: 1px; min-width: 0; } .sp-lit b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; } .sp-lit small { color: var(--ink-3); font-size: 12px; }
.sp-q { display: inline-flex; align-items: center; gap: 4px; }
.sp-q input { width: 52px; height: 32px; padding: 0 2px; text-align: center; font-weight: 700; font-size: 14px; -moz-appearance: textfield; }
.sp-q input::-webkit-outer-spin-button, .sp-q input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-q .btn { width: 28px; height: 32px; padding: 0; font-size: 17px; line-height: 1; }
.sp-q { gap: 3px; }
.sp-ac .icon-btn { width: 28px; height: 28px; }
.sp-ac { display: flex; justify-content: flex-end; gap: 2px; }
.sp-ac .icon-btn.danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad-ink); }
.sp-note { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: -1px; font-size: 12.5px; }
.sp-note > span { display: inline-flex; align-items: center; gap: 5px; }
.sp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 2px; }
.sp-sum { font-size: 13.5px; color: var(--ink-2); } .sp-sum.bad { color: var(--bad-ink); font-weight: 600; }
.sp-pv { margin-top: 18px; }
.sp-pv h4 { margin: 0 0 8px; font-size: 14.5px; } .sp-pv h4 small { margin-left: 6px; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.sp-pvs { max-height: 300px; overflow: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.sp-pt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.sp-pt thead th { position: sticky; top: 0; z-index: 2; padding: 7px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); color: var(--ink-3); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.sp-blk td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sp-blk:last-child td { border-bottom: 0; }
.sp-blk .sp-who { width: 210px; border-left: 4px solid var(--pc); background: color-mix(in srgb, var(--pc) 8%, var(--surface)); }
.sp-who { white-space: nowrap; } .sp-who > .av { margin-right: 8px; vertical-align: middle; } .sp-who > span { display: inline-grid; vertical-align: middle; line-height: 1.25; } .sp-who small { color: var(--ink-3); font-size: 12px; }
.sp-lkt { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .sp-lkt.any { color: var(--ink-3); font-weight: 500; font-style: italic; }
.sp-ph { color: var(--ink-3); } .sp-ph.more { font-style: italic; }
.sp-gh td { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); } .sp-gh .sp-pn { margin-right: 10px; } .sp-gh .sp-lkt { max-width: 60%; vertical-align: middle; } .sp-gh small { margin-left: 10px; color: var(--ink-3); font-size: 12px; }
@media (max-width: 860px) {
  .sp-cols { display: none; }
  .sp-ch { grid-template-columns: 20px auto minmax(0, 1fr) 40px; grid-template-areas: "g n . d" "c c c c" "l l l l" "t t t t"; row-gap: 8px; padding: 10px; }
  .sp-ch > .sp-grip { grid-area: g; } .sp-ch > .sp-pn { grid-area: n; padding: 4px 12px; } .sp-ch > .sp-cn { grid-area: c; } .sp-ch > .sp-cl { grid-area: l; } .sp-ch > .sp-cs { grid-area: t; } .sp-ch > .icon-btn { grid-area: d; width: 40px; height: 40px; }
  .sp-nin { height: 40px; font-size: 16px; } .pg-t td { height: 40px; font-size: 15px; } .pg-kb { font-size: 16px; line-height: 28px; } .pg-c.tg { padding-right: 8px; } .pg-c .ps-t { display: none; }
  .sp-cap { display: block; }
  .sp-bulk-g { flex: 1 1 100%; } .sp-bulk-ed, .sp-bulk-tm { width: 100%; flex: 1 1 100%; } .sp-bulk-l { flex: 1 1 100%; }
  .sp-count { flex: 1 1 100%; margin-left: 0; text-align: right; }
  .sp-sum { font-size: 12.5px; line-height: 1.35; }
  .modal.xl .modal-f { padding: 12px 16px; }
  .sp-subs { padding-left: 10px; }
  .sp-sub { grid-template-columns: minmax(0, 1fr) auto; }
  .sp-ed { grid-column: 1 / -1; }
  .sp-lin, .sp-q input, .sp-q .btn { height: 40px; }   /* điện thoại: ô bấm đủ lớn */
  .sp-q .btn { width: 40px; }
  .sp-ac .icon-btn { width: 40px; height: 40px; }
  .sp-blk .sp-who { width: auto; white-space: normal; }
}
}

/* hàng hiện sẵn của vùng soạn trong bảng */
.sheet-tbl tr.slot td.cell:not(.c-stt):not(.s-in) { background: color-mix(in srgb, var(--pc) 6%, var(--surface)); }
.sheet-tbl tr.slot td.cell.c-stt { box-shadow: inset 3px 0 0 var(--pc); }
.cv.link.slot-l { display: flex; align-items: center; gap: 8px; min-width: 0; } .cv.link.slot-l > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-tag { flex: none; margin-left: auto; padding: 0 7px; height: 18px; border-radius: 99px; background: color-mix(in srgb, var(--pc) 16%, var(--surface)); color: var(--pc); font: 700 10.5px/18px var(--font); font-style: normal; white-space: nowrap; }

/* ---------- nút quanh bảng: thanh công cụ và dải thẻ sheet ----------
 * Ba cấp rõ ràng thay cho một hàng ô bo viền giống nhau: nhóm nút liền (việc chính: thêm hàng, hoàn tác), nút trơn không viền (việc phụ), và chữ phụ.
 * Nhóm cách nhau bằng vạch mảnh; trạng thái (đã có người soạn, có ghi chú) thể hiện bằng màu chữ, không thêm huy hiệu. */
.tb-seg { display: inline-flex; align-items: stretch; flex: none; height: 30px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); overflow: hidden; }
.tb-s { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; border: 0; background: transparent; color: var(--ink); font: 600 13px var(--font); white-space: nowrap; cursor: pointer; transition: background .12s, color .12s; }
.tb-s + .tb-s { border-left: 1px solid var(--line); }
.tb-s:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-strong); }
.tb-s:active:not(:disabled) { background: var(--accent-line); }
.tb-s:disabled { opacity: .35; cursor: default; }
.tb-s.add svg { color: var(--accent); }
.tb-s.ic { width: 32px; padding: 0; color: var(--ink-2); }
.tb-g { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 13px var(--font); white-space: nowrap; cursor: pointer; transition: background .12s, color .12s; }
.tb-g:hover:not(:disabled), .sheet-help[open] > summary.tb-g { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.tb-g:disabled { opacity: .4; cursor: default; }
.tb-g svg { flex: none; }
.tb-g.danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad-ink); }
.tb-g.cta { color: var(--accent-strong); } .tb-g.cta:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-strong); }
.tb-g.has { color: var(--ink); } .tb-g.has > svg:not(.av) { color: var(--accent); }
.tb-g .n { margin-left: -1px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tb-sep { display: inline-block; flex: none; align-self: center; width: 1px; height: 18px; margin: 0 4px; background: var(--line-2); }
.tb-sel { white-space: nowrap; font-size: 13px; color: var(--accent-strong); } .tb-sel b { font-size: 14px; }
.tb-stt { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 3px 0 9px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--accent-strong); font: 600 13px var(--font); white-space: nowrap; }
.tb-stt:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); background: var(--surface); }
.tb-stt input { width: 54px; height: 24px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); font: 600 13px var(--font); text-align: center; }
.tb-stt input:focus { outline: none; border-color: var(--accent); }
.tb-stt .tb-g { height: 24px; padding: 0 8px; }
.tb-w { display: contents; }   /* vỏ bọc cố định cho các nhóm nút đổi theo vùng chọn: Preact vẽ lại mảng con lồng nhau không có khoá dễ lỗi insertBefore và làm treo trang */
.tb-rp { color: var(--accent-strong); } .tb-rp:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-strong); }
/* công tắc "Reply qua lại" của bình luận chính */
.tb-sw .sw-k { position: relative; flex: none; width: 28px; height: 16px; border-radius: 99px; background: var(--line-2); transition: background .15s; }
.tb-sw .sw-k::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s var(--ease); }
.tb-sw.on { color: var(--accent-strong); } .tb-sw.on .sw-k { background: var(--accent); } .tb-sw.on .sw-k::after { transform: translateX(12px); }
/* chạm chọn nhiều hàng: chỉ hiện trên màn hình cảm ứng hoặc hẹp (máy tính dùng Ctrl/Shift/kéo chuột) */
.tb-multi { display: none; } .tb-multi.on { background: var(--accent-soft); color: var(--accent-strong); }
@media (hover: none), (max-width: 880px) { .tb-multi { display: inline-flex; } }
.tb-hint { font-size: 12.5px; color: var(--ink-3); }
.sheet-bar { gap: 6px 12px; padding: 7px 10px; }
.sheet-bar .sb-l, .sheet-bar .sb-r { gap: 6px; }
.sheet-bar .sheet-help { margin-left: 0; }
.sheet-bar .sheet-help > summary { height: 30px; align-items: center; padding: 0 9px; border-radius: 8px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.sheet-bar .sheet-help > summary:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.sheet-bar .sel-btn.sm.act { height: 30px; border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 600; padding: 0 6px 0 9px; }
.sheet-bar .sel-btn.sm.act:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.sheet-bar .sel-btn.sm.act .sel-car { color: inherit; opacity: .6; }
.tb-g .tb-n { margin-left: 2px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-2); font-style: normal; font-size: 11.5px; font-weight: 700; line-height: 18px; }
@media (max-width: 880px) {
  .tb-seg, .tb-g, .sheet-bar .sel-btn.sm.act, .sheet-bar .sheet-help > summary { height: 36px; }
  .tb-s.ic { width: 38px; }
  .tb-hint { display: none; }
}

/* dải thẻ sheet kiểu Excel: thẻ đang mở liền với bảng bên trên */
.av-stack .av { box-shadow: 0 0 0 1.5px var(--tb, var(--surface)); margin-left: -4px; }
.sheet-tabs { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; min-width: 0; padding: 4px 8px 4px 8px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.st-list { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.st-list::-webkit-scrollbar { display: none; }
.st-tab { --tb: var(--surface-2); position: relative; display: inline-flex; align-items: center; flex: none; height: 32px; padding-right: 2px; border-radius: 8px; color: var(--ink-3); transition: background .12s, color .12s; }
.st-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.st-tab.on, .st-tab.on:hover { --tb: color-mix(in srgb, var(--accent) 13%, var(--surface-2)); background: var(--tb); color: var(--accent-strong); }   /* thẻ đang mở: nền xanh nhạt, chữ xanh đậm, không gạch chân */
.st-tab.on .st-n { color: inherit; opacity: .7; }
.st-tab.busy { opacity: .6; pointer-events: none; }
.st-main { display: inline-flex; align-items: center; gap: 7px; height: 100%; padding: 0 10px 0 12px; border: 0; background: transparent; color: inherit; font: 500 13.5px var(--font); white-space: nowrap; cursor: pointer; }
.st-tab.on .st-main { font-weight: 700; }
.st-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.st-n { font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.st-note { position: static; }
.st-rn { width: 150px; height: 28px; margin: 0 6px 0 8px; padding: 0 8px; font-weight: 600; font-size: 13.5px; border-radius: 7px; }
.st-pen { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); opacity: 0; cursor: pointer; transition: opacity .12s, background .12s; }
.st-tab:hover .st-pen, .st-pen:focus-visible { opacity: 1; } .st-pen:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
@media (hover: none) { .st-pen { opacity: .8; } }
.st-add { display: inline-grid; place-items: center; flex: none; align-self: center; width: 28px; height: 28px; margin-left: 4px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; transition: background .12s, color .12s; }
.st-add:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.st-act { display: flex; align-items: center; align-self: center; flex: none; gap: 2px; }
.st-act .tb-g { height: 28px; padding: 0 8px; }
.st-hint { min-width: 0; margin-right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 1000px) { .st-hint { display: none; } }   /* hẹp thì chỉ còn nút "Thêm ghi chú", nhường chỗ cho các thẻ sheet */
@media (max-width: 760px) {   /* điện thoại: thẻ sheet một hàng (cuộn ngang), các nút của sheet đang mở một hàng riêng bên dưới, đủ chữ */
  .sheet-tabs { flex-wrap: wrap; gap: 0; padding: 4px 6px 0; }
  .st-list { flex: 1 1 100%; padding-right: 6px; }
  .st-tab { height: 36px; }
  .st-act { flex: 1 1 100%; justify-content: flex-start; padding: 4px 0 6px; border-top: 1px solid var(--line); }
  .st-act .tb-g { height: 34px; padding: 0 10px; }
  .st-name { max-width: 120px; }
}
/* thanh công cụ: nút bên trái, "Thu gọn nhóm" / "Phím tắt" bên phải; từ 1100px nằm chung một hàng */
.sheet-bar { flex-wrap: wrap; align-items: flex-start; }
.sheet-bar .sb-l { flex: 1 1 0; min-width: 0; flex-wrap: wrap; align-items: center; }
.sheet-bar .sb-r { flex: none; margin-left: auto; align-self: flex-start; height: 30px; align-items: center; flex-wrap: nowrap; }
@media (min-width: 1100px) {
  .sheet-bar { flex-wrap: nowrap; }
  .sheet-bar .sb-l { flex: 0 1 auto; }
}
@media (max-width: 880px) {   /* điện thoại: hàng nút (trả lời, giao, xoá…) là một dải vuốt ngang chứ không xuống nhiều dòng, nút nhóm một hàng bên dưới, rồi tới thanh nội dung ô */
  .sheet-bar { flex-wrap: wrap; gap: 2px 8px; padding: 6px 8px; }
  .sheet-bar { flex-wrap: wrap; align-items: center; }
  .sheet-bar .sb-l { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; gap: 4px; }
  .sheet-bar .sb-l::-webkit-scrollbar { display: none; }
  .sheet-bar .sb-l > * { flex: none; }
  .sheet-bar .sb-r { flex: none; margin-left: 0; height: 36px; align-self: center; }   /* nút Thu gọn nhóm nằm cùng hàng với dải nút */
  .sheet-bar .sheet-help { display: none; }   /* phím tắt chỉ có nghĩa với bàn phím */
  .tb-stt { height: 36px; gap: 4px; } .tb-stt input { width: 62px; height: 30px; font-size: 16px; }   /* 16px để iPhone không tự phóng to khi bấm vào ô */
  .tb-stt .tb-g { height: 30px; padding: 0 10px; }
}
.tb-s:focus-visible, .tb-g:focus-visible, .st-main:focus-visible, .st-add:focus-visible, .st-pen:focus-visible, .sheet-bar .sheet-help > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tb-seg:has(:focus-visible) { border-color: var(--accent); }

/* nội dung trùng: vệt vàng bên trái ô và nhãn nhỏ cuối ô cho biết trùng với STT nào */
.sheet-tbl td.cell.has-dup { box-shadow: inset 3px 0 0 var(--warn); }
.dup-b { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 0 7px; height: 18px; border-radius: 99px; background: var(--warn-soft); color: var(--warn-ink); font: 700 10.5px/18px var(--font); font-style: normal; white-space: nowrap; vertical-align: 1px; }
.dup-b svg { flex: none; }
.dup-b.far { background: transparent; box-shadow: inset 0 0 0 1px var(--warn); }
.tb-g.warn { color: var(--warn-ink); } .tb-g.warn:hover:not(:disabled) { background: var(--warn-soft); color: var(--warn-ink); }

/* đổi vị trí các link (thẻ POST) trong hộp chia soạn: kéo tay nắm */
.sp-grip { display: inline-grid; place-items: center; flex: none; width: 20px; height: 28px; color: var(--ink-3); cursor: grab; border-radius: 6px; } .sp-grip:hover { background: var(--surface-2); color: var(--ink); } .sp-grip:active { cursor: grabbing; }
.sp-card.dragging { opacity: .45; }
.sp-card.drop-before::after, .sp-card.drop-after::after { content: ''; position: absolute; left: 8px; right: 8px; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; }
.sp-card.drop-before::after { top: -8px; } .sp-card.drop-after::after { bottom: -8px; }

/* nhóm hàng theo link post: dòng tiêu đề có dải STT, link, người soạn và tiến độ; bấm để thu lại hoặc mở ra */
.sheet-tbl tr.grp td.grp-c { padding: 0; height: 36px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface-2)); cursor: pointer; user-select: none; transition: background .12s; }
/* mọi thanh POST đều dính khi cuộn xuống: xếp chồng dưới hàng tiêu đề cột, mỗi thanh một nấc (--gi, tối đa 6 nấc để không chiếm hết khung nếu có nhiều post; từ nấc đó trở đi thanh sau đè lên thanh trước) */
.sheet-tbl tr.grp:not(.add) td.grp-c { position: sticky; top: calc(30px + min(var(--gi, 0), 6) * 38px); z-index: 4; box-shadow: 0 1px 0 var(--line-2), 0 -1px 0 var(--line-2); }
.sheet-tbl tr.grp:not(.add):has(.has-menu) td.grp-c { z-index: 6; }
.sheet-tbl tr.grp:hover td.grp-c { background: color-mix(in srgb, var(--accent-soft) 75%, var(--surface-2)); }
.sheet-tbl tr.grp.col td.grp-c { background: color-mix(in srgb, var(--ink) 5%, var(--surface-2)); }
.sheet-tbl tr.grp.col:hover td.grp-c { background: color-mix(in srgb, var(--ink) 9%, var(--surface-2)); }
.grp-in { position: sticky; left: 0; display: grid; grid-template-columns: 26px 86px clamp(230px, calc(100vw - 790px), 520px) 176px max-content; align-items: center; column-gap: 12px; width: max-content; max-width: 100%; height: 36px; padding: 0 14px 0 6px; font-size: 13px; color: var(--ink-2); }
.grp-t { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer; }
.grp-t:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.grp-t svg { transition: transform .15s var(--ease); } .sheet-tbl tr.grp.col .grp-t svg { transform: rotate(-90deg); }
.grp-rg { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grp-lk { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.grp-ow { display: flex; align-items: center; min-width: 0; gap: 7px; padding-left: 12px; border-left: 1px solid var(--line-2); } .grp-ow svg { flex: none; } .grp-ow.none { border-left-color: transparent; }
.grp-end { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }

.grp-on { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.grp-st { flex: none; white-space: nowrap; color: var(--ink-3); font-size: 12.5px; } .grp-st b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.grp-tag { flex: none; padding: 0 8px; height: 19px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font: 700 11px/19px var(--font); font-style: normal; white-space: nowrap; }
.grp-tag.warn { background: var(--warn-soft); color: var(--warn-ink); }
.grp-tag.grp-gap { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.grp-tag.info, .grp-tag.ok { display: inline-flex; align-items: center; gap: 4px; } .grp-tag.info { background: var(--info-soft, var(--accent-soft)); color: var(--info-ink, var(--accent-strong)); } .grp-tag.ok { background: color-mix(in srgb, var(--ink) 7%, var(--surface)); color: var(--ink-2); }
.grp-rg { font-weight: 800; letter-spacing: .02em; }
.grp-a { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; color: var(--accent-strong); text-decoration: none; font-weight: 600; } .grp-a:hover { text-decoration: underline; } .grp-a svg { flex: none; opacity: .75; }
.grp-lk > span, .grp-a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-lk { display: flex; align-items: center; gap: 4px; } .grp-lk > .grp-a, .grp-lk > span { min-width: 0; }
.grp-lk.named .grp-a { font-weight: 700; }
.grp-rnb { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); cursor: pointer; opacity: .5; transition: opacity .12s, background .12s; }
.grp-rnb:hover, .grp-rnb:focus-visible { opacity: 1; background: var(--surface); color: var(--accent-strong); } tr.grp:hover .grp-rnb, .m-grp:hover .grp-rnb { opacity: 1; }
.grp-lk.ren { overflow: visible; } .grp-rn { width: 100%; min-width: 0; height: 28px; padding: 0 9px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.grp-rn:disabled { opacity: .6; }
/* dòng phụ: tên người soạn đứng đầu các hàng của họ trong nhóm POST */
/* nhóm con của từng người soạn trong nhóm POST: bấm để thu lại / mở ra như nhóm POST */
.sheet-tbl tr.grp-sub td.grp-c { padding: 0; height: 30px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--pc) 9%, var(--surface)); box-shadow: inset 4px 0 0 var(--pc); cursor: pointer; user-select: none; transition: background .12s; }
.sheet-tbl tr.grp-sub:hover td.grp-c { background: color-mix(in srgb, var(--pc) 17%, var(--surface)); }
.sheet-tbl tr.grp-sub.lock td.grp-c { cursor: default; } .sheet-tbl tr.grp-sub.lock:hover td.grp-c { background: color-mix(in srgb, var(--pc) 9%, var(--surface)); }
.sheet-tbl tr.grp-sub.col .grp-t svg { transform: rotate(-90deg); }
.grp-t.sm { width: 22px; height: 22px; }
.gs-n { margin-left: 4px; color: var(--ink-3); font-size: 12px; } .gs-n b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gs-in { position: sticky; left: 0; display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; height: 30px; padding: 0 14px 0 12px; font-size: 12.5px; color: var(--ink-2); } .gs-in b { color: var(--ink); } .gs-q { color: var(--ink-3); } .gs-q b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* dòng chọn link cho hàng mới ở cuối bảng */
.sheet-tbl tr.grp.add td.grp-c { height: 40px; cursor: default; background: color-mix(in srgb, var(--ink) 4%, var(--surface-2)); }
.grp-add { position: sticky; left: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; width: calc(100vw - 80px); max-width: 100%; padding: 6px 14px 6px 12px; font-size: 13px; color: var(--ink-2); } .grp-add b { color: var(--ink); }
.grp-add input { flex: 1 1 260px; min-width: 200px; max-width: 520px; height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; } .grp-add input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grp-add input.bad { border-color: var(--bad); }
.grp-add.hit { animation: gaHit 1.2s ease-out; } @keyframes gaHit { 0%, 40% { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } }
.grp-add-wrap { position: relative; display: inline-flex; align-items: center; }
.grp-splitb { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); color: var(--accent-strong); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.grp-splitb:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent-line); } .grp-splitb:disabled { color: var(--ink-3); cursor: default; opacity: .6; }
.grp-splitb em { font-style: normal; min-width: 16px; padding: 0 5px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; line-height: 16px; text-align: center; }
.grp-addb { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); color: var(--accent-strong); cursor: pointer; }
.grp-addb:hover, .grp-addb.open { background: var(--accent-soft); border-color: var(--accent-line); }
.grp-add-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,0.14); padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 185px; }
.gam-item { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: 500 13px var(--font); cursor: pointer; text-align: left; }
.gam-item:hover { background: var(--accent-soft); color: var(--accent-strong); }
.gam-custom { display: flex; align-items: center; gap: 6px; padding: 3px 8px; font-size: 13px; color: var(--ink-2); }
.gam-lbl { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.gam-num { width: 48px; height: 26px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); font: 600 13px var(--font); text-align: center; }
.gam-num:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gam-sub { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: 600 12px var(--font); cursor: pointer; white-space: nowrap; }
.gam-sub:hover { background: var(--accent-strong); }
.grp-in.has-menu { z-index: 25; }
@media (max-width: 1180px) { .grp-in { grid-template-columns: 26px 80px clamp(160px, calc(100vw - 740px), 400px) 150px max-content; } }   /* màn hẹp: các cột gọn lại để dòng tiêu đề vẫn nằm trọn trong bảng */
@media (max-width: 880px) {   /* điện thoại: tiêu đề nhóm xuống dòng cho vừa bề ngang màn hình, không phải cuộn ngang mới thấy người soạn và số hàng */
  .grp-in { display: flex; flex-wrap: wrap; width: calc(100vw - 76px); height: auto; min-height: 42px; padding: 6px 10px 6px 6px; gap: 2px 10px; }
  .sheet-tbl tr.grp td.grp-c { height: auto; }
  .sheet-tbl tr.grp:not(.add) td.grp-c { top: 30px; }   /* tiêu đề nhóm cao thấp tuỳ nội dung nên không xếp chồng được: chỉ thanh của post đang xem dính */
  .grp-lk { max-width: 100%; flex: 1 1 calc(100% - 140px); }   /* tên post chiếm hết dòng đầu; người soạn và số hàng xuống dòng sau */
  .grp-ow { padding-left: 0; border-left: 0; }
  .grp-rnb { opacity: 1; width: 30px; height: 30px; } .grp-rn { height: 34px; font-size: 16px; }
}
.sheet-tbl tr.grp.lock td.grp-c { cursor: default; } .sheet-tbl tr.grp.lock:hover td.grp-c { background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface-2)); } .grp-t:disabled { opacity: .35; cursor: default; }

/* ô chọn ngày giờ kiểu Việt Nam */
.dtf { position: relative; min-width: 0; }
.dtf-box { position: relative; display: flex; align-items: center; }
.dtf-in { width: 100%; padding-right: 66px; font-variant-numeric: tabular-nums; }
.dtf-in::placeholder { color: var(--ink-3); }
.dtf-in.bad, .fld input.bad { border-color: var(--bad); } .dtf-in.bad:focus, .fld input.bad:focus { outline-color: var(--bad-soft); border-color: var(--bad); }
.dtf-btns { position: absolute; right: 4px; display: inline-flex; align-items: center; }
.dtf-b { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; }
.dtf-b:hover, .dtf-b.on { background: var(--surface-2); color: var(--ink); } .dtf-b.on { color: var(--accent-strong); }
.dtf-err { margin: 4px 0 0; font-size: 12px; color: var(--bad-ink); }
.dtf-pop { position: fixed; z-index: 230; max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45); }
.dtf-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .dtf-hd b { font-size: 14px; }
.dtf-nav { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; } .dtf-nav:hover { background: var(--surface-2); color: var(--ink); }
.dtf-wk, .dtf-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dtf-wk span { padding: 4px 0; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.dtf-d { height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.dtf-d:hover:not(:disabled) { background: var(--surface-2); } .dtf-d.out { color: var(--ink-3); opacity: .6; }
.dtf-d.today { box-shadow: inset 0 0 0 1.5px var(--accent-line); } .dtf-d.sel, .dtf-d.sel:hover { background: var(--accent); color: #fff; font-weight: 700; opacity: 1; }
.dtf-d:disabled { opacity: .28; cursor: not-allowed; }
.dtf-tm { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); } .dtf-tm > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dtf-tm select { width: 68px; height: 34px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.dtf-q { margin-top: 10px; }
.dtf-f { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
/* hộp Sửa job */
.ej .fld { margin-bottom: 14px; } .ej-err { font-size: 12px; font-weight: 500; color: var(--bad-ink); }
.ej-sec { margin: 4px 0 14px; } .ej-sec .fld { margin-bottom: 6px; }
.ej-sec h4 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); } .ej-sec h4 small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.ej-sum { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }
.ej-note { align-items: flex-start; margin-bottom: 0; } .ej-note ul { margin: 0; padding-left: 16px; display: grid; gap: 2px; } .ej-note svg { margin-top: 2px; }
.btn.danger.ghost { background: transparent; color: var(--bad-ink); border-color: transparent; } .btn.danger.ghost:hover { background: var(--bad-soft); }
@media (max-width: 880px) { .dtf-d { height: 40px; } .dtf-tm select { height: 40px; } .dtf-b { width: 34px; height: 34px; } .dtf-in { padding-right: 76px; } }
.shc-who { color: var(--ink-2); font-weight: 600; }

/* ---------- điện thoại: bảng sheet là danh sách thẻ (xem TaskSheet.mobileView trong public/sheet.js) ---------- */
.msheet { display: block; }
.msheet.has-act { padding-bottom: 84px; }
.m-bar { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 6px 16px; position: sticky; top: var(--m-top, 56px); z-index: 12; background: var(--bg, var(--surface)); border-bottom: 1px solid var(--line); }
.m-bar::-webkit-scrollbar, .m-act-in::-webkit-scrollbar { display: none; }
.m-b { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); white-space: nowrap; cursor: pointer; }
.m-b.add { background: var(--accent); border-color: var(--accent); color: #fff; }
.m-b.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
.m-b.ic { width: 40px; padding: 0; justify-content: center; }
.m-b:disabled { opacity: .4; }
.m-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.m-row { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: start; gap: 8px; min-height: 60px; padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .12s; }
.m-row:last-child { border-bottom: 0; }
.m-row:active { background: var(--surface-2); }
.m-stt { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-3); font: 700 13px var(--font); font-variant-numeric: tabular-nums; }
.m-chk { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--line-2); border-radius: 50%; color: #fff; } .m-chk.on { background: var(--accent); border-color: var(--accent); }
.m-main { display: grid; gap: 6px; min-width: 0; }
.m-text { font-size: 15px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.m-text.ph { color: var(--ink-3); font-style: italic; }
.m-rp { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--accent-strong); }
.m-row.rep .m-main { padding-left: 10px; border-left: 3px solid var(--accent-line); }
.m-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.m-img { width: 48px; height: 48px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); } .m-img.bad { opacity: .35; }
.m-proof { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px 3px 3px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.m-proof img { width: 44px; height: 44px; flex: none; object-fit: cover; object-position: center top; border-radius: 7px; background: var(--track); }
.m-proof:active { background: var(--accent-soft); } .m-proof.bad img { visibility: hidden; }
.m-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.m-lk { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-3); }
.m-err { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 12px; color: var(--bad-ink); }
.m-go { align-self: center; color: var(--ink-3); opacity: .7; }
.m-row.blank .m-stt b { opacity: .5; }
.m-row.done { opacity: .78; }
.m-row.slot { box-shadow: inset 4px 0 0 var(--pc); background: color-mix(in srgb, var(--pc) 5%, var(--surface)); }
.m-row.pick { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.m-row.flash { animation: mflash 1.6s ease-out; } @keyframes mflash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.m-row.bad { background: var(--bad-soft); }
.m-grp.grp, .m-sub.grp-sub { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.m-grp { border-bottom: 1px solid var(--line-2); background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface-2)); }
.m-grp.col { background: color-mix(in srgb, var(--ink) 5%, var(--surface-2)); }
.m-grp .grp-in { position: static; width: auto; max-width: none; min-height: 46px; padding: 8px 12px 8px 6px; }
.m-grp .grp-t { width: 32px; height: 32px; }
.m-grp.col .grp-t svg, .m-sub.col .grp-t svg { transform: rotate(-90deg); }
.m-sub { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--pc) 10%, var(--surface)); box-shadow: inset 4px 0 0 var(--pc); }
.m-sub .gs-in { position: static; width: auto; max-width: none; height: auto; min-height: 42px; flex-wrap: wrap; padding: 6px 12px 6px 10px; }
.m-sub .grp-t.sm { width: 30px; height: 30px; }
.m-add { border-bottom: 1px solid var(--line-2); background: color-mix(in srgb, var(--ink) 4%, var(--surface-2)); }
.m-add .grp-add { position: static; width: auto; padding: 10px 12px; }
.m-add .grp-add input { font-size: 16px; height: 36px; flex: 1 1 100%; max-width: none; }
.m-act { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 60; padding: 8px 12px; background: var(--surface); border-top: 1px solid var(--line-2); box-shadow: 0 -12px 26px -16px rgb(0 0 0 / .55); }
.m-act-in { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.m-act-in > * { flex: none; }
.m-act .tb-g { height: 40px; padding: 0 12px; } .m-act .tb-g.on { background: var(--accent-soft); color: var(--accent-strong); }
.m-act .tb-sel { padding: 0 6px; }
.m-act .tb-stt { height: 40px; } .m-act .tb-stt input { height: 32px; font-size: 16px; }
.m-ta { width: 100%; min-height: 150px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); font: 16px/1.45 var(--font); resize: vertical; } .m-ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.m-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.m-tools .tb-g { height: 40px; border: 1px solid var(--line-2); background: var(--surface); }
.m-tools .tb-stt { height: 40px; } .m-tools .tb-stt input { height: 32px; font-size: 16px; }
.m-imgrow { display: flex; align-items: center; gap: 12px; } .m-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-2); }
.m-open { margin-top: 4px; }
.modal .fld input { font-size: 16px; }

@media (max-width: 640px) { .jh2.sp-h .jh-meta, .jh2 .jh-meta { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .jh2 .jh-meta::-webkit-scrollbar { display: none; } .jh2 .jh-chip { flex: none; } .m-row.blank .m-stt b { opacity: .45; } }

/* ---------- trang Job: chọn nhiều job để xoá hàng loạt ---------- */
.jsel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); position: sticky; top: 8px; z-index: 12; }
.jcard.picking { position: relative; cursor: pointer; } .jcard.picking:hover { transform: none; }
.jcard.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.jc-chk { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--line-2); border-radius: 50%; background: var(--surface); color: #fff; } .jc-chk.on { background: var(--accent); border-color: var(--accent); }
.cdj { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 4px; max-height: 40vh; overflow: auto; }
@media (max-width: 880px) { .jsel { top: calc(56px + 6px); } }

.cdj-pay { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 14px; line-height: 1.4; }
.cdj-pay input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--bad); }
.cdj-pay.on { border-color: var(--bad); background: var(--bad-soft); }
.note.danger { background: var(--bad-soft); border-color: var(--bad); color: var(--bad-ink); } .note.danger svg { color: var(--bad-ink); }

/* Hẹn giờ lên cmt (bảng task: chọn hàng → Hẹn giờ…) */
.chip-btn.on { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-line); }
.sch-lead { margin: 0 0 14px; font-size: 13px; line-height: 1.5; }
.sch-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sch-gap .affix { width: 104px; flex: none; }
.sch-gap .chip-btn { height: 30px; padding: 0 9px; min-width: 38px; justify-content: center; }
.sch-pv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: grid; gap: 6px; }
.sch-pv > b { font-size: 12.5px; color: var(--ink-2); }
.sch-pv p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .sch-pv p em { font-style: normal; font-size: 11.5px; color: var(--warn-ink); }
.sch-pv ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.sch-pv li { display: flex; align-items: baseline; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.sch-pv li > span { min-width: 64px; color: var(--ink-3); }
.sch-pv li em { font-style: normal; font-size: 11.5px; color: var(--warn-ink); }
.sch-pv li.sch-more { color: var(--ink-3); font-size: 12px; }
.c-sched { white-space: nowrap; }
.c-sched .chip { font-variant-numeric: tabular-nums; }
.cj-sched { align-items: flex-start; border: 1px solid var(--accent-line); margin: 0 0 12px; } .cj-sched b { font-variant-numeric: tabular-nums; } .cj-sched > div > b { font-size: 15px; }
.cj-sched .cs-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; background: var(--surface); }
.cj-hold { align-items: flex-start; line-height: 1.45; }
.cj-hold svg { flex: none; margin-top: 2px; }

/* Report tài khoản (bấm vào tài khoản ở trang admin: UI.report) */
.who.as-link { text-align: left; border-radius: 8px; padding: 2px 6px 2px 2px; margin: -2px -6px -2px -2px; }
.who.as-link:hover b { color: var(--accent-strong); text-decoration: underline; }
.who.as-link:focus-visible { outline: 2px solid var(--accent); }
.sa-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; border-radius: 10px; }
.sa-open:hover b { color: var(--accent-strong); text-decoration: underline; }
.rp-h { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.rp-id { display: grid; gap: 6px; min-width: 0; }
.rp-id h4 { margin: 0; font-size: 18px; line-height: 1.25; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.rp-sub, .rp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; }
.rp-sub .link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.rp-meta { color: var(--ink-2); }
.rp-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.rp-tabs { margin-bottom: 14px; }
.rp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.rp-kpi { background: var(--surface); padding: 12px 14px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.rp-kpi > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rp-kpi > b { font-size: 20px; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.rp-kpi > small { font-size: 11.5px; color: var(--ink-3); }
.rp-sec { margin: 0 0 16px; }
.rp-sec > h5 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); display: flex; gap: 6px; align-items: baseline; }
.rp-bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 92px; align-items: end; }
.rp-bar { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 3px; min-width: 0; }
.rp-bar i { align-self: end; display: block; background: var(--accent); border-radius: 4px 4px 2px 2px; min-height: 3px; }
.rp-bar.zero i { background: var(--line-2); }
.rp-bar small { font-size: 10px; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.rp-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-jobs > li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rp-jh { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: space-between; }
.rp-jobs ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.rp-jobs ul li { display: flex; gap: 8px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.rp-pn { flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-tbl { width: 100%; font-size: 12.5px; }
.rp-tbl td, .rp-tbl th { padding: 7px 8px; vertical-align: top; }
.nw { white-space: nowrap; }
.rp-accs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.rp-acc { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; }
.rp-acc:hover { background: var(--surface-2); border-color: var(--line-2); }
.rp-acc.gone { opacity: .55; }
.rp-acc-t { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.rp-acc-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-acc-t small { font-size: 11.5px; color: var(--ink-3); }
.rp-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-counts .chip b { font-weight: 700; }
.rp-list { list-style: none; margin: 0; padding: 0; }
.rp-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rp-list li:last-child { border-bottom: 0; }
.rp-lt { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.rp-lt small { color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 640px) { .rp-h { gap: 10px; } .rp-kpi > b { font-size: 17px; } .rp-bars { height: 72px; } .rp-tbl td:first-child { white-space: normal; } }

/* ===== Kho tài khoản MXH (vault.js) ===== */
.vt-tabs { margin-top: 0; }
.vt-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 12px; }
.stat.vt-k { text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.stat.vt-k:hover { border-color: var(--line-2); }
.stat.vt-k.warn:hover { border-color: var(--warn); }
.stat.vt-k.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.stat.vt-k:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat.vt-k small { font-size: 12px; color: var(--ink-3); }
.vt-top { justify-content: space-between; margin-top: 4px; }
.vt-top .vt-plat button { gap: 6px; }
.vt-f { margin-top: 0; }
.vt-f .search { flex: 1 1 220px; }
.vt-f .sel-tool { flex: 0 1 190px; min-width: 140px; }
.vt-retry { margin-left: auto; }
.vt-tbl tr.off td { opacity: .55; }
.vt-tbl tr.off td.acts { opacity: 1; }
.vt-acc { max-width: 320px; min-width: 200px; }   /* khung hẹp: bảng cuộn ngang thay vì bóp tên tài khoản còn một chữ */
.vt-acc .stack-t { min-width: 0; } .vt-acc .stack-t b, .vt-acc .stack-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-ctv { font-size: 13.5px; white-space: nowrap; }
.vt-tbl .who .stack-t b { white-space: nowrap; }
.vt-st { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.vt-note { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.vt-note.wait { color: var(--accent-strong); } .vt-note.stop { color: var(--warn-ink); }
.vt-sub { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.vt-tbl td.acts { white-space: nowrap; }
.vt-pc { display: inline-flex; gap: 4px 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.vt-pc span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.vt-pc i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.vt-prog { display: grid; gap: 4px; min-width: 110px; } .vt-prog small { font-size: 12px; color: var(--ink-2); }
.vt-pxh { justify-content: space-between; margin-top: 4px; } .vt-pxh .sub-h { margin: 0; }
@media (max-width: 640px) {
  .vt-kpis { gap: 8px; } .vt-kpis .stat { padding: 10px 12px; } .vt-kpis .stat b { font-size: 20px; }
  .vt-kpis .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .vt-top { flex-direction: column; align-items: stretch; }
  .vt-f .search, .vt-f .sel-tool { flex: 1 1 100%; max-width: none; }
  .vt-retry { margin-left: 0; width: 100%; justify-content: center; }
  .vt-acc { max-width: none; }
  .tbl.cardify.vt-tbl td .vt-st { justify-content: flex-end; }
  .tbl.cardify.vt-tbl td[data-l="Ảnh · tên"] { flex-wrap: wrap; }
  .tbl.cardify.vt-tbl td[data-l="Ảnh · tên"] .vt-note { flex: 1 1 100%; text-align: right; margin-top: 0; }
  .vt-prog { min-width: 140px; justify-items: end; } .vt-prog .bar { width: 100%; }
  .tbl.cardify.vt-tbl .vt-pc { justify-content: flex-end; }
}

/* CTV: làm gộp nhiều job, nhiều link của một nền tảng */
.plats { margin-bottom: 4px; }
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.plat-btn { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 6px 12px; min-width: 0; animation: cardIn .5s var(--ease) both; animation-delay: calc(var(--i) * 50ms); transition: transform .15s; }
.plat-btn:active { transform: scale(.96); }
.plat-btn .plogo { display: block; margin-bottom: 4px; } .plogo.other { display: inline-grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); }
.plat-btn .pb-n { font-weight: 700; font-size: 14px; } .plat-btn .pb-s { display: grid; gap: 1px; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; } .plat-btn .pb-s b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.cg-job { display: block; font-weight: 600; font-size: 12.5px; color: var(--accent-strong); margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.drow .dr-j { font-style: normal; font-weight: 600; color: var(--ink-3); }
.finish .fin-next { margin-top: 14px; justify-content: flex-start; gap: 12px; height: auto; padding: 10px 16px; text-align: left; width: min(100%, 360px); }
.finish .fin-next .rs-t { display: grid; min-width: 0; line-height: 1.3; }
.finish .fin-next .rs-t small { font-weight: 500; opacity: .9; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cj-h h1.cj-pl { display: flex; align-items: center; gap: 10px; } .cj-h h1.cj-pl .plogo { flex: none; }

/* Ô ngày + ô giờ phút tách riêng (UI.DateTimeSplit, UI.DateField, UI.TimeField trong public/datefield.js) */
.dts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 12px; align-items: start; }
.dts .fld { margin-bottom: 8px; }
.dts-req { color: var(--bad); font-style: normal; font-weight: 700; margin-left: 2px; }
.dtf-in-s { padding-right: 34px; } .dts-t .dtf-in-s { padding-right: 62px; }
.dtf-pop-t { padding: 10px 12px 12px; }
.dtf-sub { margin: 8px 0 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); } .dtf-sub:first-child { margin-top: 0; }
.dtf-g6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
@media (max-width: 460px) { .dts { grid-template-columns: 1fr; } }
.sch-notime { margin: 0 0 10px; }

/* Xem như CTV (quản lý): tóm tắt máy chủ đang gửi gì cho một CTV */
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.cv-h { margin: 16px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.cv-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line, rgba(0, 0, 0, .08)); }
.cv-list li:last-child { border-bottom: 0; }

/* Thanh "Đang xem như CTV": quản lý xem giao diện thật của CTV, chỉ đọc */
.viewas { position: sticky; top: 0; z-index: 400; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: #7c2d12; color: #fff; font-size: 13px; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.viewas .va-t { display: inline-flex; align-items: center; gap: 8px; min-width: 0; } .viewas .va-t small { opacity: .85; font-size: 12px; }
.viewas .va-a { display: inline-flex; gap: 8px; }
.viewas .btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .4); } .viewas .btn:hover { background: rgba(255, 255, 255, .24); }
.viewas .btn.primary { background: #fff; color: #7c2d12; border-color: #fff; } .viewas .btn.primary:hover { background: #ffedd5; }

/* ===== Job tương tác (public/engage.js) ===== */
.eg-act { display: inline-flex; flex: none; width: max-content; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent-line); }
.eg-act i { font-style: normal; font-size: 13px; line-height: 1; }
.eg-act.lg { height: 30px; font-size: 14px; padding: 0 12px 0 9px; } .eg-act.lg i { font-size: 15px; }
.eg-act.eg-love { background: var(--bad-soft); color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.eg-act.eg-share, .eg-act.eg-repost { background: var(--good-soft); color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.eg-act.eg-post { background: var(--warn-soft); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.eg-act.eg-follow { background: var(--surface-2); color: var(--ink-2); border-color: var(--line-2); }
.eg-new, .eg-detail { max-width: 1080px; }
.eg-sec { margin-bottom: 14px; }
.eg-sh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .eg-sh h2 { font: 700 16px var(--display); }
.eg-top { display: grid; grid-template-columns: minmax(220px, 1.4fr) 1fr 1fr; gap: 14px; align-items: start; } .eg-top .fld { margin: 0; }
.eg-time { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.eg-rows { display: grid; gap: 10px; }
.eg-row { display: grid; grid-template-columns: 26px 170px minmax(0, 1fr) 96px 36px; gap: 8px 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.eg-n { font-weight: 700; color: var(--ink-3); text-align: center; font-size: 13px; }
.eg-l { width: 100%; }
.eg-q { display: flex; align-items: center; gap: 4px; } .eg-q input { width: 62px; text-align: right; } .eg-q span { font-size: 12px; color: var(--ink-3); }
.eg-c, .eg-img, .eg-hint { grid-column: 2 / -1; }
.eg-c { min-height: 38px; }
.eg-hint { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; margin-top: -2px; }
.eg-adds { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .eg-adds i { font-style: normal; }
.eg-tip { margin-top: -2px; }
.eg-prices { display: flex; gap: 10px; flex-wrap: wrap; }
.eg-price { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 150px; background: var(--surface-2); }
.eg-price.need { border-color: var(--warn); background: var(--warn-soft); }
.eg-pv { display: flex; align-items: center; gap: 6px; } .eg-pv input { width: 110px; text-align: right; font-weight: 700; } .eg-price small { font-size: 11.5px; color: var(--ink-3); }
.eg-ctvs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.eg-ctv { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 5px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.eg-ctv button { width: 22px; height: 22px; border-radius: 99px; display: inline-grid; place-items: center; color: var(--ink-3); } .eg-ctv button:hover { background: var(--track); color: var(--ink); }
.eg-cap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-2); } .eg-cap input { width: 64px; text-align: center; height: 32px; }
.eg-foot { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 6px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.eg-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; } .eg-sum span { display: inline-flex; align-items: center; gap: 4px; } .eg-sum b { font-size: 14px; }
.eg-err { color: var(--bad-ink); font-weight: 600; }
.eg-sub { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; } .eg-sub .muted { display: inline-flex; align-items: center; gap: 4px; }
.eg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.eg-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 4px; }
.eg-stats b { font: 700 22px var(--display); } .eg-stats b small { font-size: 14px; color: var(--ink-3); } .eg-stats span { font-size: 12.5px; color: var(--ink-3); }
.eg-stats .eg-pl { grid-column: 1 / -1; display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; } .eg-pl span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.eg-byctv { margin-bottom: 14px; } .eg-byctv summary { display: flex; gap: 10px; align-items: baseline; padding: 12px 16px; cursor: pointer; }
.eg-cn { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.eg-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.eg-groups { display: grid; gap: 10px; }
.eg-gh { width: 100%; display: grid; grid-template-columns: max-content minmax(0, 1fr) 200px 20px; gap: 14px; align-items: center; padding: 12px 16px; text-align: left; }
.eg-gh:hover { background: var(--surface-2); }
.eg-gm { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.eg-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.eg-note { color: var(--ink-2); font-size: 12.5px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.eg-gp { display: grid; gap: 4px; } .eg-gp b { font-size: 14px; } .eg-gp small { font-size: 11.5px; color: var(--ink-3); }
.eg-tw { border-top: 1px solid var(--line); overflow-x: auto; }
.eg-tt td { vertical-align: middle; } .eg-stt { width: 56px; color: var(--ink-3); font-weight: 700; } .eg-who { min-width: 180px; } .eg-proof { max-width: 260px; } .eg-tact { text-align: right; white-space: nowrap; }
.eg-tt tr.eg-done td { background: color-mix(in srgb, var(--good-soft) 45%, transparent); }
.eg-gf { padding: 8px 16px; border-top: 1px solid var(--line); }
/* CTV */
.eg-ch { display: flex; gap: 14px; align-items: center; margin: 4px 0 12px; } .eg-ch h1 { font: 700 21px/1.2 var(--display); margin-bottom: 4px; }
.eg-why { display: flex; gap: 6px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); font-weight: 600; font-size: 13.5px; margin-bottom: 12px; }
.eg-tabs { margin-bottom: 12px; }
.eg-cl, .eg-dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.eg-cc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.eg-cc > header { display: flex; align-items: center; gap: 8px; } .eg-cnt { font-weight: 700; color: var(--ink-3); font-size: 13px; } .eg-cpr { margin-left: auto; font-weight: 700; color: var(--good-ink); font-size: 13px; }
.eg-cv { color: var(--ink-2); font-size: 14px; }
.eg-open { height: auto; min-height: 44px; flex-wrap: wrap; padding: 8px 12px; } .eg-open small { width: 100%; font-weight: 500; color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.eg-cn2 { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); } .eg-cn2 p { white-space: pre-wrap; font-size: 14px; } .eg-cn2 .btn { justify-self: start; }
.eg-img2 { display: flex; gap: 10px; align-items: flex-end; } .eg-img2 img { max-width: 140px; max-height: 140px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.eg-step { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; } .eg-step > b { font-size: 13.5px; }
.eg-pb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; } .eg-pbr { display: flex; gap: 6px; min-width: 0; } .eg-pbr input { flex: 1 1 0; width: 0; min-width: 0; height: 40px; } .eg-pbr .btn { flex: none; height: 40px; }
.eg-perr { display: flex; gap: 6px; align-items: flex-start; color: var(--bad-ink); font-size: 13px; font-weight: 600; }
.eg-ticks { display: flex; gap: 8px; flex-wrap: wrap; } .eg-ticks .btn { flex: 1 1 auto; } .eg-ticks .btn.lg { flex: 1 1 160px; }
.eg-dr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.eg-drh { display: flex; align-items: center; gap: 8px; } .eg-drh .eg-cpr { margin-left: 0; }
.eg-drp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 880px) {
  .eg-top { grid-template-columns: 1fr; }
  .eg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eg-gh { grid-template-columns: minmax(0, 1fr) 20px; } .eg-gh .eg-act { justify-self: start; } .eg-gh .eg-gm { grid-column: 1; } .eg-gh .eg-gp { grid-column: 1; } .eg-gh > svg { grid-row: 1; grid-column: 2; }
}
@media (max-width: 640px) {
  .eg-row { grid-template-columns: 22px minmax(0, 1fr) 36px; }
  .eg-row .eg-a { grid-column: 2; } .eg-row .eg-x { grid-column: 3; grid-row: 1; }
  .eg-row .eg-l, .eg-row .eg-q { grid-column: 2 / -1; }
  .eg-foot { margin: 6px -4px 0; }
}
