:root {
  --green: #0b2a20;
  --green-2: #123d2f;
  --gold: #c9a24b;
  --gold-2: #e6c97a;
  --bg: #f4f2ec;
  --card: #ffffff;
  --text: #1c2420;
  --muted: #6b726e;
  --line: #e7e3d8;
  --danger: #b42318;
  --ok: #15803d;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1513; --card: #17211d; --text: #eef0ec; --muted: #9aa49f; --line: #26332d; color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.boot { height: 100vh; display: grid; place-content: center; text-align: center; background: var(--green); color: var(--gold-2); }
.boot img { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 4px;
  padding: calc(8px + var(--safe-top)) 8px 8px; background: var(--green); color: #fff; box-shadow: 0 1px 0 rgba(201,162,75,.35); }
.top h1 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .back, .top .icon-btn { display: grid; place-items: center; width: 40px; height: 40px; text-decoration: none; font-size: 28px; color: var(--gold-2); border-radius: 10px; }
.top .icon-btn { font-size: 22px; }
.logo-dot { width: 32px; height: 32px; margin-left: 4px; border-radius: 8px; object-fit: cover; }

.view { padding: 14px 14px calc(90px + var(--safe-bottom)); max-width: 760px; margin: 0 auto; }

/* Tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; text-decoration: none; color: var(--muted); }
.tabs a span { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabs a.active { color: var(--green-2); font-weight: 600; }
@media (prefers-color-scheme: dark) { .tabs a.active { color: var(--gold-2); } }
.tabs a.active span { filter: none; opacity: 1; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); }
.card h2 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; font-size: 15px; font-weight: 650; }
.card h2 a, .link { font-size: 14px; font-weight: 500; color: var(--gold); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
details.card summary { font-weight: 650; cursor: pointer; padding: 2px 0; }
details.card[open] summary { margin-bottom: 10px; }

.hello { margin: 2px 2px 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; }
.stat strong { display: block; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.hl { grid-column: 1 / -1; background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; border: 0; }
.stat.hl strong { color: var(--gold-2); font-size: 34px; }
.stat.hl span { color: #d9e4de; }

.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 130px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; font-size: 11px; }
.bar i { display: block; width: 100%; max-width: 28px; background: linear-gradient(var(--gold-2), var(--gold)); border-radius: 6px 6px 2px 2px; }
.bar b { order: -1; font-size: 12px; }
.bar small { color: var(--muted); margin-top: 4px; }

.st-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; }
.st-row:first-of-type { border-top: 0; }
.st-row b { margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; }

/* Lists */
.item { display: flex; gap: 12px; align-items: center; padding: 11px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; text-decoration: none; }
.card .item { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 10px 0; margin: 0; }
.item-body { flex: 1; min-width: 0; }
.item .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.item .row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--green); background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--line); display: grid; place-items: center; font-size: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.badge { flex: none; display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); white-space: nowrap; }

