:root {
  --bg: #f6f3ef;
  --panel: #ffffff;
  --ink: #1f1a17;
  --ink-2: #57493f;
  --muted: #8c7d72;
  --line: #e9e1d9;
  --line-2: #f1ebe5;
  --brand: #d22220;
  --brand-2: #b01815;
  --brand-soft: #fff2f1;
  --side: #1c1714;
  --side-ink: #d9cfc6;
  --ok: #15803d;
  --ok-soft: #e8f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --info: #1d4ed8;
  --info-soft: #e8efff;
  --purple: #7e22ce;
  --purple-soft: #f4e9ff;
  --r: 10px;
  --shadow: 0 1px 2px rgba(40, 25, 15, .06), 0 4px 16px rgba(40, 25, 15, .05);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 550; white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: #ecd9d8; background: #fdfbf9; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(210, 34, 32, .12); }
textarea { resize: vertical; min-height: 70px; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 20px 20px 16px; font-weight: 800; letter-spacing: 1.5px; color: #fff; font-size: 18px; }
.brand span { color: #ff9f98; margin-left: 6px; font-weight: 700; letter-spacing: .5px; font-size: 13px; }
.brand small { display: block; font-size: 11px; color: #a8998c; letter-spacing: 0; font-weight: 500; margin-top: 2px; }
.nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 9px 12px; border-radius: 8px; font-weight: 550; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(232, 58, 50, .16); color: #fff; }
.nav a.on svg { color: #ff9f98; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.me { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.me b { color: #fff; display: block; }
.me .row { margin-top: 8px; }
.me a { color: #fdba74; font-size: 12px; cursor: pointer; }
main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: var(--bg); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 20px; flex: 1; }
.top .search { max-width: 280px; }
#view { padding: 20px 24px 60px; }

/* ---------- Panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card > .hd h3 { font-size: 15px; flex: 1; }
.card > .bd { padding: 14px 16px; }
.card + .card { margin-top: 16px; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.cols > div > .card + .card { margin-top: 16px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi .v { font-size: 26px; font-weight: 750; margin-top: 4px; }
.kpi .s { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.kpi.alert .v { color: var(--bad); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.b-tiem_nang { background: var(--info-soft); color: var(--info); }
.b-dam_phan { background: var(--warn-soft); color: var(--warn); }
.b-bao_gia { background: var(--purple-soft); color: var(--purple); }
.b-chot { background: var(--ok-soft); color: var(--ok); }
.b-cham_lai { background: #eef2f1; color: #3f6158; }
.b-fail { background: var(--bad-soft); color: var(--bad); }
.b-red { background: var(--bad); color: #fff; }
.b-A { background: #fde68a; color: #78350f; }
.b-B { background: #e0e7ff; color: #3730a3; }
.b-C { background: #e7e5e4; color: #44403c; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fcfaf8; position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fdf9f5; }
.tbl .name { font-weight: 600; }
.tbl .sub { color: var(--muted); font-size: 12px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { width: auto; min-width: 140px; }
.filters input[type=search] { min-width: 220px; flex: 1; max-width: 340px; }

/* ---------- Lists ---------- */
.list > .it { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.list > .it:last-child { border-bottom: 0; }
.list > .it.click { cursor: pointer; }
.list > .it.click:hover { background: #fdf9f5; }
.risk-ico { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.k-silent { background: var(--bad); }
.k-unanswered { background: #e83a32; }
.k-opening { background: var(--purple); }
.k-untouched { background: #eab308; }
.overdue { color: var(--bad); font-weight: 600; }

/* ---------- Pipeline ---------- */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; min-height: 60vh; }
.col { background: #efe9e3; border-radius: var(--r); width: 290px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 170px); }
.col.side-col { width: 210px; background: #ece8e5; }
.col.side-col.collapsed { width: 120px; }
.col .ch { padding: 12px 12px 8px; }
.col .ch .t { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.col .ch .t .n { background: #fff; border-radius: 99px; padding: 0 8px; font-size: 12px; }
.col .ch .sum { font-size: 13px; color: var(--ink-2); margin-top: 3px; font-weight: 600; }
.col .ch .bar { height: 3px; border-radius: 3px; margin-top: 8px; }
.col .cards { padding: 4px 8px 10px; overflow-y: auto; flex: 1; min-height: 80px; }
.col.over { outline: 2px dashed var(--brand); outline-offset: -2px; background: #ffe1df; }
.kcard { background: #fff; border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(40, 25, 15, .08); cursor: grab; border: 1px solid transparent; }
.kcard:hover { border-color: #ffc7c3; }
.kcard.dragging { opacity: .4; }
.kcard .t { font-weight: 650; line-height: 1.3; }
.kcard .m { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kcard .f { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; flex-wrap: wrap; }
.kcard .val { font-weight: 700; color: var(--ink); }
.av { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ffc7c3; color: #730006; font-size: 10px; font-weight: 700; margin-left: auto; flex: none; }
.more-btn { width: 100%; margin-top: 4px; }

/* ---------- Drawer & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(28, 23, 20, .35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 41; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0, 0, 0, .15); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.drawer .dh { background: #fff; padding: 16px 20px 0; border-bottom: 1px solid var(--line); }
.drawer .dh h2 { font-size: 20px; }
.drawer .db { overflow-y: auto; padding: 16px 20px 40px; flex: 1; }
.tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-color: var(--brand); }
.tabs.boxed { margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.stepper { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.stepper button { flex: 1; min-width: 86px; border: 1px solid var(--line); background: #faf7f4; padding: 7px 6px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.stepper button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper button.past { background: var(--brand-soft); border-color: #ffc7c3; color: var(--brand-2); }
.stepper button.lost.on { background: var(--bad); border-color: var(--bad); }
.stepper button.nurture.on { background: #3f6158; border-color: #3f6158; }

.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(28, 23, 20, .4); }
.modal { background: #fff; border-radius: 12px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(860px, 100%); }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.modal .mh h3 { flex: 1; font-size: 17px; }
.modal .mb { padding: 16px 20px; }
.modal .mf { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; }

.timeline .ev { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 14px; background: var(--line-2); }
.timeline .ico.inbound { background: #ffe1df; }
.timeline .ico.contact { background: var(--ok-soft); }
.timeline .ico.system, .timeline .ico.stage, .timeline .ico.assign { background: #f1f0ee; }
.timeline .meta { font-size: 12px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; cursor: pointer; font-size: 13px; font-weight: 550; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.osteps { display: flex; align-items: center; gap: 0; margin: 10px 0; }
.osteps .s { flex: 1; text-align: center; font-size: 11px; color: var(--muted); position: relative; padding-top: 22px; }
.osteps .s::before { content: ''; position: absolute; top: 6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--line); z-index: 1; }
.osteps .s::after { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.osteps .s:first-child::after { display: none; }
.osteps .s.done { color: var(--ink); font-weight: 600; }
.osteps .s.done::before, .osteps .s.done::after { background: var(--brand); }

.bars .b { display: grid; grid-template-columns: 150px 1fr 60px; gap: 8px; align-items: center; padding: 5px 0; font-size: 13px; }
.bars .track { background: var(--line-2); border-radius: 4px; height: 10px; overflow: hidden; }
.bars .fill { background: var(--brand); height: 100%; border-radius: 4px; }

.code { background: #1f1a17; color: #ffe1df; padding: 12px 14px; border-radius: 8px; font-family: Consolas, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.copy-line { display: flex; gap: 6px; }
.copy-line input { font-family: Consolas, monospace; font-size: 12.5px; }
.guide ol { padding-left: 20px; margin: 8px 0; }
.guide li { margin: 4px 0; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.on { background: var(--ok); }
.status-dot.off { background: #d6cfc8; }
.note-box { background: var(--brand-soft); border: 1px solid #ffc7c3; border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--side); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); font-weight: 550; max-width: 90vw; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, #fde3cf 0, transparent 40%), var(--bg); }
.auth .box { background: #fff; padding: 28px; border-radius: 14px; width: min(400px, 100%); box-shadow: 0 10px 40px rgba(60, 30, 10, .12); }
.auth .logo { font-weight: 800; letter-spacing: 1.5px; font-size: 22px; color: var(--brand); }
.auth .logo span { color: var(--ink); font-size: 14px; margin-left: 6px; }
.auth h2 { font-size: 18px; margin: 14px 0 4px; }
.auth form > * + * { margin-top: 12px; }
.auth .btn.primary { width: 100%; justify-content: center; padding: 10px; }
.err-msg { color: var(--bad); font-size: 13px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; z-index: 30; flex-direction: row; }
  .brand, .me { display: none; }
  .nav { flex-direction: row; padding: 4px; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10px; padding: 6px 8px; min-width: 64px; text-align: center; }
  .nav .badge { position: absolute; margin: 0 0 0 18px; }
  .nav a { position: relative; }
  #view { padding: 14px 12px 90px; }
  .top { padding: 12px; }
  .top .search { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .drawer .db { padding: 12px 12px 40px; }
  .filters > * { min-width: 0; flex: 1 1 45%; }
  .bars .b { grid-template-columns: 100px 1fr 50px; }
}

.selbox { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ---------- Công việc: Gantt ---------- */
.gantt { overflow: hidden; }
.g-scroll { overflow-x: auto; }
.g-row { display: flex; border-bottom: 1px solid var(--line-2); min-height: 52px; cursor: pointer; }
.g-row:hover .g-left { background: #fdf9f5; }
.g-left { position: sticky; left: 0; z-index: 2; background: #fff; display: grid; grid-template-columns: 260px 110px 64px 64px; flex: none; border-right: 1px solid var(--line); }
.g-left > div { padding: 8px 10px; display: flex; align-items: center; gap: 6px; }
.g-name { flex-direction: column; align-items: flex-start !important; justify-content: center; font-weight: 600; font-size: 13px; line-height: 1.35; }
.g-d { font-size: 12px; justify-content: center; }
.g-right { position: relative; flex: none; }
.g-bar { position: absolute; top: 14px; height: 22px; border-radius: 6px; color: #fff; font-size: 11px; padding: 0 8px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.g-head { cursor: default; min-height: 38px; background: #fcfaf8; font-size: 12px; color: var(--muted); }
.g-head .g-left { background: #fcfaf8; font-weight: 650; }
.g-head .g-name { font-weight: 650; }
.g-group, .g-group .g-left { background: #2b2420 !important; color: #fff; }
.g-group .g-left { border-right-color: #3d342e; }
.g-group:hover .g-left { background: #3a302a !important; }
/* ---------- Check-in tuần ---------- */
.ci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.ci-grid .card + .card { margin-top: 0; }
@media (max-width: 760px) { .g-left { grid-template-columns: 170px 70px 50px 50px; } }

/* Chip vị trí trong team (Account / Design / Ads…) */
.pos-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, #fff); border: 1px solid color-mix(in srgb, var(--pc) 30%, #fff); line-height: 1.5; vertical-align: middle; }

/* Cột bảng kéo thả: thu nhỏ (dải dọc) / phóng to (2 hàng thẻ) */
.col .ch .t .col-btns { margin-left: auto; display: inline-flex; gap: 2px; }
.cbtn { border: 0; background: transparent; color: var(--muted); font-size: 13px; line-height: 1; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.cbtn:hover { background: #fff; color: var(--ink); }
.col.mini { width: 46px; cursor: pointer; align-items: center; transition: background .15s; }
.col.mini:hover { background: #e6ddd4; }
.col.mini .ch { padding: 10px 6px; display: flex; flex-direction: column; align-items: center; width: 100%; }
.col.mini .ch .bar { width: 100%; }
.col.mini .ch .n { background: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.col.mini .vt { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.col.mini .cards { min-height: 40px; width: 100%; padding: 0; }
.col.wide { width: 600px; }
.col.wide .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.col.wide .kcard { margin-bottom: 0; }
.col.wide .more-btn { grid-column: 1 / -1; }

/* Tình trạng dự án trên thẻ ở cột Chốt */
.proj-line { margin-top: 7px; padding: 6px 8px; border-radius: 7px; font-size: 12px; background: #f0fdf4; border: 1px solid #dcfce7; line-height: 1.45; }
.proj-line.h-yellow { background: #fefce8; border-color: #fef08a; }
.proj-line.h-red { background: #fef2f2; border-color: #fecaca; }
.proj-line.h-done, .proj-line.h-none { background: #f5f5f4; border-color: #e7e5e4; color: var(--muted); }
.proj-line .pbar { height: 4px; background: rgba(0,0,0,.08); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.proj-line .pbar i { display: block; height: 100%; background: #16a34a; border-radius: 4px; }
.proj-line.h-yellow .pbar i { background: #ca8a04; }
.proj-line.h-red .pbar i { background: #dc2626; }
.proj-line .why { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.proj-line.h-red .why { color: #b91c1c; }

/* Phân trang */
.pager { display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pg { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid var(--line); background: #fff; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); }
.pg:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pg.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pg:disabled { opacity: .4; cursor: default; }

/* OKR */
.okr-badge { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.okr-pct { font-size: 24px; font-weight: 800; line-height: 1.1; }
.okr-bar { position: relative; height: 8px; background: #efe9e3; margin: 0 16px 6px; border-radius: 8px; }
.okr-bar i { display: block; height: 100%; border-radius: 8px; }
.okr-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #292524; }
.pbar2 { height: 6px; background: #efe9e3; border-radius: 6px; overflow: hidden; margin-top: 4px; }
.pbar2 i { display: block; height: 100%; border-radius: 6px; }
.h-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #f5f5f4; color: var(--ink-2); white-space: nowrap; }
.h-chip.h-green, .h-chip.h-done { background: #dcfce7; color: #166534; }
.h-chip.h-yellow { background: #fef9c3; color: #854d0e; }
.h-chip.h-red { background: #fee2e2; color: #991b1b; }
.g-left.pj-left { grid-template-columns: 250px 160px 140px; }
.pj-left .g-d { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; }

/* OKR: phân bổ + việc bóc tách dưới KR */
.okr-cascade { flex-basis: 100%; margin: 4px 0 2px 46px; padding: 8px 10px; background: #faf7f4; border-radius: 8px; border: 1px dashed #e7ddd3; }
.alloc-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px 2px 3px; border-radius: 99px; background: #fff; border: 1px solid var(--line); }
.alloc-chip.h-green, .alloc-chip.h-done { border-color: #bbf7d0; background: #f0fdf4; }
.alloc-chip.h-yellow { border-color: #fde68a; background: #fefce8; }
.alloc-chip.h-red { border-color: #fecaca; background: #fef2f2; }
.okr-task { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 13px; }
.okr-task.done .grow { text-decoration: line-through; color: var(--muted); }
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.mini-kpis div { background: #faf7f4; border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; }
.mini-kpis b { font-size: 13px; }
.mini-kpis span { font-size: 11px; color: var(--muted); }
@media (max-width: 700px) { .okr-cascade { margin-left: 0; } .mini-kpis { grid-template-columns: repeat(2, 1fr); } }

/* Sửa nhanh + sức khoẻ dữ liệu */
.need, select.need, input.need { border-color: #f87171 !important; background: #fef2f2 !important; }
.qe-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 0 6px; margin-left: 4px; cursor: pointer; font-size: 12px; color: var(--muted); line-height: 18px; }
.qe-btn:hover { border-color: var(--brand); color: var(--brand); }
.miss-tag { display: inline-block; margin-left: 4px; font-size: 11px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 99px; padding: 0 7px; font-weight: 600; }
.dh-bar { margin-bottom: 12px; }
.dh-chip { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; border-radius: 99px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.dh-chip.on { background: #b91c1c; color: #fff; border-color: #b91c1c; }

/* Doanh thu */
.pay-line { margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: #f0fdf4; border: 1px solid #dcfce7; font-size: 13px; cursor: pointer; }
.pay-line.late { background: #fef2f2; border-color: #fecaca; }
.pay-line:hover { border-color: var(--brand); }
.pay-row.paid { background: #f0fdf4; }
.rev-chart { display: flex; gap: 14px; align-items: flex-end; height: 230px; padding-top: 10px; }
.rc-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.rc-bars { flex: 1; width: 100%; display: flex; gap: 4px; align-items: flex-end; justify-content: center; }
.rc-bars i { display: block; width: 38%; max-width: 34px; border-radius: 5px 5px 0 0; min-height: 2px; }
.rc-v { font-size: 11px; text-align: center; margin-top: 4px; color: #d22220; font-weight: 600; line-height: 1.3; }
.rc-l { font-size: 12px; color: var(--muted); font-weight: 600; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* Chế độ "xem như" nhân viên */
.viewas-bar { position: sticky; top: 0; z-index: 30; background: #fef3c7; border-bottom: 2px solid #f59e0b; color: #78350f; padding: 8px 20px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Thưởng sale */
.cm-amt { font-size: 22px; font-weight: 800; color: var(--good); line-height: 1.1; }
.cm-bar { position: relative; height: 8px; background: #efe9e3; border-radius: 8px; margin-top: 6px; }
.cm-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #ff9f98, #d22220); max-width: 100%; }
.cm-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #57534e; }

/* Lương thưởng */
.comp-total { font-size: 34px; font-weight: 800; color: var(--good); line-height: 1.1; margin: 4px 0; }
.comp-formula { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comp-formula > div { background: #faf7f4; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 120px; }
.comp-formula span { font-size: 11.5px; color: var(--muted); }
.comp-formula b { font-size: 16px; }
.comp-formula small { font-size: 11px; color: var(--muted); max-width: 260px; }
.comp-formula i { font-style: normal; font-weight: 800; color: var(--muted); }

/* Cún Trinh Sát */
.intel { border-top: 3px solid var(--brand); }
.intel-list { margin: 4px 0 10px; padding-left: 18px; font-size: 13px; } .intel-list li { margin: 3px 0; }
.intel-cpm { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.intel-map { position: relative; height: 200px; border: 1px solid var(--line); border-radius: 10px; background: #faf7f4; margin-top: 6px; }
.intel-map .ax { position: absolute; font-size: 10.5px; color: var(--muted); }
.intel-map .dot { position: absolute; transform: translate(-50%, -50%); text-align: center; font-size: 11px; font-weight: 600; white-space: nowrap; }
.intel-map .dot i { display: block; width: 10px; height: 10px; border-radius: 50%; background: #78716c; margin: 0 auto 2px; }
.intel-map .dot.me { color: var(--brand); } .intel-map .dot.me i { background: var(--brand); width: 14px; height: 14px; }
.intel-s { background: #f0fdf4; border-radius: 6px; padding: 6px 8px; } .intel-w { background: #fef2f2; border-radius: 6px; padding: 6px 8px; }
.intel-s ul, .intel-w ul { margin: 2px 0; padding-left: 16px; }
.intel-rec { border-left: 4px solid var(--brand); background: #faf7f4; padding: 8px 12px; margin: 6px 0; border-radius: 0 8px 8px 0; }