.search input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; cursor: pointer; }
.chip.active { background: var(--green); color: var(--gold-2); border-color: var(--green); }
.chip.st.active { background: var(--c); border-color: var(--c); color: #fff; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--card); border: 1px solid var(--line); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.seg a { text-align: center; padding: 8px 4px; border-radius: 9px; text-decoration: none; font-size: 14px; }
.seg a.active { background: var(--green); color: var(--gold-2); font-weight: 600; }

/* Lead detail */
.lead-head { display: flex; gap: 14px; align-items: center; }
.lead-head .name { margin: 0 0 2px; font-size: 19px; }
.lead-head .badge { margin-top: 6px; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 12px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-size: 22px; }
.act span { font-size: 13px; font-weight: 600; }
.act:first-child { background: var(--green); color: var(--gold-2); border-color: var(--green); }
.info { margin: 0; display: grid; grid-template-columns: 92px 1fr; gap: 8px 10px; }
.info dt { color: var(--muted); font-size: 14px; }
.info dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li { border-left: 3px solid var(--gold); padding: 2px 0 12px 12px; margin-left: 2px; }
.timeline li.t-status, .timeline li.t-assign, .timeline li.t-system { border-color: var(--line); color: var(--muted); }
.note-form { display: flex; flex-direction: column; gap: 8px; }

/* Forms */
.form label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.form input:not([type=checkbox]), .form select, .form textarea, .note-form textarea, select.assign {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 400; font-size: 16px; }
.form textarea, .note-form textarea { resize: vertical; }
.form input[type=color] { height: 44px; padding: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { display: flex !important; align-items: center; gap: 10px; color: var(--text) !important; }
.switch input { width: 22px; height: 22px; accent-color: var(--green-2); }
.note { background: color-mix(in srgb, var(--gold) 14%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 11px; border: 0; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1d1a10; font-weight: 650; }
.btn:disabled { opacity: .6; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: transparent; border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.sticky-save { position: sticky; bottom: calc(66px + var(--safe-bottom)); padding: 8px 0; z-index: 5; }
.danger-zone { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }

.featured { display: flex; gap: 12px; align-items: center; }
.fimg { width: 110px; height: 110px; border-radius: 12px; overflow: hidden; background: var(--bg); display: grid; place-items: center; color: var(--muted); font-size: 13px; flex: none; border: 1px dashed var(--line); }
.fimg img { width: 100%; height: 100%; object-fit: cover; }
.fbtns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gi { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); }
.gi img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gctl { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: linear-gradient(transparent, rgba(0,0,0,.65)); padding: 4px; }
.gctl button { border: 0; background: rgba(255,255,255,.9); color: #111; width: 28px; height: 28px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.gctl button[data-rm] { background: var(--danger); color: #fff; }
.gctl button[data-cover] { color: #9a7a2a; }
.gi-cover { position: absolute; top: 6px; left: 6px; background: var(--green); color: var(--gold-2); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.gctl { gap: 2px; }
.gctl button { width: 26px; }
.img-field { margin-bottom: 14px; }
.img-field .lbl { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.img-prev { width: 100%; max-height: 180px; border-radius: 10px; overflow: hidden; background: var(--bg); margin-bottom: 8px; display: grid; place-items: center; min-height: 60px; }
.img-prev img { width: 100%; max-height: 180px; object-fit: cover; }

/* More */
.user { display: flex; gap: 12px; align-items: center; }
.user img { width: 52px; height: 52px; border-radius: 50%; }
.menu { padding: 0; overflow: hidden; }
.menu a { display: flex; justify-content: space-between; padding: 14px; border-top: 1px solid var(--line); text-decoration: none; }
.menu a:first-child { border-top: 0; }
.menu a span { color: var(--muted); }
.menu a.red { color: var(--danger); }
.tip ol { margin: 0; padding-left: 20px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .btn { margin-top: 14px; }
.loading { display: grid; place-items: center; padding: 40px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.more-wrap { margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 50;
  background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--green-2); color: var(--gold-2); }
.toast.err { background: var(--danger); }

/* ===== v1.1: Tổng quan / Khách hàng theo dự án / Video / Quản lý ===== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; }
.kpi strong { display: block; font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.5px; color: var(--muted); }
.stat.hl { display: block; margin-bottom: 10px; }
.seg.mini { display: inline-flex; gap: 2px; padding: 2px; margin: 0; border-radius: 9px; }
.seg.mini button { border: 0; background: none; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.seg.mini button.active { background: var(--green); color: var(--gold-2); }
.bar.thin i { border-radius: 3px 3px 1px 1px; }
.bar.thin b { font-size: 9px; }
.bar.thin small { font-size: 9px; white-space: nowrap; }
.chart { gap: 3px; }
.care-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 12px; }
.care-sum strong { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.care-sum div:first-child strong { color: #ca8a04; }
.care-sum div:nth-child(2) strong { color: var(--ok); }
.care-sum span { font-size: 12px; color: var(--muted); }
.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; margin-bottom: 6px; background: var(--line); }
.stack i { display: block; min-width: 4px; }
.st-row .pct { margin-left: auto; color: var(--muted); font-size: 13px; }
.st-row .pct + b { margin-left: 12px; min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.warn { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #ca8a04 14%, transparent); font-size: 14px; text-decoration: none; }
.proj-row { display: block; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.proj-row:first-of-type { border-top: 0; }
.proj-row .row { display: flex; justify-content: space-between; font-weight: 600; }
.meter { height: 6px; border-radius: 999px; background: var(--line); margin: 6px 0 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: 999px; }
.new-dot { color: #2563eb; font-weight: 600; }

.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 4px 8px; font-weight: 600; }
.all-leads { display: flex; justify-content: space-between; align-items: center; padding: 14px; margin-top: 10px; background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; border-radius: var(--radius); text-decoration: none; }
.all-leads b { display: block; color: var(--gold-2); }
.all-leads .muted { color: #cfdcd5; }
.all-leads > span { font-size: 24px; color: var(--gold-2); }
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.proj-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; min-width: 0; }
.proj-card.none { opacity: .85; border-style: dashed; }
.pc-icon { font-size: 22px; }
.pc-name { font-size: 15px; line-height: 1.3; }
.pc-total { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.pc-total small { font-size: 13px; font-weight: 400; color: var(--muted); }
.pc-meta { font-size: 12px; color: var(--muted); }
.pc-new { position: absolute; top: 10px; right: 10px; background: #2563eb; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg4 a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12.5px; padding: 7px 2px; }
.seg4 a span { font-size: 18px; }
.seg4 a span .ic { width: 21px; height: 21px; }
/* v2.5.1: 5 loại nội dung trở lên → thanh trượt ngang (vuốt được trên iPhone) */
@media (max-width: 520px) { .seg-scroll { display: flex; overflow-x: auto; scrollbar-width: none; } .seg-scroll::-webkit-scrollbar { display: none; } .seg-scroll a { flex: 1 0 62px; min-width: 62px; font-size: 12px; white-space: nowrap; } }
.chips, .quick-notes, .people, .act-sum .sum-row, .ptable-wrap, .seg-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
.thumb.wide { width: 88px; height: 50px; }
.yt-prev a { position: relative; display: block; border-radius: 10px; overflow: hidden; margin: 10px 0 4px; }
.yt-prev img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.yt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 40px; border-radius: 12px; background: #e62117; color: #fff; display: grid; place-items: center; font-size: 18px; }
.ok { color: var(--ok); margin: 4px 0 0; }
.err { color: var(--danger); margin: 6px 0 0; }
.sr { font-size: 0 !important; margin-bottom: 0 !important; }
.sr input { font-size: 16px !important; }

.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: grid; place-items: end stretch; padding: 12px 12px calc(12px + var(--safe-bottom)); }
.sheet-box { background: var(--card); border-radius: 16px; padding: 18px; max-width: 520px; width: 100%; margin: 0 auto; }
.sheet-box p { margin: 0 0 14px; font-weight: 600; }
.sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.danger-fill { background: var(--danger); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 14px; }

.user .btn.sm { margin-left: auto; }
.sec-list { display: flex; flex-direction: column; gap: 8px; }
.sec-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; margin-bottom: 0; }
.sec-row.hl { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 9%, var(--card)); margin-bottom: 10px; }
.sec-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 20px; border-radius: 10px; background: var(--bg); }
.sec-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chev { color: var(--muted); font-size: 22px; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-top: 2px; }
.pill.on { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill.off { background: var(--line); color: var(--muted); }

.layout-list { padding: 4px 12px; }
.lay-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.lay-row:first-child { border-top: 0; }
.lay-row b { flex: 1; min-width: 0; font-weight: 600; }
.lay-row.off b, .lay-row.off .sec-ic { opacity: .45; }
.lay-row.fixed { opacity: .8; }
.lay-ctl { display: flex; align-items: center; gap: 6px; }
.lay-ctl button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 15px; }
.lay-ctl button:disabled { opacity: .3; }

.tgl { position: relative; display: inline-block !important; width: 50px; height: 30px; flex: none; margin: 0 !important; }
.tgl input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.tgl i { position: absolute; inset: 0; border-radius: 999px; background: #c9c6bd; transition: background .2s; }
.tgl i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.tgl input:checked + i { background: var(--ok); }
.tgl input:checked + i::after { transform: translateX(20px); }
.tgl input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.tgl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.tgl-row .hint { font-weight: 400; }
.vis-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.fhead { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.site-form .fhead:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hint { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.list-field { margin-bottom: 14px; }
.list-field .lbl { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.lrow { display: flex; gap: 6px; margin-bottom: 6px; }
.lrow input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }
.lrow button { flex: none; width: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.lrow button[data-del] { color: var(--danger); }
.color-in { display: flex; gap: 8px; margin-top: 5px; }
.color-in input[type=color] { flex: none; width: 56px !important; margin: 0 !important; }
.color-in input[type=text] { flex: 1; margin: 0 !important; font-family: ui-monospace, Menlo, monospace; }
.stepper { display: flex; gap: 6px; margin-top: 5px; }
.stepper input { margin: 0 !important; text-align: center; }
.stepper button { flex: none; width: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 20px; cursor: pointer; }
.img-btns { display: flex; align-items: center; gap: 14px; }
@media (max-width: 360px) { .kpis { grid-template-columns: repeat(2, 1fr); } .proj-grid { grid-template-columns: 1fr; } }

/* Quản lý: danh sách gọn, mỗi mục một dòng */
.sub { display: flex; justify-content: space-between; align-items: baseline; }
.sub-link { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--gold); text-decoration: none; font-weight: 600; }
.mlist a { align-items: center; gap: 10px; padding: 12px 14px; }
.mlist .mi { flex: none; width: 26px; text-align: center; font-size: 18px; }
.mlist .mt { flex: 1; min-width: 0; font-weight: 500; }
.mlist .pill { margin: 0; }
.mlist .chev { font-size: 20px; line-height: 1; }
.mlist a.is-off .mt, .mlist a.is-off .mi { opacity: .5; }
.mlist a { justify-content: flex-start; }
.mlist a .mt { color: var(--text); }
.mlist a.red .mt { color: var(--danger); }

/* ===== v1.2: Đăng nhập, Công việc, Nhân sự, Hồ sơ, SEO ===== */
button.icon-btn, button.back { border: 0; background: none; cursor: pointer; padding: 0; font: inherit; }
.icon-btn.on { background: rgba(236, 208, 138, .2); }
.red { color: var(--danger); }
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom)); background: radial-gradient(circle at 50% 0%, #1b4a39 0%, var(--green) 60%); }
.login-box { width: min(400px, 100%); background: var(--card); color: var(--text); border-radius: 20px; padding: 28px 22px 22px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 12px; }
.login-logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 4px; }
.login-box h1 { margin: 0; text-align: center; font-size: 22px; }
.login-sub { margin: -6px 0 6px; text-align: center; color: var(--muted); }
.login-box label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.login-box input:not([type=checkbox]) { display: block; width: 100%; margin-top: 5px; padding: 13px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; color: var(--text); }
.pw { position: relative; display: block; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-38%); border: 0; background: none; font-size: 18px; cursor: pointer; padding: 6px; }
.login-box .chk, .chk { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.chk input { width: 18px; height: 18px; accent-color: var(--green-2); }
.login-err { min-height: 1.2em; margin: 0; color: var(--danger); font-size: 14px; }
.login-lost { text-align: center; color: var(--gold); font-size: 14px; text-decoration: none; }
.login-foot { max-width: 400px; text-align: center; color: #cfdcd5; font-size: 13px; margin: 0; }

.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.tl .task:first-child, .tlist .task:first-child { border-top: 0; }
.tlist .task { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.tcheck { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--gold); background: none; color: #fff; font-weight: 800; cursor: pointer; }
.task.done .tcheck { background: var(--ok); border-color: var(--ok); }
.task.done b { text-decoration: line-through; color: var(--muted); }
.task.late .tcheck { border-color: var(--danger); }
.tbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-decoration: none; }
.tmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.inline-sel { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.inline-sel select { flex: 1; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 15px; }
.quick-due { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.quick-due button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.task-lead { display: flex; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--bg); text-decoration: none; font-size: 14px; }
.task-lead span { margin-left: auto; color: var(--muted); }
.task-title { margin: 0 0 6px; font-size: 18px; }

.staff-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-card { display: flex; flex-direction: column; padding: 12px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.mini-card strong { font-size: 24px; line-height: 1.1; }
.mini-card span { font-size: 12px; color: var(--muted); }
.mini-card em { font-style: normal; font-size: 12px; color: var(--gold); margin-top: 4px; font-weight: 600; }
.staff-row { display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.staff-row.off { opacity: .55; }
img.avatar { object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; display: inline-grid; vertical-align: middle; margin-right: 6px; }
.sstats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.staff-head { display: flex; gap: 14px; align-items: center; }
.staff-head .name { margin: 0 0 2px; font-size: 19px; }
.staff-head .badge { margin-top: 6px; text-decoration: none; }
.role-pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.radio { display: flex !important; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 !important; border: 1px solid var(--line); border-radius: 10px; font-weight: 500 !important; color: var(--text) !important; }
.radio input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green-2); }
.radio:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.cred pre { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 10px; font-size: 14px; user-select: all; -webkit-user-select: all; }
.big-ok { width: 64px; height: 64px; margin: 6px auto 10px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 32px; }
.lock-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lock-box label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.lock-box select { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }

.perf { font-size: 13.5px; }
.perf-h, .perf-r { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(4, minmax(0, 1fr)); gap: 4px; align-items: center; padding: 8px 0; }
.perf-h { color: var(--muted); font-size: 11.5px; border-bottom: 1px solid var(--line); }
.perf-r { border-bottom: 1px solid var(--line); text-decoration: none; font-variant-numeric: tabular-nums; }
.perf-h span:not(:first-child), .perf-r span:not(:first-child) { text-align: center; }
.perf-r .pn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perf-r .g { color: var(--ok); font-weight: 700; }

.bulk-bar { position: sticky; bottom: calc(66px + var(--safe-bottom)); z-index: 6; display: flex; gap: 8px; align-items: center; padding: 10px; margin-top: 8px; background: var(--green); color: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.bulk-bar span { font-weight: 700; white-space: nowrap; color: var(--gold-2); }
.bulk-bar select { flex: 1; min-width: 0; padding: 8px; border-radius: 9px; border: 0; font-size: 15px; }
.pick { display: flex; align-items: center; gap: 10px; }
.pick > input { flex: none; width: 22px; height: 22px; accent-color: var(--green-2); }
.pick > .item { flex: 1; min-width: 0; }

.profile-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ph-photo { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--green); font-size: 44px; font-weight: 700; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--gold); }
.ph-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-head p { margin: 0; }
.profile-head .badge { text-decoration: none; }

.counter { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.counter.ok { color: var(--ok); }
.counter.warn { color: #b45309; }
.gprev { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid #e3e3e3; font-family: Arial, sans-serif; font-weight: 400; }
.gp-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #70757a; margin-bottom: 4px; }
.gp-url { font-size: 12.5px; color: #202124; }
.gp-title { font-size: 18px; color: #1a0dab; line-height: 1.3; }
.gp-desc { font-size: 13.5px; color: #4d5156; line-height: 1.45; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace !important; font-size: 13px !important; }

.score-card { display: flex; gap: 16px; align-items: center; }
.score { flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.score span { width: 66px; height: 66px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 24px; font-weight: 800; color: var(--c); }
.score-card p { margin: 4px 0 0; }
.checks { padding: 4px 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; }
.check:first-child { border-top: 0; }
.ci { flex: none; font-size: 16px; }
.cb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.check.ok b { font-weight: 500; }
.sel { user-select: all; -webkit-user-select: all; word-break: break-all; }
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid2 input, .grid2 select { min-width: 0; }
.task-form .grid2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.task-form input[type=datetime-local] { font-size: 15px; padding-left: 8px; padding-right: 6px; }

/* ===== v1.3: Thông báo & Nhật ký chăm sóc ===== */
.top { grid-template-columns: 44px minmax(0, 1fr) auto; }
.top-r { display: flex; align-items: center; justify-content: flex-end; min-width: 44px; }
.bell { position: relative; font-size: 20px !important; }
.bell-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--green); }
.ntoast { position: fixed; z-index: 70; left: 50%; top: calc(10px + var(--safe-top)); width: min(440px, calc(100% - 20px)); transform: translate(-50%, -140%); transition: transform .35s ease; display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: var(--card); color: var(--text); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.25); border: 1px solid var(--line); text-decoration: none; }
.ntoast.show { transform: translate(-50%, 0); }
.ntoast .ni { font-size: 22px; }
.ntoast b { display: block; font-size: 14.5px; }
.ntoast small { display: block; color: var(--muted); font-size: 13px; }
.nlist { padding: 0 14px; }
.notif { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; }
.notif:first-child { border-top: 0; }
.notif.unread { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.notif .avatar.ni { background: var(--bg); font-size: 20px; }
.nb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nb b { font-size: 14.5px; line-height: 1.35; }
.notif:not(.unread) .nb b { font-weight: 500; }
.nbody { font-size: 13.5px; color: var(--text); opacity: .8; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dot-new { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: #2563eb; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.push-card h2 .pill { margin-left: 8px; }
.act-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; }
.act-list .act-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.card .act-item:first-of-type { border-top: 0; }
.ab { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.alead { font-size: 13px; color: var(--muted); }
.alead .badge { margin-left: 2px; }
.abubble { display: block; padding: 8px 11px; border-radius: 4px 14px 14px 14px; background: var(--bg); font-size: 14px; line-height: 1.45; }
.act-sum .sum-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.sum-chip { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font: inherit; color: var(--text); }
.sum-chip span { font-size: 12px; color: var(--muted); }
.quick-notes { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quick-notes::-webkit-scrollbar { display: none; }
.quick-notes button { flex: none; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; cursor: pointer; }
.note-form.flash { animation: flash 1.6s ease 2; border-radius: 12px; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 55%, transparent); } }
.sh-photo { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.link.sm { font-size: 12.5px; }

/* ===== v1.4: Kho data & tách Quảng cáo / Data ===== */
.kseg, .kseg3 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.kseg3 { grid-template-columns: .8fr 1fr 1fr; }
.kseg button, .kseg3 button { border: 0; background: none; padding: 9px 4px; border-radius: 9px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.kseg button.active, .kseg3 button.active { background: var(--green); color: var(--gold-2); font-weight: 600; }
.kseg em { font-style: normal; display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 11px; line-height: 17px; }
.kind-tag { display: inline-block; vertical-align: 2px; padding: 0 5px; border-radius: 4px; background: #7c3aed; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; }
.data-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.dk { display: flex; flex-direction: column; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.dk strong { font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dk span { font-size: 11.5px; color: var(--muted); }
.dk.warn-k { border-color: color-mix(in srgb, #dc2626 40%, transparent); }
.dk.warn-k strong { color: #dc2626; }
.dk.ok-k strong { color: var(--ok); }
.dbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--line); margin: 6px 0; }
.dbar i { display: block; min-width: 0; }
.dlegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.dlegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.btn-grid .btn { padding: 11px 8px; font-size: 14px; }
.batch { display: block; padding: 12px 14px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.batch .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bnums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin: 6px 0 2px; }
.dperf .perf-r { grid-template-columns: minmax(0, 2.4fr) repeat(4, minmax(0, 1fr)); row-gap: 2px; }
.dperf .perf-r .pn { text-decoration: none; }
.dmini { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dmini i { display: block; height: 100%; background: var(--ok); }
.dcall { grid-column: 1 / -1; text-align: left !important; }
.steps { display: flex; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; counter-reset: st; }
.steps li { flex: 1; text-align: center; font-size: 12.5px; padding: 8px 4px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--muted); counter-increment: st; }
.steps li::before { content: counter(st) ". "; font-weight: 700; }
.steps li.on { background: var(--green); color: var(--gold-2); border-color: var(--green); font-weight: 600; }
.steps li.done { color: var(--ok); }
.dropzone { position: relative; display: flex !important; flex-direction: column; align-items: center; gap: 4px; padding: 28px 12px; border: 2px dashed color-mix(in srgb, var(--gold) 60%, transparent); border-radius: 14px; text-align: center; cursor: pointer; color: var(--text) !important; margin-bottom: 12px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-ic { font-size: 34px; }
.ptable-wrap { overflow-x: auto; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; }
.ptable { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.ptable th, .ptable td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.ptable th { background: var(--bg); position: relative; }
.ptable .mapped { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.ptable th.mapped::after { content: attr(data-tag); display: block; font-size: 10px; color: var(--gold); font-weight: 700; }
.res-row { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.staff-pick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.spick { display: flex !important; align-items: center; gap: 10px; padding: 9px 10px; margin: 0 !important; border: 1px solid var(--line); border-radius: 10px; color: var(--text) !important; font-weight: 500 !important; }
.spick input { width: 20px; height: 20px; accent-color: var(--green-2); flex: none; }
.spick:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.spick > span { display: flex; flex-direction: column; }
.stepper.inl { display: inline-flex; width: 150px; vertical-align: middle; margin: 4px 4px; }
.avail { margin: -4px 0 8px; font-size: 14px; }
.fhead .link { float: right; text-transform: none; letter-spacing: 0; }
.radio > span { flex: 1; min-width: 0; text-align: left; }
.dform .radio { margin-bottom: 8px !important; }

/* ===== v1.5: Đội ngũ trên website ===== */
.tw-list { padding: 4px 12px; }
.tw-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.tw-row:first-child { border-top: 0; }
.tw-row.off .avatar, .tw-row.off .tw-body b { opacity: .5; }
.tw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tw-seg { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tw-seg button { padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 12.5px; cursor: pointer; color: var(--text); }
.tw-seg button.on.featured { background: #b45309; border-color: #b45309; color: #fff; }
.tw-seg button.on.shown { background: var(--green); border-color: var(--green); color: var(--gold-2); }
.tw-seg button.on.hidden { background: #6b7280; border-color: #6b7280; color: #fff; }
.tw-mv { display: flex; flex-direction: column; gap: 4px; }
.tw-mv button { width: 32px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.tw-mv button:disabled { opacity: .3; }
.twp { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.twp-full, .twp-mini { display: flex; gap: 3px; align-items: center; min-width: 96px; }
.twp-full i { width: 14px; height: 18px; border-radius: 3px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.twp-full em { font-style: normal; font-size: 11px; color: var(--muted); }
.twp-mini i { width: 9px; height: 9px; border-radius: 50%; background: var(--green-2); opacity: .7; }
.tw-set { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tw-set label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.tw-preview .warn { margin: 6px 0; }
.tw-row { position: relative; }
.tw-rank { position: absolute; left: -4px; top: 6px; z-index: 1; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: #1b160a; background: linear-gradient(135deg, #e5e7eb, #9ca3af); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.tw-rank.r1 { background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.tw-rank.r3 { background: linear-gradient(135deg, #f3c19a, #b0703f); }

/* =====================================================================
   v1.7: GIAO DIỆN MÁY TÍNH / MÀN HÌNH LỚN (≥ 1024px)
   Menu bên trái, nội dung trải rộng nhiều cột. Điện thoại giữ nguyên.
   ===================================================================== */
.side { display: none; }
.lead-cols, .col-a, .col-b { display: block; }

@media (min-width: 1024px) {
  html, body { background: var(--bg); }
  #app { display: grid; grid-template-columns: 252px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "side top" "side view"; min-height: 100vh; }
  .tabs { display: none; }

  /* Menu trái */
  .side { grid-area: side; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 18px 14px 16px; background: var(--green); color: #e8efe9; overflow-y: auto; }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; text-decoration: none; border-bottom: 1px solid rgba(236, 208, 138, .18); }
  .side-brand img { width: 40px; height: 40px; border-radius: 10px; }
  .side-brand b { display: block; color: var(--gold-2); font-size: 15px; }
  .side-brand small { color: #a9bdb2; font-size: 12px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #dfe9e3; text-decoration: none; font-size: 14.5px; }
  .side-nav a span { width: 22px; text-align: center; font-size: 17px; }
  .side-nav a:hover { background: rgba(255, 255, 255, .06); }
  .side-nav a.active { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1b160a; font-weight: 600; }
  .side-nav hr { border: 0; border-top: 1px solid rgba(236, 208, 138, .15); margin: 8px 4px; }
  .side-nav em { margin-left: auto; font-style: normal; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 11.5px; line-height: 19px; text-align: center; }
  .side-foot { border-top: 1px solid rgba(236, 208, 138, .18); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
  .side-foot a { padding: 7px 12px; border-radius: 8px; color: #cfdcd5; text-decoration: none; font-size: 13.5px; }
  .side-foot a:hover { background: rgba(255, 255, 255, .06); }
  .side-foot a.red { color: #fca5a5; }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; }
  .side-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
  .side-user b { display: block; font-size: 14px; color: #fff; }
  .side-user small { color: #a9bdb2; font-size: 12px; }

  /* Thanh tiêu đề trang */
  .top { grid-area: top; position: sticky; top: 0; z-index: 8; grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--text); box-shadow: 0 1px 0 var(--line); }
  .top h1 { text-align: left; font-size: 22px; font-weight: 700; padding-left: 4px; }
  .top .logo-dot { display: none; }
  .top .back, .top .icon-btn { color: var(--text); background: var(--card); border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
  .top .back { font-size: 26px; margin-right: 8px; }
  .top-r { gap: 8px; }
  .bell-n { box-shadow: 0 0 0 2px var(--bg); }

  /* Vùng nội dung */
  .view { grid-area: view; max-width: 1320px; width: 100%; margin: 0; padding: 22px 32px 48px; }
  .sticky-save { bottom: 16px; }
  .bulk-bar { bottom: 16px; max-width: 640px; }
  .toast { bottom: 24px; left: auto; right: 24px; transform: translate(0, 20px); }
  .toast.show { transform: translate(0, 0); }
  .ntoast { left: auto; right: 24px; top: 16px; transform: translate(0, -140%); width: 400px; }
  .ntoast.show { transform: translate(0, 0); }
  .sheet { place-items: center; }
  .card { padding: 18px 20px; }

  /* Tổng quan: bảng điều khiển nhiều cột */
  body[data-view="home"] .home-cols { columns: 2 420px; column-gap: 18px; }
  body[data-view="home"] .home-cols > * { break-inside: avoid; margin-bottom: 16px; }
  body[data-view="home"] .home-cols > .hello, body[data-view="home"] .home-cols > .kseg3, body[data-view="home"] .home-cols > .stat.hl, body[data-view="home"] .home-cols > .kpis { column-span: all; }
  body[data-view="home"] .kseg3 { max-width: 520px; }
  body[data-view="home"] .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  body[data-view="home"] .kpi { padding: 16px; }
  body[data-view="home"] .kpi strong { font-size: 30px; }
  body[data-view="home"] .stat.hl { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
  body[data-view="home"] .stat.hl strong { font-size: 40px; }
  .chart { height: 180px; }

  /* Danh sách dạng lưới */
  body[data-view="leadlist"] .list, body[data-view="content"] .list, body[data-view="tasks"] .tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
  body[data-view="leadlist"] .list .item, body[data-view="content"] .list .item, body[data-view="tasks"] .tlist .task { margin: 0; }
  body[data-view="leadlist"] .list .pick { margin: 0; }
  body[data-view="leadlist"] .list .empty, body[data-view="content"] .list .empty, body[data-view="content"] .list .note, body[data-view="tasks"] .tlist .empty { grid-column: 1 / -1; }
  body[data-view="leadlist"] .search, body[data-view="leads"] .search { max-width: 560px; }
  body[data-view="leads"] .proj-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
  body[data-view="leads"] .kseg { max-width: 520px; }
  body[data-view="leads"] .all-leads { max-width: 560px; }
  body[data-view="staff"] .staff-top { grid-template-columns: repeat(3, minmax(0, 220px)); }
  body[data-view="staff"] .view { display: block; }
  body[data-view="staff"] .staff-row { display: inline-flex; width: calc(50% - 6px); margin-right: 8px; vertical-align: top; }
  body[data-view="staff"] .staff-row:nth-of-type(even) { margin-right: 0; }
  body[data-view="data"] .data-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body[data-view="data"] .btn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-view="data"] .batch { display: inline-block; width: calc(50% - 6px); margin-right: 8px; vertical-align: top; }
  body[data-view="data"] .batch:nth-of-type(even) { margin-right: 0; }
  body[data-view="activity"] .act-list { columns: 2 420px; column-gap: 12px; }
  body[data-view="activity"] .act-list .act-item { break-inside: avoid; }
  body[data-view="activity"] .grid2 { max-width: 640px; }

  /* Chi tiết khách: 2 cột */
  .lead-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .col-b { position: sticky; top: 84px; }
  .lead-cols + .del { max-width: 320px; }

  /* Biểu mẫu & trang đọc: giữ độ rộng dễ đọc */
  body[data-view="edit"] .view, body[data-view="task"] .view, body[data-view="profile"] .view,
  body[data-view="notifications"] .view, body[data-view="manage"] .view, body[data-view="lead"] .view:not(:has(.lead-cols)) { max-width: none; padding-right: max(32px, calc(100% - 880px + 32px)); }
  body[data-view="manage"] .manage-cols { columns: 2 380px; column-gap: 18px; max-width: 1100px; }
  body[data-view="manage"] .manage-cols > * { break-inside: avoid; }
  body[data-view="manage"] .manage-cols > .card.user { column-span: all; max-width: 560px; }
  body[data-view="staff"] .tw-preview { max-width: 760px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .proj-card, .item, .staff-row, .batch, .task, .sec-row, .mini-card, .stat, .act { transition: box-shadow .15s, transform .15s; }
  .item:hover, .proj-card:hover, .staff-row:hover, .batch:hover, .mini-card:hover { box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .35); transform: translateY(-1px); }
}

@media (min-width: 1500px) {
  body[data-view="home"] .home-cols { columns: 3 380px; }
  .view { padding-left: 40px; padding-right: 40px; }
}

/* Máy tính bảng (768–1023px): nội dung rộng hơn, vẫn dùng thanh tab dưới */
@media (min-width: 768px) and (max-width: 1023px) {
  .view { max-width: 920px; }
  body[data-view="leadlist"] .list, body[data-view="content"] .list, body[data-view="tasks"] .tlist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  body[data-view="leadlist"] .list > *, body[data-view="content"] .list > *, body[data-view="tasks"] .tlist > * { margin: 0; }
  .lead-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
}

[hidden] { display: none !important; }

/* ===== v1.8: Đăng ký tài khoản & duyệt ===== */
.login-switch { margin: 2px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.login-switch .link { font-size: 14px; font-weight: 600; }
.signup-box .big-ok { margin: 4px auto; }
.pend-row { border-color: #e11d48 !important; background: color-mix(in srgb, #e11d48 8%, var(--card)) !important; margin-top: 10px; }
.pend-h { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.pend-form .btn-row .btn { flex: 1; }

/* ===== v1.9: Tài khoản & bảo mật, quyền website, duyệt bài, điểm SEO ===== */
.note.warn { background: color-mix(in srgb, #d97706 16%, transparent); }
.note.ok { background: color-mix(in srgb, #16a34a 14%, transparent); }
.mt .hint { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.acc-head { display: flex; gap: 14px; align-items: center; }
.acc-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px !important; width: 100%; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; padding: 6px 8px; cursor: pointer; opacity: .65; }
.pw-meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin: -2px 0 6px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.pw-rules { list-style: none; margin: 0 0 10px; padding: 0; font-size: 12.5px; color: var(--muted); }
.pw-rules li::before { content: '○ '; }
.pw-rules li.ok { color: #16a34a; }
.pw-rules li.ok::before { content: '✓ '; }
.devs { display: flex; flex-direction: column; gap: 8px; }
.dev { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.dev-i { font-size: 24px; flex: none; }
.dev-b { flex: 1; min-width: 0; }
.link.red { color: #dc2626; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist li:last-child { border-bottom: 0; }
.hist li.bad b { color: #dc2626; }
.perm-view { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 14px; color: var(--muted); }
.perm-view li.ok { color: #16a34a; font-weight: 600; }
.perm-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; }
.perm-box .chk { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-weight: 400; }
.perm-box .chk input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--gold, #c9a14a); }
.perm-box .chk small { display: block; color: var(--muted); font-size: 12px; }
.sec-log { margin-top: 10px; }
.review-bar { border: 2px solid #d97706; }
.review-bar p { margin: 0 0 10px; }
.slug-wrap { display: flex; align-items: center; gap: 4px; }
.slug-wrap small { color: var(--muted); white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.slug-wrap input { flex: 1; min-width: 0; }
.seo-check { margin: 0 0 10px; }
.seo-score { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.seo-score b { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: #fff; background: var(--c); flex: none; }
.seo-score span { font-weight: 700; }
.seo-score small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.seo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.seo-list li.ok { color: #16a34a; }
.seo-list li.no { color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 600; text-decoration: none; color: inherit; font-size: 14px; }
.qbtn span { font-size: 26px; }
.tip ul { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
@media (min-width: 1024px) { .seo-list { grid-template-columns: 1fr 1fr; } }
.radio input[type=radio] { flex: none; width: 18px !important; height: 18px; padding: 0 !important; margin: 3px 0 0 !important; }

/* ===== v2.0: Chat nội bộ & chat khách trên website ===== */
.tabs a { position: relative; }
.tcnt { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #e11d48; color: #fff; font-size: 10.5px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
.side-nav .tcnt { position: static; margin-left: auto; }
.side-nav em[data-live-count] { margin-left: auto; font-style: normal; background: #e11d48; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.cnt { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e11d48; color: #fff; font-size: 11.5px; font-style: normal; font-weight: 700; display: inline-grid; place-items: center; }
.cnt[hidden], .tcnt[hidden] { display: none; }
.chat-seg { margin-bottom: 10px; }
.chat-seg a { display: flex; align-items: center; justify-content: center; gap: 6px; }
.chat-search input, .live-tools input, .live-tools select, .msearch { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 15px; box-sizing: border-box; }
.chat-search { margin-bottom: 10px; }
.live-tools { display: flex; gap: 8px; margin: 10px 0; }
.live-tools select { width: auto; max-width: 45%; border-radius: 12px; }
.people { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.people::-webkit-scrollbar { display: none; }
.pp { flex: none; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: var(--text); cursor: pointer; padding: 0; }
.pp small { font-size: 12px; max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cav { position: relative; flex: none; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-2, #e9d9a6), var(--gold)); color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.cav img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cav.cav-group { background: linear-gradient(135deg, #0b2a20, #1d5a44); color: #fff; font-size: 22px; }
.cav.cav-live { background: linear-gradient(135deg, #0891b2, #0e7490); color: #fff; font-size: 22px; }
.cav i.on { position: absolute; right: 0; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2px solid var(--card); }
.cav-md { width: 54px; height: 54px; } .cav-sm { width: 40px; height: 40px; font-size: 14px; } .cav-xs { width: 28px; height: 28px; font-size: 11px; } .cav-xxs { width: 16px; height: 16px; font-size: 8px; } .cav-lg { width: 84px; height: 84px; font-size: 28px; }
.cav-xs i.on { width: 9px; height: 9px; border-width: 1.5px; }
.cav.ghost { background: none; }
.clist { display: flex; flex-direction: column; gap: 2px; }
.citem { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 14px; text-decoration: none; color: inherit; background: none; border: 0; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.citem:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crow { display: flex; align-items: center; gap: 6px; justify-content: space-between; min-width: 0; }
.crow b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.crow time { flex: none; font-size: 12px; color: var(--muted); }
.cprev { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem.unread b, .citem.unread .cprev { font-weight: 700; color: var(--text); }
.citem.unread time { color: #e11d48; font-weight: 600; }
.mpick { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.mp { display: flex !important; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; font-weight: 400 !important; }
.mp[hidden] { display: none !important; }
.mp input { width: 20px !important; height: 20px; flex: none; margin: 0 !important; accent-color: var(--green-2); }
.mp span b { display: block; font-size: 15px; } .mp span small { color: var(--muted); font-size: 12px; }
.mp:has(input:checked) { background: color-mix(in srgb, var(--gold) 12%, transparent); }

/* Màn hình trò chuyện */
body[data-view="chatconv"] .view { padding: 0; max-width: none; }
body[data-view="chatconv"] .tabs { display: none; }
.top h1 .ch-title { display: block; overflow: hidden; text-overflow: ellipsis; }
.top h1 .ch-sub { display: block; font-size: 11.5px; font-weight: 400; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.chat { position: relative; display: flex; flex-direction: column; height: calc(100dvh - 56px - var(--safe-top)); max-width: 900px; margin: 0 auto; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 3px; overscroll-behavior: contain; }
.chat-msgs > .loading, .chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty .cav { margin: 0 auto 8px; }
.more-old { align-self: center; margin: 4px 0 10px; font-size: 13px; }
.mday { text-align: center; margin: 12px 0 8px; }
.mday span { font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--text) 6%, transparent); padding: 3px 12px; border-radius: 999px; }
.msys { align-self: center; text-align: center; max-width: 85%; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.mrow { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.mrow.first { margin-top: 8px; }
.mrow.me { justify-content: flex-end; }
.mcol { display: flex; flex-direction: column; max-width: min(78%, 560px); min-width: 0; }
.mrow.me .mcol { align-items: flex-end; }
.mname { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 2px 10px; }
.mb { position: relative; padding: 8px 12px 5px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); font-size: 15.5px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mrow.me .mb { background: linear-gradient(135deg, #0f3a2c, #1d5a44); color: #fff; border-color: transparent; }
.mrow.them .mb { border-bottom-left-radius: 6px; } .mrow.me .mb { border-bottom-right-radius: 6px; }
.mb p { margin: 0; white-space: normal; }
.mb a { color: inherit; text-decoration: underline; }
.mb time { display: block; text-align: right; font-size: 10.5px; opacity: .6; margin-top: 2px; }
.mb.mb-img { padding: 3px; background: none; border: 0; }
.mb.mb-img time { position: absolute; right: 10px; bottom: 8px; color: #fff; opacity: .95; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.mimg { display: block; max-width: 100%; max-height: 320px; border-radius: 14px; object-fit: cover; cursor: zoom-in; margin-bottom: 3px; }
.mfile { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none !important; color: inherit; margin: 2px 0 4px; min-width: 200px; }
.mrow.me .mfile { background: rgba(255,255,255,.12); }
.mfile .fi { font-size: 28px; flex: none; }
.mfile b { display: block; font-size: 14px; word-break: break-all; }
.mfile small { display: block; font-size: 12px; opacity: .75; }
section .mfile { margin-bottom: 6px; }
.mquote { border-left: 3px solid var(--gold); padding: 3px 8px; margin: 2px 0 6px; border-radius: 4px; background: color-mix(in srgb, var(--text) 6%, transparent); font-size: 13px; }
.mrow.me .mquote { background: rgba(255,255,255,.12); }
.mquote b { display: block; font-size: 12px; }
.mquote span { display: block; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.mdel { font-style: italic; opacity: .65; }
.mrx { display: flex; gap: 3px; margin: -6px 8px 0; position: relative; z-index: 1; }
.mrx span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; font-size: 13px; line-height: 20px; }
.mrx span.me { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, var(--card)); }
.mrow.sending { opacity: .6; } .mrow.failed .mb { outline: 2px solid #e11d48; }
.mrow.flash .mb { animation: flash 1.5s ease; }
.mseen { align-self: flex-end; display: flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); margin: 2px 4px 4px; }
.mseen span { margin-left: 4px; }
.chat-typing { padding: 0 16px 4px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chat-typing[hidden] { display: none; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: cdots 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cdots { 0%,60%,100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--card); font-size: 13px; }
.reply-bar[hidden] { display: none; }
.reply-bar div { flex: 1; min-width: 0; border-left: 3px solid var(--gold); padding-left: 8px; }
.reply-bar b { display: block; } .reply-bar span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar button { border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 8px 8px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; padding: 10px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; line-height: 1.35; }
.composer textarea:focus { outline: none; border-color: var(--gold); }
.cbtn { flex: none; width: 40px; height: 42px; border: 0; background: none; font-size: 21px; cursor: pointer; border-radius: 50%; }
.csend { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--gold-2, #e9d9a6), var(--gold)); color: var(--green); font-size: 18px; font-weight: 700; cursor: pointer; }
.drop-hint { position: absolute; inset: 8px; border: 3px dashed var(--gold); border-radius: 18px; background: color-mix(in srgb, var(--gold) 14%, var(--bg)); display: grid; place-items: center; font-weight: 700; color: var(--green-2); z-index: 5; pointer-events: none; }
.drop-hint[hidden] { display: none; }
.msheet { padding-top: 12px; }
.rx-pick { display: flex; justify-content: space-around; padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.rx-pick button { font-size: 28px; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 50%; transition: transform .15s; }
.rx-pick button:active { transform: scale(1.3); }
.sact { display: block; width: 100%; text-align: left; padding: 12px 6px; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); text-decoration: none; cursor: pointer; border-radius: 10px; }
.sact:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.sact.red { color: #dc2626; }
.lbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom)); }
.lbox img { max-width: 100%; max-height: calc(100% - 60px); object-fit: contain; }
.lbox-bar { display: flex; gap: 12px; margin-top: 12px; }
.lbox-bar a, .lbox-bar button { color: #fff; background: rgba(255,255,255,.15); border: 0; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; }
.cinfo { text-align: center; }
.cinfo .cav { margin: 0 auto 8px; }
.cinfo h2 { justify-content: center; margin: 0; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 4px; }
.mgrid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.mlist2 .citem { padding: 8px 4px; cursor: default; }
/* Chat khách web */
.live-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); font-size: 14px; }
.lv-info { flex: 1 1 260px; min-width: 0; display: grid; gap: 2px; }
.lv-info a { color: var(--green-2); }
.lv-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.warn-t { color: #e11d48; font-weight: 600; }
.agents-on { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; }
.agents-on .ag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); opacity: .65; }
.agents-on .ag.on { opacity: 1; background: color-mix(in srgb, #22c55e 15%, transparent); }
.ag-list { max-height: 50vh; overflow-y: auto; }
@media (min-width: 1024px) {
  body[data-view="chatconv"] .view { grid-area: view; }
  .chat { height: calc(100vh - 57px); }
  .mcol { max-width: 62%; }
}
.mimg { max-width: min(100%, 380px); }

/* v2.0.1: Avatar luôn tròn (kiểu Zalo) */
.cav { aspect-ratio: 1 / 1; box-sizing: border-box; }
.cav img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; border-radius: 50%; object-fit: cover; object-position: center top; display: block; }
.cav > span { position: relative; z-index: 0; }
.cav i.on { z-index: 1; }
.cav-xxs { box-shadow: 0 0 0 1.5px var(--bg); }
.acc-head img, .side-user img, .user img { aspect-ratio: 1 / 1; object-fit: cover; object-position: center top; border-radius: 50%; }

/* ===== v2.1: Cập nhật hệ thống ===== */
.sys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sys-grid div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.sys-grid small { display: block; color: var(--muted); font-size: 12px; }
.sys-grid b { font-size: 18px; }
.upd-pick { display: block; margin: 0; }
.upd-pick .btn { cursor: pointer; }
.upd-wait { display: flex; gap: 10px; align-items: center; padding: 14px 4px; font-size: 14px; }
.upd-pre { margin-top: 12px; display: grid; gap: 10px; }
.upd-ver { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.upd-ver > div { background: var(--bg); border-radius: 12px; padding: 10px; }
.upd-ver .new { background: color-mix(in srgb, var(--gold) 18%, var(--card)); border: 1px solid var(--gold); }
.upd-ver small { display: block; color: var(--muted); font-size: 12px; }
.upd-ver b { display: block; font-size: 22px; }
.upd-ver > span { font-size: 22px; color: var(--gold); }
.clog { display: grid; gap: 8px; }
.clog-v ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 2px; }
.upd-go { margin-top: 4px; }
.upd-steps { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.upd-steps li { color: var(--muted); padding-left: 26px; position: relative; }
.upd-steps li::before { content: '○'; position: absolute; left: 4px; }
.upd-steps li.doing { color: var(--text); font-weight: 600; }
.upd-steps li.doing::before { content: '⏳'; left: 0; }
.upd-steps li.done { color: #16a34a; }
.upd-steps li.done::before { content: '✓'; }
.upd-done { text-align: center; padding-top: 6px; }
.upd-done h3 { margin: 6px 0 0; }
.upd-log { text-align: left; font-size: 13.5px; padding-left: 18px; display: grid; gap: 3px; }
.bk-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bk-row:last-child { border-bottom: 0; }
.rescue { display: flex; gap: 8px; }
.rescue input { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 13px; }

/* ===== v2.2: Trợ lý SEO ===== */
.seo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.seo-actions .chip { font-size: 13px; padding: 7px 11px; cursor: pointer; background: color-mix(in srgb, var(--gold) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 999px; color: var(--text); font-weight: 600; }
.seo-g { border-top: 1px solid var(--line); padding: 6px 0; }
.seo-g summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; padding: 4px 0; font-size: 14.5px; }
.seo-g summary::-webkit-details-marker { display: none; }
.seo-g summary span { font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.seo-g summary span.ok { color: #16a34a; background: color-mix(in srgb, #16a34a 12%, transparent); }
.seo-g summary span.no { color: #d97706; background: color-mix(in srgb, #d97706 12%, transparent); }
.seo-g .seo-list { margin: 4px 0 6px; grid-template-columns: 1fr !important; }
.seo-list li .link.sm { font-size: 12.5px; margin-left: 4px; text-decoration: underline; }
.gi { position: relative; }
.gq { position: absolute; right: 4px; top: 4px; max-width: calc(100% - 8px); font-size: 10.5px; font-weight: 700; line-height: 1.3; padding: 2px 6px; border-radius: 6px; color: #fff; background: rgba(0, 0, 0, .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gq:empty { display: none; }
.gq.ok { background: rgba(22, 163, 74, .85); }
.gq.bad { background: rgba(217, 119, 6, .92); }
.wtool { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0 -2px; }
.wtool button { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px; padding: 5px 9px; font-size: 13px; cursor: pointer; }
.wtool .wcount { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.wtool { position: sticky; top: 0; z-index: 3; background: var(--card); padding: 6px 0; }
.wtool button:disabled { opacity: .6; }
.wtool button { min-height: 36px; min-width: 36px; }
/* Chia sẻ bài viết */
.share-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.share-btns button { flex: 1 1 calc(33% - 6px); min-width: 92px; border: 0; border-radius: 10px; padding: 10px 8px; font-weight: 600; font-size: 13px; line-height: 1.2; color: #fff; cursor: pointer; background: #475569; }
.share-btns .sh-fb { background: #1877f2; } .share-btns .sh-zalo { background: #0068ff; } .share-btns .sh-x { background: #111; }
.share-btns .sh-in { background: #0a66c2; } .share-btns .sh-tg { background: #229ed9; } .share-btns .sh-mail { background: #64748b; }
.share-btns .sh-copy, .share-btns .sh-native { background: var(--bg); color: var(--text); border: 1px solid var(--line); }

/* ===== v2.2: Xem trước trực tiếp & Thiết kế nâng cao ===== */
.pv { display: none; position: fixed; z-index: 30; flex-direction: column; background: color-mix(in srgb, var(--text) 6%, var(--bg)); }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.pv-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.pv-seg button { border: 0; background: none; padding: 5px 10px; border-radius: 999px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.pv-seg button.on { background: var(--green); color: var(--gold-2); font-weight: 600; }
.pv-st { margin-left: auto; font-size: 12px; color: var(--muted); }
.pv-st.busy { color: #d97706; } .pv-st.err { color: #dc2626; }
.pv-ic { border: 1px solid var(--line); background: var(--bg); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; text-decoration: none; color: var(--text); cursor: pointer; font-size: 14px; }
.pv-stage { flex: 1; min-height: 0; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; padding: 12px; }
.pv-wrap { position: relative; flex: none; }
.pv-dev { position: absolute; left: 0; top: 0; transform-origin: top left; background: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.pv-dev.pv-phone { border-radius: 34px; overflow: hidden; outline: 10px solid #111; outline-offset: 0; }
.pv-dev.pv-desk { border-radius: 8px; overflow: hidden; }
.pv-dev iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pv-note { margin: 0; padding: 6px 12px 10px; font-size: 12px; color: var(--muted); text-align: center; }
.pv-fab { position: fixed; right: 14px; bottom: calc(132px + var(--safe-bottom)); z-index: 25; border: 0; border-radius: 999px; padding: 11px 16px; background: var(--green); color: var(--gold-2); font: inherit; font-weight: 700; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); cursor: pointer; }
body.pv-open .pv { display: flex; inset: 0; z-index: 60; }
body.pv-open .pv-fab { display: none; }
@media (min-width: 1180px) {
  body.with-pv { --edw: min(600px, calc(100vw - 672px)); }
  body.with-pv .view { max-width: var(--edw); margin: 0 0 0 16px; }
  body.with-pv .pv { display: flex; right: 0; bottom: 0; left: calc(252px + var(--edw) + 32px); border-left: 1px solid var(--line); }
  body.with-pv .pv-fab { display: none; }
  .pv-fab { bottom: 20px; }
}
/* Thanh trượt */
.range-field { padding: 6px 0 10px; }
.rf-top { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; }
.rf-top span { flex: 1; }
.rf-top b { font-size: 13px; color: var(--green-2); background: color-mix(in srgb, var(--gold) 16%, transparent); padding: 1px 8px; border-radius: 999px; }
.range-field.is-default .rf-top b { color: var(--muted); background: var(--bg); font-weight: 500; }
.range-field.is-default [data-rreset] { visibility: hidden; }
.range-field input[type=range] { width: 100%; accent-color: var(--green-2); margin: 8px 0 2px; }
.color-in input[type=color].unset { opacity: .35; }
.color-in .link.sm { font-size: 12.5px; white-space: nowrap; }

/* ===== v2.2: Khung App cố định – chỉ phần nội dung cuộn (hết nhảy thanh công cụ khi vuốt) ===== */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.boot, .login { flex: 1 1 auto; min-height: 0; height: auto; overflow-y: auto; }
.top { position: relative; flex: none; }
.view {
  flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; margin: 0; box-sizing: border-box;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: 14px max(14px, calc((100% - 760px) / 2 + 14px)) 24px;
  scroll-padding-bottom: 80px;
}
.tabs { position: relative; flex: none; left: auto; right: auto; bottom: auto; }
.sticky-save { bottom: 0; }
.pv-fab { bottom: calc(76px + var(--safe-bottom)); }
body[data-view="chatconv"] .view { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
body[data-view="chatconv"] .chat { height: 100%; flex: 1 1 auto; min-height: 0; width: 100%; }
/* Bàn phím ảo không che ô nhập */
.view input, .view textarea, .view select { scroll-margin-bottom: 90px; }
/* Chữ dài không phá vỡ bố cục */
.top h1, .crow b, .cprev, .item-body b { min-width: 0; }
.view, .card, .item-body, .cbody { overflow-wrap: anywhere; }
@media (min-width: 1024px) {
  #app { display: grid; height: 100vh; height: 100dvh; min-height: 0; }
  .side { height: 100%; position: relative; }
  .top { position: relative; }
  .view { max-width: none; margin: 0; padding: 22px max(32px, calc(100% - 1320px + 32px)) 48px 32px; }
  body.with-pv .view { max-width: var(--edw); margin: 0 0 0 16px; padding-right: 16px; }
  body[data-view="chatconv"] .view { padding: 0; }
  .pv-fab { bottom: 20px; }
}
/* Vùng chạm & cỡ chữ tối thiểu trên điện thoại */
@media (max-width: 1023px) {
  .tcheck { min-width: 34px; min-height: 34px; }
  .link.sm, .sub-link, [data-cclear], [data-rreset] { display: inline-flex; align-items: center; min-height: 32px; }
  .kind-tag { font-size: 11px; }
  .mb time { font-size: 11px; }
  .gq { font-size: 11px; }
}
@media (min-width: 768px) and (max-width: 1023px) { .view { padding-left: max(24px, calc((100% - 920px) / 2 + 24px)); padding-right: max(24px, calc((100% - 920px) / 2 + 24px)); } }

/* ===== v2.2: Trợ lý AI & chế độ nhanh ===== */
.aiq { border: 1.5px solid color-mix(in srgb, var(--gold) 55%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 9%, var(--card)), var(--card) 60%); }
.aiq-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.aiq-ic { font-size: 22px; line-height: 1; }
.aiq-head b { display: block; font-size: 16.5px; }
.aiq-head small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.aiq-head small a { color: var(--green-2); font-weight: 600; }
.aiq textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; background: var(--bg); color: var(--text); resize: vertical; }
.aiq-photos { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.aiq-th { position: relative; width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.aiq-th img { width: 100%; height: 100%; object-fit: cover; }
.aiq-th.cover { outline: 2px solid var(--gold); }
.aiq-th i { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9.5px; font-style: normal; text-align: center; background: rgba(0,0,0,.6); color: #fff; }
.aiq-more { width: 62px; height: 62px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); color: var(--muted); font-weight: 700; }
.aiq-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.aiq-row .btn { flex: 1 1 auto; }
.btn.ai-go { background: linear-gradient(135deg, #0f3a2c, #1d5a44); color: var(--gold-2); border: 0; font-weight: 700; }
.btn.ai-go:disabled { opacity: .6; }
.aiq-res { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; }
.aiq-ok { color: #16a34a; font-weight: 600; font-size: 14.5px; }
.aiq-pv { background: var(--bg); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.aiq-pv b { display: block; font-size: 15px; } .aiq-pv p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.aiq-ch { margin: 4px 0 6px; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.aiq-foot { display: grid; gap: 6px; margin-top: 10px; }
.btn.ai-save { font-size: 16px; padding-block: 14px; }
.aiq-deep { justify-self: center; font-size: 14px; font-weight: 600; color: var(--green-2); text-decoration: underline; padding: 8px; }
.aiq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.aiq-chips .chip { font-size: 13px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.spin.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
/* Chế độ nhanh: ẩn phần chỉnh tay */
.edit-form.quick > section:not(.aiq), .edit-form.quick > .wtool, .edit-form.quick > .sticky-save, .edit-form.quick > .danger-zone, .edit-form.quick > .note, .edit-form.quick > .review-bar { display: none !important; }
.site-form.collapsed { display: none; }
.ai-changed { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 8px; background: color-mix(in srgb, var(--gold) 8%, transparent); }

/* ===== v2.2 Studio đăng bài: nhập liệu → đề xuất → kiểm tra → đăng ===== */
.ps-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; list-style: none; margin: 0 0 12px; padding: 0; counter-reset: st; }
.ps-steps li { counter-increment: st; font-size: 12px; text-align: center; color: var(--muted); padding-top: 30px; position: relative; font-weight: 600; }
.ps-steps li::before { content: counter(st); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1.5px solid var(--line); font-size: 12.5px; }
.ps-steps li::after { content: ''; position: absolute; top: 12px; left: calc(50% + 15px); right: calc(-50% + 15px); height: 2px; background: var(--line); }
.ps-steps li:last-child::after { display: none; }
.ps-steps li.on { color: var(--text); } .ps-steps li.on::before { background: #0f3a2c; color: var(--gold-2); border-color: #0f3a2c; }
.ps-steps li.done { color: #16a34a; } .ps-steps li.done::before { content: '✓'; background: #16a34a; color: #fff; border-color: #16a34a; } .ps-steps li.done::after { background: #16a34a; }
.ps-s { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.ps-s:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.ps-h { margin-bottom: 8px; } .ps-h b { display: block; font-size: 15.5px; } .ps-h small { color: var(--muted); font-size: 12.5px; }
.ps-drop { border: 2px dashed color-mix(in srgb, var(--gold) 60%, var(--line)); border-radius: 14px; padding: 14px 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; text-align: center; cursor: pointer; background: var(--bg); transition: .15s; }
.ps-drop.over { background: color-mix(in srgb, var(--gold) 16%, var(--bg)); border-color: var(--gold); }
.ps-drop b { font-size: 15px; } .ps-drop span { color: var(--muted); font-size: 13px; } .ps-drop small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.ps-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.ps-th { position: relative; width: 70px; height: 70px; border-radius: 10px; overflow: hidden; background: var(--bg); outline: 2px solid transparent; }
.ps-th.bad { outline-color: #f59e0b; }
.ps-th img { width: 100%; height: 100%; object-fit: cover; }
.ps-th i { position: absolute; left: 0; right: 0; bottom: 0; font: 600 9.5px/1.25 inherit; font-style: normal; padding: 2px 3px; background: rgba(0,0,0,.62); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-th.bad i { background: rgba(180,83,9,.88); }
.ps-th button, .ps-doc button, .ps-kc button { border: 0; background: rgba(0,0,0,.55); color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.ps-th button { position: absolute; top: 3px; right: 3px; }
.ps-doc { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 8px; max-width: 100%; height: 70px; box-sizing: border-box; }
.ps-doc > b { font-size: 22px; } .ps-doc span { font-size: 12.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ps-doc small { display: block; color: var(--muted); font-size: 11px; }
.ps-doc button { background: var(--line); color: var(--text); flex: none; }
.ps-l { display: block; font-weight: 600; font-size: 13.5px; margin: 10px 0 5px; } .ps-l small { font-weight: 400; color: var(--muted); }
.ps-kw { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; background: var(--bg); min-height: 46px; box-sizing: border-box; cursor: text; }
.ps-kw input { flex: 1 1 140px; min-width: 120px; border: 0 !important; background: transparent !important; font: inherit; font-size: 16px; padding: 4px !important; outline: 0; color: var(--text); box-shadow: none !important; }
.ps-kc { display: inline-flex; align-items: center; gap: 4px; background: #0f3a2c; color: var(--gold-2); border-radius: 999px; padding: 4px 4px 4px 10px; font-size: 13px; font-weight: 600; }
.ps-kc button { width: 20px; height: 20px; background: rgba(255,255,255,.18); }
.ps-s [data-airun] { margin-top: 10px; padding-block: 13px; font-size: 15.5px; }
.ps-sum { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.ps-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 10px; }
.ps-kpi span { background: var(--bg); border-radius: 10px; padding: 6px; text-align: center; font-size: 11.5px; color: var(--muted); }
.ps-kpi b { display: block; font-size: 19px; color: var(--c, var(--text)); }
.ps-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.ps-tabs button { flex: 1; border: 0; background: transparent; padding: 9px 4px; border-radius: 9px; font: 600 13px/1.2 inherit; color: var(--muted); cursor: pointer; min-height: 38px; }
.ps-tabs button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.ps-art { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 520px; overflow-y: auto; background: #fff; color: #1f2a24; overscroll-behavior: contain; }
.ps-cover { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; } .ps-cover.none { display: grid; place-items: center; background: #eee; color: #888; font-size: 13px; }
.ps-art h3 { font-size: 18px; margin: 12px 14px 4px; line-height: 1.3; color: #0f3a2c; } .ps-meta { margin: 0 14px; font-size: 12.5px; color: #6b7280; }
.ps-body { padding: 4px 14px 10px; font-size: 14px; line-height: 1.6; } .ps-body h2 { font-size: 15.5px; margin: 14px 0 4px; color: #0f3a2c; } .ps-body h3 { font-size: 14.5px; margin: 10px 0 4px; } .ps-body p { margin: 6px 0; } .ps-body ul { padding-left: 18px; margin: 6px 0; } .ps-body a { color: #b08d2e; }
.ps-body figure { margin: 10px 0; } .ps-body figure img { width: 100%; border-radius: 8px; display: block; } .ps-body figcaption { font-size: 11.5px; color: #6b7280; text-align: center; margin-top: 3px; }
.ps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 14px 14px; } .ps-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.ps-imgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ps-imgs li { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px; align-items: start; background: var(--bg); border-radius: 12px; padding: 6px; border-left: 4px solid var(--line); }
.ps-imgs li.r-cover { border-left-color: var(--gold); } .ps-imgs li.r-body { border-left-color: #16a34a; } .ps-imgs li.r-gallery { border-left-color: #3b82f6; } .ps-imgs li.r-skip { opacity: .62; border-left-color: #dc2626; }
.ps-imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.ps-imgs select { width: 100%; font: 600 13.5px inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); min-height: 36px; }
.ps-imgs small { display: block; font-size: 11.5px; color: var(--muted); margin: 3px 0; } .ps-imgs small.bad { color: #b45309; }
.ps-imgs input { width: 100%; box-sizing: border-box; font-size: 13px !important; padding: 6px 8px !important; border-radius: 8px; border: 1px solid var(--line); background: var(--card); min-height: 34px; }
.ps-mv { display: grid; gap: 4px; } .ps-mv button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 11px; color: var(--text); }
.ps-g { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-family: Arial, sans-serif; }
.ps-g small { color: #202124; font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ps-g b { display: block; color: #1a0dab; font-size: 17px; font-weight: 400; margin: 3px 0; } .ps-g p { margin: 0; color: #4d5156; font-size: 13px; line-height: 1.45; }
.ps-ch { margin: 10px 0 0; font-size: 13px; } .ps-ch summary { cursor: pointer; color: var(--green-2); font-weight: 600; } .ps-ch ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.ps-fb { display: flex; gap: 6px; margin: 10px 0 4px; } .ps-fb input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px; background: var(--bg); color: var(--text); }
.ps-done { font-size: 14px; color: #16a34a; font-weight: 600; }
.pc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.pc-ring { --p: 0; width: 66px; height: 66px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.pc-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--card); }
.pc-ring b { position: relative; font-size: 21px; color: var(--c); }
.pc-head > div:last-child b { display: block; font-size: 15px; } .pc-head small { display: block; color: var(--muted); font-size: 12.5px; margin: 2px 0 6px; }
.pc-sum { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; margin: 6px 0 8px; }
.pc-g { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; background: var(--card); }
.pc-g summary { display: grid; grid-template-columns: 1fr 70px 30px; gap: 8px; align-items: center; padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; min-height: 24px; }
.pc-g summary::-webkit-details-marker { display: none; }
.pc-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; } .pc-bar i { display: block; height: 100%; border-radius: 3px; }
.pc-g summary b { text-align: right; font-size: 14px; }
.pc-g ul { list-style: none; margin: 0; padding: 0 12px 10px; display: grid; gap: 6px; }
.pc-g li { display: grid; grid-template-columns: 20px 1fr auto; gap: 6px; align-items: start; font-size: 13.5px; line-height: 1.4; }
.pc-g li i { font-style: normal; font-weight: 700; text-align: center; }
.pc-g li.lv-ok { color: var(--muted); } .pc-g li.lv-ok i { color: #16a34a; } .pc-g li.lv-warn i { color: #d97706; } .pc-g li.lv-err i { color: #dc2626; } .pc-g li.lv-err span { font-weight: 600; }
.pc-g li .link { padding: 2px 6px; font-weight: 700; color: var(--green-2); }
@media (min-width: 900px) { .ps-art { max-height: 600px; } }
.edit-form.quick { padding-bottom: 64px; }

/* ===== v2.2 Trang chỉnh giao diện: chỉnh sửa → AI đề xuất → kiểm tra → đăng ===== */
.ss-top { padding-bottom: 8px; } .ss-top .ps-steps { margin-bottom: 6px; } .ss-tip { margin: 0; text-align: center; }
.ss-h { margin: 14px 4px 8px; } .ss-h.in { margin: 0 0 10px; } .ss-h b { display: block; font-size: 15.5px; } .ss-h small { color: var(--muted); font-size: 12.5px; }
.ss-more { margin-bottom: 10px; } .ss-more summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--green-2); padding: 6px 0; } .ss-more .aiq-chips { margin-top: 6px; }
.ss-cnt { font-size: 14px; margin-bottom: 4px; }
.ss-props { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.ss-pick { display: grid !important; grid-template-columns: 24px 1fr; gap: 8px; align-items: start; background: var(--bg); border-radius: 10px; padding: 8px 10px; margin: 0 !important; cursor: pointer; font-weight: 400 !important; }
.ss-pick input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #0f3a2c; }
.ss-pick b { display: block; font-size: 13.5px; } .ss-pick small { display: block; font-size: 12px; color: var(--muted); margin: 1px 0 4px; }
.ss-diff { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 13px; }
.ss-diff .old { color: #b91c1c; text-decoration: line-through; opacity: .8; } .ss-diff .new { color: #15803d; font-weight: 600; } .ss-diff .arr { color: var(--muted); }
.ss-diff .old i, .ss-diff .new i { font-weight: 400; }
.ss-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }
.ss-im { width: 54px; height: 36px; object-fit: cover; border-radius: 4px; vertical-align: middle; }
.pc-g li.lv-chg i { color: var(--gold); } .pc-g li.lv-chg { color: var(--text); }

/* ===== v2.3 Trợ lý thông minh miễn phí ===== */
.ps-titles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.ps-titles small { color: var(--muted); font-size: 12.5px; width: 100%; }
.ps-titles .chip { text-align: left; font-size: 13px; line-height: 1.35; padding: 7px 11px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; white-space: normal; }
.ps-titles .chip.on { border-color: #0f3a2c; background: #0f3a2c; color: var(--gold-2); }
.ps-soc { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14.5px; line-height: 1.5; background: var(--bg); color: var(--text); margin-bottom: 8px; }
.smart-lead h2 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sl-next { font-weight: 600; font-size: 15px; margin: 4px 0; padding: 10px 12px; background: color-mix(in srgb, var(--gold) 12%, var(--bg)); border-radius: 10px; }
.sl-tpl { margin-top: 8px; } .sl-tpl summary { cursor: pointer; font-weight: 600; color: var(--green-2); padding: 6px 0; font-size: 14px; }
.sl-m { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-top: 8px; }
.sl-m.rec { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); }
.sl-m b { font-size: 13.5px; } .sl-m b small { color: #b45309; font-weight: 600; margin-left: 4px; }
.sl-m textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; font-size: 14.5px; margin: 6px 0; background: var(--bg); color: var(--text); resize: vertical; }
.sl-b { display: flex; flex-wrap: wrap; gap: 6px; } .sl-b .btn { flex: 1 1 auto; text-align: center; }
.tmp { font-weight: 700; } .tmp-hot { color: #dc2626; } .tmp-warm { color: #d97706; } .tmp-cold { color: #2563eb; }
.smart-today .item .small:not(.muted) { font-weight: 600; color: var(--text); margin: 2px 0; }
.free-list { margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 6px; font-size: 14px; }

/* ===== v2.4 Phòng ban, cấp bậc, đội, đánh giá ===== */
.org-legend { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.org-h { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.org-name { flex: 1; min-width: 0; font: 700 16px/1.3 inherit; padding: 9px 11px !important; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.org-mv { display: inline-flex; gap: 4px; flex: none; }
.org-mv button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font-size: 12px; }
.org-mv button.red { color: #dc2626; }
.org-sel { display: grid !important; grid-template-columns: 54px 1fr; gap: 8px; align-items: center; margin: 0 0 8px !important; }
.org-sel .badge { justify-self: start; }
.org-sel select, .org-add { width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 6px 10px; font-size: 15px; }
.org-add { margin-top: 6px; border-style: dashed; }
.org-mem { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.org-mem li { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 10px; padding: 6px 8px; }
.org-mem .num { width: 22px; text-align: center; font-weight: 700; color: var(--muted); font-size: 13px; }
.op { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.op img, .op i { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.op i { display: grid; place-items: center; background: var(--gold); color: #0f3a2c; font-style: normal; font-weight: 700; font-size: 13px; }
.op b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.org-d h2 { justify-content: flex-start; gap: 8px; }
.team-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.team-top select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 6px 10px; font-size: 15px; }
.hold-n { font-size: 15px; margin: 4px 0 10px; } .hold-n b { font-size: 24px; color: #b45309; }
.dist-form { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.num-in { width: 70px !important; display: inline-block !important; padding: 4px 6px !important; }
.tm-h { display: flex; gap: 10px; align-items: center; } .tm-h > div { flex: 1; min-width: 0; }
.tm.off { opacity: .55; }
.ev-b { display: grid; place-items: center; min-width: 58px; padding: 4px 6px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-weight: 800; font-size: 19px; line-height: 1.1; text-align: center; }
.ev-b small { font-size: 10.5px; font-weight: 600; }
.ev-b.none { --c: #6b7280; font-size: 13px; }
.tm-m { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 10px 0 8px; }
.tm-m.big { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tm-m span { background: var(--bg); border-radius: 8px; padding: 6px 2px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.25; }
.tm-m b { display: block; font-size: 17px; color: var(--text); }
.tm-m .red b { color: #dc2626; } .tm-m .g b { color: #16a34a; }
.tm-a { display: flex; gap: 6px; } .tm-a .btn { flex: 1; text-align: center; }
@media (max-width: 420px) { .tm-m { grid-template-columns: repeat(3, 1fr); } }
.ev-c { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ev-c b { font-size: 14.5px; } .ev-c small { display: block; color: var(--muted); font-size: 12px; }
.stars { display: flex; align-items: center; gap: 2px; }
.stars button { font-size: 28px; line-height: 1; border: 0; background: none; color: var(--line); cursor: pointer; padding: 2px 3px; min-width: 38px; min-height: 38px; }
.stars button.on { color: #f59e0b; }
.stars em { font-size: 11.5px; color: var(--muted); margin-left: 6px; font-style: normal; }
.ev-total { display: flex; align-items: baseline; gap: 10px; margin: 12px 0; font-size: 14px; } .ev-total b { font-size: 26px; }
.ev-h { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); } .ev-h:last-child { border: 0; }
.ev-h p { margin: 4px 0 0; }
.team-link { margin-bottom: 10px; }
.tm-h .avatar, .spick .avatar { flex: none; width: 44px; height: 44px; }
.tm-h .ev-b { flex: none; }
.org-sel { grid-template-columns: 52px 1fr; }

/* ===== v2.4 Studio dự án/video, kiểm tra hệ thống ===== */
.rv-pv { margin-bottom: 10px; }
.rv-full summary { cursor: pointer; font-weight: 600; color: var(--green-2); font-size: 13.5px; padding: 6px 0; }
.ps-art.sm { max-height: 380px; }
.ss-struct { font-weight: 600; }
.rv-ths { display: flex; gap: 4px; flex-wrap: wrap; }
.rv-th { position: relative; width: 58px; height: 58px; border-radius: 8px; overflow: hidden; display: inline-block; }
.rv-th img { width: 100%; height: 100%; object-fit: cover; }
.rv-th i { position: absolute; left: 0; right: 0; bottom: 0; font: 600 9px/1.3 inherit; font-style: normal; background: rgba(0,0,0,.6); color: #fff; text-align: center; }
.rv-th.bad i { background: rgba(180,83,9,.9); }
.rv-vid { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0f2a20; color: #fff; }
.rv-vt { position: relative; aspect-ratio: 16/9; } .rv-vt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-vt .yt-play { position: absolute; inset: 0; margin: auto; width: 56px; height: 40px; border-radius: 10px; background: rgba(220,38,38,.92); display: grid; place-items: center; font-size: 18px; }
.rv-vid b { display: block; padding: 10px 12px 2px; font-size: 15px; color: var(--gold-2); } .rv-vid p { margin: 0; padding: 0 12px 12px; font-size: 13px; opacity: .85; }
.hc-empty .hc-big { font-size: 46px; } .hc-empty h2 { justify-content: center; }
.hc-head .btn { margin-top: 10px; }
.hc-g li { grid-template-columns: 20px 1fr; } .hc-g li .btn { grid-column: 2; justify-self: start; margin-top: 2px; }
.hc-l { font-weight: 600; display: block; } .pc-g li.lv-ok .hc-l { font-weight: 500; }
.hc-d { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-word; }
.hc-f { display: block; color: var(--text); font-size: 12.5px; margin-top: 3px; background: var(--bg); border-radius: 8px; padding: 5px 8px; }
.hc-plan ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }

/* ===== v2.4 Bộ icon nét mảnh ===== */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex: none; }
.tabs a span .ic { width: 23px; height: 23px; }
.tabs a span:has(.ic) { filter: none; opacity: .62; }
.tabs a.active span:has(.ic) { opacity: 1; color: var(--green-2); }
.side-nav a span .ic { width: 20px; height: 20px; }
.side-nav a span:has(.ic) { opacity: .85; }
.side-nav a.active span:has(.ic) { opacity: 1; }
.side-foot a .ic { width: 16px; height: 16px; margin-right: 4px; }
.mi:has(.ic) { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 14%, var(--bg)); color: #8a6a1f; font-size: 0; flex: none; }
.mi .ic { width: 19px; height: 19px; }
.red .mi:has(.ic), a.red .mi:has(.ic) { background: color-mix(in srgb, #dc2626 10%, var(--bg)); color: #dc2626; }
.sec-ic:has(.ic) { color: var(--green-2); background: color-mix(in srgb, var(--green-2) 9%, var(--bg)); }
.sec-ic .ic { width: 21px; height: 21px; }
.act .act-ic { display: grid; place-items: center; width: 30px; height: 30px; color: var(--green-2); font-style: normal; }
.act .act-ic .ic { width: 22px; height: 22px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mi:has(.ic) { color: var(--gold-2); } }
.bell .ic { width: 22px; height: 22px; color: var(--gold-2); } @media (min-width: 1024px) { .bell .ic { color: var(--green-2); } }

/* ===== v2.4 Rà soát cỡ chữ & vùng chạm tối thiểu (12 cỡ màn hình) ===== */
.chart .bar small, .bar small { font-size: 11px; }
.kind-tag { font-size: 11px; }
.ev-b small { font-size: 11px; }
.card h2 > a, h3.sub > a, .sub-link { display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; }
.seg.mini button { min-height: 32px; padding-inline: 10px; }
.gctl button { min-width: 32px; min-height: 32px; }
.edit-info, .link.sm { min-height: 30px; }
@media (max-width: 767px) { .card h2 > a { min-height: 36px; } .seg.mini button { min-height: 34px; } }

/* ===== v2.3.1: iPhone (mở từ màn hình chính) – 100dvh bị hụt chiều cao thanh trạng thái → thanh menu dưới bị đẩy lên / nhảy.
   Ghim khung App vào đúng 4 cạnh màn hình thay vì tính theo chiều cao. ===== */
#app { position: fixed; inset: 0; height: auto !important; min-height: 0; width: auto; }
.tabs { padding-bottom: max(var(--safe-bottom), 6px); }
@media (min-width: 1024px) { #app { position: fixed; inset: 0; } }

/* ===== v2.4.0 Tự căn theo thiết bị ===== */
/* iPhone/iPad: khoá hẳn trang gốc – chỉ vùng nội dung được cuộn → thanh menu dưới không còn nảy/nhảy khi vuốt hay khi đóng bàn phím. */
html.dev-ios, html.dev-ios body, html.dev-ipados, html.dev-ipados body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
.tabs, .top { touch-action: manipulation; }
.view { overscroll-behavior: contain; }
/* Màn hình rất nhỏ (iPhone SE, Android < 350px) */
.dev-xs .view { padding-left: 10px; padding-right: 10px; }
.dev-xs .tabs a { font-size: 11px; letter-spacing: -.01em; }
.dev-xs .tabs a span .ic { width: 21px; height: 21px; }
.dev-xs .top h1 { font-size: 16px; }
.dev-xs .card { padding: 12px; }
.dev-xs .kpis { gap: 6px; }
/* Máy tính bảng dọc */
@media (max-width: 1023px) { .dev-tablet .view { padding-left: max(18px, calc((100% - 860px) / 2 + 18px)); padding-right: max(18px, calc((100% - 860px) / 2 + 18px)); } }
/* Mở trong Zalo/Facebook: chừa chỗ cho thanh công cụ của ứng dụng chủ */
.dev-inapp .tabs { padding-bottom: max(var(--safe-bottom), 10px); }
.hc-devinfo { display: grid; gap: 2px; font-size: 13.5px; } .hc-devinfo b { font-size: 15px; } .hc-devinfo span { color: var(--muted); }
.hc-mine { margin: 8px 0; padding-left: 18px; color: #b45309; font-size: 13.5px; }

/* ===== v2.4.1: iPhone mở từ màn hình chính – iOS báo chiều cao hụt phần tai thỏ → bù đúng chiều cao màn hình thật ===== */
html.dev-iosgap, html.dev-iosgap body { bottom: auto !important; height: var(--app-full) !important; }
html.dev-iosgap #app { bottom: auto !important; height: var(--app-full) !important; }
.hc-note { color: #b45309 !important; font-size: 12.5px; }

/* ===== v2.4.2: Thanh trạng thái iPhone dạng nền tối (không trong suốt) → iOS cấp đủ chiều cao tới sát đáy.
   Nền trang trùng màu thanh menu để mọi khe hở (nếu có) không lộ dải màu khác. ===== */
html { background: var(--card); }
html.dev-iosgap, html.dev-iosgap body, html.dev-iosgap #app { height: auto !important; bottom: 0 !important; }

/* ===================== v2.5.1: Tab Quản lý theo nhóm (mở rộng có hiệu ứng) */
.mg-search { margin: 4px 0 12px; }
.mg-search input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 14px; font: inherit; font-size: 15px; }
.mg { padding: 0; margin-bottom: 10px; overflow: hidden; transition: box-shadow .25s; }
.mg.open { box-shadow: 0 6px 22px -14px rgba(0, 0, 0, .35); }
.mg-h { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 60px; }
.mg-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 16%, var(--card)); color: var(--green); font-size: 20px; transition: background .25s, color .25s; }
.mg-ic .ic { width: 21px; height: 21px; }
.mg.open .mg-ic { background: var(--green); color: var(--gold-2); }
.mg-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mg-t b { font-size: 15.5px; } .mg-t small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.mg-badge { font-style: normal; display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 11.5px; text-align: center; vertical-align: 1px; }
.mg-n { flex: none; font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 2px 8px; }
.mg-chev { flex: none; display: grid; transition: transform .28s cubic-bezier(.2, .8, .2, 1); color: var(--muted); }
.mg-chev .ic { width: 18px; height: 18px; }
.mg.open .mg-chev { transform: rotate(90deg); color: var(--green); }
.mg-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .8, .2, 1); }
.mg.open .mg-body { grid-template-rows: 1fr; }
.mg-body > nav { min-height: 0; overflow: hidden; margin: 0; border-top: 1px solid transparent; transition: border-color .3s; }
.mg.open .mg-body > nav { border-top-color: var(--line); }
.mg-body .mlist a { opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
.mg.open .mg-body .mlist a { opacity: 1; transform: none; }
.mg.open .mg-body .mlist a:nth-child(2) { transition-delay: .03s; } .mg.open .mg-body .mlist a:nth-child(3) { transition-delay: .06s; } .mg.open .mg-body .mlist a:nth-child(4) { transition-delay: .09s; } .mg.open .mg-body .mlist a:nth-child(n+5) { transition-delay: .12s; }
.txt-warn { color: #d97706; }
@media (prefers-reduced-motion: reduce) { .mg-body, .mg-chev, .mg-body .mlist a { transition: none; } }
@media (min-width: 900px) { .view > .mg-search, .view > .mg { max-width: 760px; margin-left: auto; margin-right: auto; } }

/* ===================== v2.5.1: Quản lý tài khoản */
.acc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.acc-stats button { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 4px; display: grid; gap: 2px; text-align: center; color: inherit; font: inherit; cursor: pointer; }
.acc-stats button strong { font-size: 20px; } .acc-stats button span { font-size: 11.5px; color: var(--muted); }
.acc-stats button.warn strong { color: #d97706; } .acc-stats button.active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.acc-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.acc-tools input, .acc-tools select { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14.5px; min-width: 0; }
.chips .chip em { font-style: normal; opacity: .7; margin-left: 2px; }
.acc-list { padding: 4px 0; }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.acc-row:last-child { border-bottom: 0; } .acc-row.off { opacity: .6; }
.acc-b { flex: 1; min-width: 0; display: grid; gap: 3px; }
.acc-n { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .acc-n b { font-size: 15px; }
.acc-m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
/* v2.5.1: chia sẻ gọn + bình luận trong App */
.share-btns .sh-main { background: var(--green); color: var(--gold-2); }
.share-btns button { min-height: 44px; font-size: 14px; }
.share-stats { display: flex; gap: 16px; margin: -2px 0 10px; font-size: 14px; }
.cmt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cmt-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cmt-list li.child { margin-left: 22px; }
.cmt-list li .row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cmt-list li p { margin: 4px 0; }
.cmt-list .link.red { color: var(--danger); background: none; border: 0; padding: 8px 10px 8px 0; min-height: 36px; cursor: pointer; }
.acc-log { margin-top: 14px; padding: 0; }
.acc-log summary { padding: 14px; cursor: pointer; font-weight: 600; list-style: none; display: grid; gap: 2px; }
.acc-log summary small { font-weight: 400; font-size: 12.5px; }
.acc-log > div { padding: 0 14px 14px; }
.alog { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alog li { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.alog li.err { border-color: color-mix(in srgb, #d97706 45%, var(--line)); }
/* v2.5.1: Email gửi tự động (SMTP) */
.mail-status { border-left: 4px solid #d97706; }
.mail-status.ok { border-left-color: #16a34a; }
.mail-status p { margin: 6px 0 0; }
.mail-guide { background: color-mix(in srgb, var(--gold) 10%, var(--card)); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; font-size: 14px; }
.mail-guide ol { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; }
.mail-test { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.mail-test label { margin: 0; }

/* v2.5.2: tab Chat gọn 1 dòng + thanh nhân sự online */
.chat-seg { grid-template-columns: 1fr 1fr; }
.chat-seg a { white-space: nowrap; gap: 6px; font-size: 14.5px; padding: 9px 6px; }
.chat-seg a .ic { width: 18px; height: 18px; flex: none; }
.chat-seg a .cnt { margin-left: 2px; }
.people { display: block; overflow: visible; padding: 0 0 6px; }
.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 2px 8px; }
.pp-head b { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.pp-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent); animation: pp-pulse 2s infinite; }
@keyframes pp-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #22c55e 0%, transparent); } }
.pp-row { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
.pp-row::-webkit-scrollbar { display: none; }
.pp { width: 66px; scroll-snap-align: start; text-decoration: none; -webkit-tap-highlight-color: transparent; transition: transform .15s; }
.pp:active, .pp.is-tap { transform: scale(.92); }
.pp em { font-style: normal; font-size: 10.5px; color: var(--muted); line-height: 1; min-height: 11px; white-space: nowrap; }
.pp.is-on em { color: #16a34a; font-weight: 600; }
.pp.is-on .cav { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px #22c55e; }
.pp:not(.is-on) .cav { filter: saturate(.75); opacity: .9; }
.pp-all .cav { background: var(--bg); border: 1.5px dashed var(--line); color: var(--muted); font-size: 22px; }
@media (prefers-reduced-motion: reduce) { .pp-dot { animation: none; } }

/* ===================== v2.6.0: Doanh số & thi đua */
.lb-card h2 { display: flex; align-items: center; justify-content: space-between; }
.lb-seg { grid-template-columns: repeat(3, 1fr); margin: 0 0 8px; }
.lb-range { margin: 0 0 8px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); }
.lb-row:first-of-type { border-top: 0; }
.lb-row.me { background: color-mix(in srgb, var(--gold) 12%, transparent); border-radius: 10px; }
.lb-m { flex: none; width: 28px; text-align: center; font-size: 22px; line-height: 1; }
.lb-m .rk { font-size: 15px; color: var(--muted); }
.lb-row.top1 .cav { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px #e5b53a; }
.lb-b { flex: 1; min-width: 0; display: grid; gap: 1px; }
.lb-b b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; } .lb-b small { font-size: 12px; }
.lb-v { flex: none; display: grid; text-align: right; gap: 1px; } .lb-v b { font-size: 14px; color: var(--green); } .lb-v small { font-size: 12px; color: var(--muted); }
.lb-mine { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13.5px; }
.lb-empty { padding: 10px 0; }
.sales-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sales-top .seg { margin: 0; grid-template-columns: repeat(3, 1fr); min-width: 190px; }
.sales-nav { display: flex; align-items: center; gap: 6px; } .sales-nav b { font-size: 14.5px; white-space: nowrap; }
.sales-nav .icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-size: 20px; }
.sales-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 4px; }
.sales-tools select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--card); font: inherit; min-width: 0; }
.sales-kpis .kpi strong { font-size: 19px; }
.deal { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.deal-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .deal-h b { font-size: 16px; margin-right: 4px; }
.deal-p { font-size: 13.5px; color: var(--muted); margin: 3px 0 8px; }
.deal-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.deal-g span { display: grid; gap: 1px; } .deal-g small { font-size: 11.5px; color: var(--muted); } .deal-g b { font-size: 13.5px; }
.deal-a { margin-top: 10px; }
.deal-form [data-comm] b { color: var(--green); }
.ptable tr[data-su] { cursor: pointer; }
@media (max-width: 380px) { .deal-g { grid-template-columns: 1fr 1fr; } }

/* ===================== v2.6.0: Sinh nhật · Giao dịch của khách · Bản tin */
.bday-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.bday-row input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--card); min-width: 0; }
.bday-card { border: 1px solid color-mix(in srgb, #db2777 25%, var(--line)); }
.bday-card.is-today { background: linear-gradient(135deg, color-mix(in srgb, #f472b6 16%, var(--card)), color-mix(in srgb, var(--gold) 18%, var(--card))); }
.bday-hero { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.bday-hero > div { flex: 1; min-width: 0; display: grid; gap: 2px; } .bday-hero b { font-size: 15.5px; } .bday-hero small { color: var(--muted); font-size: 12.5px; }
.bday-hero + .bday-hero { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.bday-soon { display: grid; gap: 4px; margin-top: 8px; font-size: 14px; } .bday-soon b { font-size: 13px; color: var(--muted); } .bday-soon small { color: var(--muted); }
.lead-deals h2 { display: flex; justify-content: space-between; align-items: center; } .lead-deals h2 a { font-size: 13.5px; }
.ld-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.ld-row:first-child { border-top: 0; }
.feed-card { display: grid; grid-template-columns: 112px 1fr; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.feed-card img, .feed-noimg { width: 112px; height: 100%; min-height: 92px; max-height: 120px; object-fit: cover; border-radius: 10px; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.feed-noimg .ic { width: 28px; height: 28px; }
.feed-b { display: grid; gap: 4px; align-content: start; min-width: 0; }
.feed-t { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.feed-b b { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-b p { margin: 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-s { font-size: 12px; color: var(--muted); }
.feed-post h1 { font-size: 22px; line-height: 1.3; margin: 6px 0 10px; }
.feed-cover { width: calc(100% + 28px); margin: -14px -14px 12px; max-height: 260px; object-fit: cover; border-radius: 14px 14px 0 0; display: block; }
.feed-yt { position: relative; aspect-ratio: 16 / 9; margin: -14px -14px 12px; border-radius: 14px 14px 0 0; overflow: hidden; } .feed-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.feed-sapo { font-weight: 600; line-height: 1.6; }
.feed-content { line-height: 1.7; font-size: 15.5px; overflow-wrap: anywhere; }
.feed-content img { max-width: 100%; height: auto; border-radius: 10px; } .feed-content figure { margin: 12px 0; } .feed-content figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.feed-content blockquote { border-left: 3px solid var(--gold); margin: 12px 0; padding: 4px 14px; color: var(--muted); }
.feed-content iframe { max-width: 100%; }
.feed-act { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.feed-act button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font: inherit; font-size: 14.5px; color: var(--text); cursor: pointer; }
.feed-act .ic { width: 19px; height: 19px; }
.feed-like.on { color: #e11d48; border-color: #e11d48; background: color-mix(in srgb, #e11d48 8%, var(--card)); }
.feed-like.on .ic { fill: currentColor; }
.feed-like.pop .ic { animation: nda-pop .4s ease; }
@keyframes nda-pop { 40% { transform: scale(1.35); } }

/* ===================== v2.7.0: Lịch hẹn · Hoa hồng · Hồ sơ · Sao lưu */
.cal-user { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--card); font: inherit; margin-bottom: 10px; }
.cal-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
.cal-strip::-webkit-scrollbar { display: none; }
.cal-d { flex: none; width: 54px; padding: 8px 0 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: grid; justify-items: center; gap: 2px; color: var(--text); font: inherit; cursor: pointer; }
.cal-d small { font-size: 11px; color: var(--muted); white-space: nowrap; } .cal-d b { font-size: 18px; } .cal-d i { font-style: normal; font-size: 11px; min-height: 16px; min-width: 16px; border-radius: 8px; background: var(--gold); color: #1b160a; font-weight: 700; padding: 0 5px; }
.cal-d i:empty { background: none; }
.cal-d.today { border-color: var(--gold); } .cal-d.on { background: var(--green); color: var(--gold-2); border-color: var(--green); } .cal-d.on small { color: var(--gold-2); }
.appt-list { padding: 4px 0; }
.appt { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; align-items: flex-start; }
.appt:first-child { border-top: 0; }
.appt-t { flex: none; width: 52px; display: grid; text-align: center; padding: 6px 0; border-radius: 10px; background: color-mix(in srgb, var(--gold) 14%, var(--bg)); }
.appt-t b { font-size: 15px; } .appt-t small { font-size: 11px; color: var(--muted); }
.appt-b { flex: 1; min-width: 0; display: grid; gap: 3px; } .appt-b b { font-size: 14.5px; } .appt-b .badge { justify-self: start; }
.appt.late .appt-t { background: color-mix(in srgb, #d97706 18%, var(--bg)); }
.appt.st-done { opacity: .7; } .appt.st-cancelled, .appt.st-no_show { opacity: .55; }
.agenda-card h2, .lead-appts h2 { display: flex; justify-content: space-between; align-items: center; } .agenda-card h2 a, .lead-appts h2 a { font-size: 13.5px; }
.agenda-card .appt, .lead-appts .appt { padding-left: 0; padding-right: 0; }
.lq-res { display: grid; gap: 4px; margin: -4px 0 10px; } .lq-res button { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; font: inherit; cursor: pointer; }
.appt-res { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; background: var(--card); }
.comm-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.comm-sum div { display: grid; gap: 2px; background: var(--bg); border-radius: 10px; padding: 8px 10px; } .comm-sum small { font-size: 11.5px; color: var(--muted); } .comm-sum b { font-size: 13.5px; } .comm-sum b.ok { color: #16a34a; }
.comm-meter { margin: 4px 0 10px; } .comm-meter i { background: #16a34a; }
.comm-now { margin: 0 0 12px; }
.comm-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; counter-reset: s; }
.comm-steps li { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 11px; color: var(--muted); position: relative; }
.comm-steps li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.comm-steps li:first-child::before { display: none; }
.comm-steps li i { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; background: var(--bg); border: 2px solid var(--line); color: var(--muted); }
.comm-steps li.done i { background: #16a34a; border-color: #16a34a; color: #fff; } .comm-steps li.done::before { background: #16a34a; }
.comm-steps li.now i { border-color: var(--gold); color: var(--green); background: color-mix(in srgb, var(--gold) 25%, var(--card)); } .comm-steps li.now span { color: var(--text); font-weight: 600; }
.comm-adm { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.comm-log li { font-size: 13.5px; }
.comm-mini { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: -2px 0 12px; font-size: 13.5px; } .comm-mini a { margin-left: auto; font-size: 13px; }
.deal-c { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.pf-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.pf-row:first-child { border-top: 0; }
.pf-open { display: flex; gap: 8px; align-items: center; background: none; border: 0; padding: 4px 0; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; flex: 1; }
.pf-open span, .pf-row > span:first-child { display: grid; min-width: 0; } .pf-open small, .pf-row small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pf-slot { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 6px; } .pf-slot > div:first-child { display: grid; } .pf-slot .btn { justify-self: start; }

/* v2.8.0: điểm thành tích */
.lb-seg, .sales-top .seg { grid-template-columns: repeat(4, 1fr) !important; }
.sales-top .seg { min-width: 240px; }
.pts { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: #b45309; background: color-mix(in srgb, #f59e0b 16%, transparent); border-radius: 999px; padding: 2px 8px; }
.pts.off { color: var(--muted); background: var(--bg); font-weight: 500; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ===================== v2.8.0: Cuộc gọi · Cấp quyền */
.call-sheet .sheet-box, .perm-sheet .sheet-box { max-height: 88vh; overflow-y: auto; }
.call-sheet h2, .perm-sheet h2 { font-size: 17px; margin: 0 0 4px; }
.cs-l { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.cs-dur { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.cs-dur input { width: 64px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font: inherit; text-align: center; background: var(--card); }
.cs-q { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cs-q button { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 10px; text-align: left; display: grid; gap: 2px; font: inherit; color: var(--text); cursor: pointer; }
.cs-q button small { font-size: 11.5px; color: var(--muted); } .cs-q button.on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: color-mix(in srgb, var(--gold) 14%, var(--card)); }
.cs-star { display: flex; gap: 4px; } .cs-star button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px 4px; } .cs-star button.on { color: #f59e0b; }
.cs-note { width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; background: var(--card); }
.cs-appt { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--gold); cursor: pointer; padding: 8px; }
.calls-mini { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); text-decoration: none; color: inherit; font-size: 13.5px; }
.qbadge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; margin-left: 4px; background: var(--bg); }
.qbadge.q-nong { background: #fee2e2; color: #b91c1c; } .qbadge.q-am { background: #fef3c7; color: #92400e; } .qbadge.q-lanh { background: #e0f2fe; color: #075985; }
.perm-list { display: grid; gap: 4px; margin: 10px 0 14px; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.perm-row:first-child { border-top: 0; }
.perm-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--gold) 16%, var(--card)); }
.perm-b { flex: 1; min-width: 0; display: grid; gap: 2px; } .perm-b small { font-size: 12.5px; color: var(--muted); line-height: 1.4; } .perm-b small.txt-warn { color: #b45309; }
.perm-ok { flex: none; font-size: 12.5px; font-weight: 600; color: #16a34a; }
.perm-nudge { width: 100%; border: 1px solid var(--line); text-align: left; font: inherit; margin-bottom: 12px; cursor: pointer; }

/* ===== v2.9.0: ô ngày / giờ gọn trong khung (iPhone hiển thị ô ngày rộng hơn khung) ===== */
input[type=date], input[type=time], input[type=datetime-local], input[type=month] {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 46px; line-height: 1.3; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.3em; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { margin-left: 4px; opacity: .7; }
.grid2 > *, .grid2 label, .form label { min-width: 0; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea { box-sizing: border-box; max-width: 100%; }
.grid2 input[type=date], .grid2 input[type=time], .grid2 input[type=datetime-local] { font-size: 15px; padding-left: 10px; padding-right: 8px; }

/* ===== v2.9.0: soạn tin nhắn chăm sóc ===== */
.sl-h { font-size: 14.5px; margin: 14px 0 6px; }
.msg-comp { display: grid; gap: 8px; }
.mc-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.mc-chips::-webkit-scrollbar { display: none; }
.mc-chips .chip { white-space: nowrap; font-size: 13.5px; padding: 6px 11px; }
.mc-chips .chip.rec:not(.active) { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); }
.mc-text { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.5; background: var(--bg); color: var(--text); resize: vertical; min-height: 110px; transition: box-shadow .3s; }
.mc-text.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 55%, transparent); }
.msg-comp.ai-busy .mc-text { opacity: .55; }
.mc-ai { display: flex; gap: 8px; align-items: center; }
.mc-ai:empty { display: none; }
.mc-ai .ai-btn { flex: 1; padding: 10px 12px; font-size: 14.5px; background: linear-gradient(135deg, #7c3aed, #c9a24b); color: #fff; border: 0; }
.mc-ai select { flex: none; width: auto; border: 1px solid var(--line); border-radius: 10px; padding: 9px 8px; background: var(--card); color: var(--text); font-size: 14px; }
.mc-send { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mc-send .btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; font-size: 12.5px; line-height: 1.2; min-width: 0; }
.mc-send .btn .ic { width: 20px; height: 20px; }
.mc-send .zl { display: inline-grid; place-items: center; height: 20px; padding: 0 5px; border-radius: 6px; background: #0068ff; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .2px; }
.mc-send .mc-zalo { border-color: color-mix(in srgb, #0068ff 45%, var(--line)); }
.mc-set { font-size: 13px; color: var(--muted); text-align: center; padding: 4px; text-decoration: none; }
.sl-tpl summary { color: var(--gold); }
.msg-sheet .sheet-box { max-width: 560px; }
/* Cài đặt mẫu tin */
.mt-card { padding: 0; overflow: hidden; }
details.card.mt-card > summary { margin: 0; list-style: none; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; }
.mt-card > summary::-webkit-details-marker { display: none; }
.mt-card > summary .mt-ic { grid-row: span 2; font-size: 22px; }
.mt-card > summary small { grid-column: 2; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-card > summary .chev { grid-row: 1 / span 2; grid-column: 3; transition: transform .2s; color: var(--muted); }
.mt-card[open] > summary .chev { transform: rotate(90deg); }
.mt-body { padding: 0 14px 14px; display: grid; gap: 8px; }
.mt-body label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; }
.mt-body input, .mt-body textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; }
.mt-head { grid-template-columns: 76px minmax(0, 1fr); }
.mt-vars { display: flex; flex-wrap: wrap; gap: 5px; }
.chip.sm { padding: 4px 9px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.fhead-s { margin: 4px 0 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.chips.wrap { flex-wrap: wrap; }
.chip.ck { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; padding: 5px 10px; }
.chip.ck input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); }
.chip.ck:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--card)); }
.mt-prev { border-left: 3px solid var(--gold); padding: 6px 10px; background: color-mix(in srgb, var(--gold) 7%, var(--bg)); border-radius: 0 10px 10px 0; }
.mt-prev p { margin: 4px 0 0; font-size: 14px; white-space: pre-wrap; }
.mt-tools { display: flex; gap: 14px; justify-content: flex-end; }
.mt-tools .red { color: #dc2626; }
.center-b { display: block; margin: 12px auto; }
.link.sm { background: none; border: 0; color: var(--gold); cursor: pointer; font-size: 13.5px; padding: 6px 0; }

/* ===== v2.9.0: hồ sơ nhân sự gọn – chỉnh sửa khi bấm ===== */
.staff-head.v2 { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.staff-head.v2 .name { font-size: 18px; margin: 0 0 4px; line-height: 1.25; }
.sh-phone { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; }
.sh-phone .ic { width: 16px; height: 16px; color: var(--gold); }
.sh-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sh-tags .badge { margin: 0; font-size: 11.5px; text-decoration: none; }
.sh-edit { align-self: start; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); background: var(--bg); color: var(--gold); border-radius: 12px; padding: 8px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.sh-edit .ic { width: 20px; height: 20px; }
.sh-edit.on { background: var(--gold); color: #1a1a1a; border-color: var(--gold); }
.staff-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.staff-acts .sa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 74px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); text-decoration: none; font: inherit; cursor: pointer; }
.staff-acts .sa i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold); }
.staff-acts .sa .ic { width: 19px; height: 19px; }
.staff-acts .sa span { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; white-space: nowrap; }
.staff-acts .sa.main { background: var(--green); border-color: var(--green); color: var(--gold-2); }
.staff-acts .sa.main i { background: color-mix(in srgb, var(--gold) 25%, transparent); color: var(--gold-2); }
.staff-acts .sa:active { transform: scale(.96); }
.staff-edit.show, .pf-in.show { animation: ndaFold .28s ease-out; }
@keyframes ndaFold { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.sf-photo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.form-save { margin-top: 12px; }
.sec-fold { padding: 0; }
.sec-fold > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; }
.sec-fold > summary::-webkit-details-marker { display: none; }
.sec-fold > summary .chev { transition: transform .2s; color: var(--muted); }
.sec-fold[open] > summary .chev { transform: rotate(90deg); }
.sec-fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
.sec-fold[open] { padding-bottom: 14px; }
/* Quyền tài khoản thu gọn */
.perm-fold { border: 1px solid var(--line); border-radius: 14px; margin: 8px 0 12px; overflow: hidden; }
.pf-sum { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 12px; background: var(--bg); border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.pf-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.pf-ic .ic { width: 18px; height: 18px; }
.pf-txt b { display: block; font-size: 14.5px; }
.pf-txt small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { font-size: 12.5px; color: var(--gold); font-weight: 600; white-space: nowrap; }
.pf-chev em { display: inline-block; font-style: normal; transition: transform .2s; }
.pf-sum.on .pf-chev em { transform: rotate(90deg); }
.pf-in { padding: 12px; border-top: 1px solid var(--line); }
@media (max-width: 360px) { .staff-acts .sa span { font-size: 11px; } }
details.card.sec-fold > summary { padding: 14px 16px; margin: 0; }
details.card.sec-fold > summary b { font-size: 15px; }
.msg-sheet .sheet-btns { display: block; margin-top: 10px; }
.msg-sheet .sheet-btns .btn { width: 100%; }
/* v2.9.1: điểm thành tích dễ đọc trên nền tối */
.lb-v b { color: var(--gold); font-size: 15px; }
.sales-kpis.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -4px; }

/* ===== v2.10.0: Web dự án ===== */
.lp-card { display: block; text-decoration: none; color: inherit; }
.lp-card__h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lp-card__h b { font-size: 16px; }
.lp-card__k { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13.5px; }
.lp-card__k b { color: var(--gold); font-size: 16px; }
.lp-guide ol { padding-left: 20px; margin: 8px 0; font-size: 14px; } .lp-guide li { margin-bottom: 6px; }
.lp-site-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.lp-site-h b { font-size: 16px; } .lp-site-h .tgl-row { border: 0; padding: 0; gap: 8px; }
.lp-site-h a { color: var(--gold); }
.lp-dom { display: flex; gap: 6px; margin-top: 4px; } .lp-dom input { flex: 1; min-width: 0; }
.lp-site-b { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lp-tip { margin: 4px 2px 10px; }
details.card.lp-ed { padding: 0; overflow: hidden; }
details.card.lp-ed > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 14px; margin: 0; cursor: pointer; }
details.card.lp-ed > summary::-webkit-details-marker { display: none; }
.lp-ed-ic { font-size: 20px; width: 26px; text-align: center; }
details.lp-ed > summary b { flex: 1; font-size: 14.5px; }
details.lp-ed > summary .chev { color: var(--muted); transition: transform .2s; }
details.lp-ed[open] > summary .chev { transform: rotate(90deg); }
details.lp-ed.is-off > summary b { opacity: .5; text-decoration: line-through; }
.tgl.sm { transform: scale(.82); }
.lp-ed-b { padding: 0 14px 14px; border-top: 1px solid var(--line); animation: ndaFold .25s ease-out; }
.lpf { display: block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lpf-l { display: block; } .lpf-h { display: block; font-weight: 400; font-size: 12px; margin-top: 2px; }
.lpf input:not([type=checkbox]):not([type=color]), .lpf textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; font-weight: 400; }
.lpf textarea { resize: vertical; min-height: 70px; }
.lpf.tgl-row { color: var(--text); font-weight: 500; }
.lpf-color span { display: flex; align-items: center; gap: 10px; margin-top: 5px; } .lpf-color input { width: 48px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: none; }
.lpf-img { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.lpf-img img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.lpf-img > span { width: 96px; height: 64px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px; text-align: center; }
.lpf-img-b { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.lpf-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 6px; }
.lpf-imgs figure { margin: 0; position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.lpf-imgs img { width: 100%; height: 100%; object-fit: cover; }
.lpf-imgs figure span { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; background: rgba(0,0,0,.55); }
.lpf-imgs figure button { border: 0; background: none; color: #fff; font-size: 16px; padding: 2px 8px; cursor: pointer; }
.lpf-add { aspect-ratio: 4 / 3; border: 1px dashed var(--gold); border-radius: 8px; background: none; color: var(--gold); font-size: 22px; cursor: pointer; display: grid; place-items: center; line-height: 1; }
.lpf-add small { font-size: 11px; }
.lpf-list > .lpf-l { margin-bottom: 4px; }
.lpf-row { border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px 10px; margin-top: 8px; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.lpf-row-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding-top: 6px; }
.lpf-row-h b { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lpf-row-h span { display: flex; gap: 2px; flex: none; }
.lpf-row-h button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px; }
.lpf-row .lpf { margin-top: 8px; }
.lpf-list > .btn { margin-top: 8px; }
.lp-bar.dirty .btn { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent); }
.red { color: #dc2626 !important; }

/* ===== v2.11.0: Thống kê truy cập ===== */
.tr-live { border-color: color-mix(in srgb, #16a34a 40%, var(--line)); }
.tr-live-h { display: flex; align-items: center; gap: 10px; }
.tr-live-h b { font-size: 34px; line-height: 1; color: #16a34a; font-variant-numeric: tabular-nums; }
.tr-live-h span:last-child { font-size: 14px; color: var(--muted); }
.tr-dot { width: 12px; height: 12px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: trPulse 1.6s infinite; }
@keyframes trPulse { 70% { box-shadow: 0 0 0 12px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.tr-live-s { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .tr-live-s span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); } .tr-live-s b { color: #16a34a; }
.tr-live-l { list-style: none; padding: 0; margin: 10px 0 0; }
.tr-live-l li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); animation: lpIn .4s ease; }
@keyframes lpIn { from { opacity: 0; transform: translateY(-4px); } }
.tr-dev { font-size: 18px; } .tr-lp { flex: 1; min-width: 0; display: grid; } .tr-lp b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tr-lp small { font-size: 12px; color: var(--muted); }
.tr-seg { grid-template-columns: repeat(4, 1fr); margin: 4px 0 8px; }
.tr-site { width: 100%; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: 14.5px; }
.tr-k2 { grid-template-columns: repeat(3, 1fr); margin-top: -4px; }
.tr-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.tr-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.tr-col i { display: flex; flex-direction: column; justify-content: flex-end; width: 100%; max-width: 26px; background: color-mix(in srgb, var(--gold) 35%, transparent); border-radius: 4px 4px 0 0; }
.tr-col em { display: block; width: 100%; background: var(--gold); border-radius: 4px 4px 0 0; }
.tr-col small { height: 16px; font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.tr-leg { display: flex; align-items: center; gap: 6px; margin-top: 6px; } .tr-leg .lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; } .lg.v { background: color-mix(in srgb, var(--gold) 35%, transparent); } .lg.u { background: var(--gold); margin-left: 8px; }
.tr-bar { display: grid; grid-template-columns: 120px 1fr 70px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.tr-bar i { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; } .tr-bar em { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.tr-bar b { text-align: right; } .tr-bar small { color: var(--muted); font-weight: 400; }
.tr-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; } .tr-row:first-of-type { border-top: 0; }
.tr-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
[data-sitepick] { cursor: pointer; }
