/* Mytonic Work — bố cục kiểu Lark, nhận diện Mytonic (xanh ngọc #00A19A, logo trắng, Darker Grotesque)
   Phối màu "sân khấu": xanh ngọc làm chủ, mực xanh đậm làm nền tối, san hô + vàng nắng + hồng sen làm điểm nhấn nghệ thuật */
:root {
  --brand: #00A19A;           /* màu thương hiệu, dùng cho mảng lớn, logo, nền */
  --accent: #00807A;          /* màu nút, link, chữ — đậm hơn để đạt chuẩn dễ đọc */
  --accent-soft: #00A19A17; --accent-ink: #00665F; --accent-line: #9ED9D4;
  --stage: #062F2E;           /* mực xanh đậm: nền "sân khấu" */
  --coral: #FF6B57; --sun: #FFC53D; --rose: #E0457B; --mint: #7FE3D8;
  --art: linear-gradient(90deg, #00A19A 0%, #7FE3D8 30%, #FFC53D 58%, #FF6B57 80%, #E0457B 100%);
  --display: 'Darker Grotesque', 'Be Vietnam Pro', system-ui, sans-serif;
  --ink: #1F2329; --ink2: #3B4048; --muted: #5F6368; --line: #E4E6EA; --line2: #F0F1F3;
  --bg: #F4F7F7; --card: #FFFFFF; --late: #C62828; --ok: #1B6B3A; --info: #1F5BA8;
  --radius: 12px; --side: 240px;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-family: var(--display); font-size: 32px; line-height: 1.05; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.display { font-family: var(--display); font-weight: 800; }
h2 { font-family: var(--display); font-size: 21px; line-height: 1.15; margin: 0; font-weight: 800; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
input, select, textarea { border: 1px solid #D5D8DD; border-radius: 8px; padding: 0 10px; min-height: 38px; background: #fff; width: 100%; }
textarea { padding: 8px 10px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex-shrink: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select:disabled, input:disabled { background: #F5F6F7; color: var(--muted); }

.muted { color: var(--muted); } .sm { font-size: 13px; } .xs { font-size: 12px; } .b { font-weight: 600; }
.block { display: block; } .grow { flex: 1; min-width: 0; } .late { color: var(--late); } .ok { color: var(--ok); } .info { color: var(--info); }
.pre { white-space: pre-wrap; margin: 0; } .struck { text-decoration: line-through; color: var(--muted); } .r { text-align: right; }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px;
  border: 1px solid #D5D8DD; background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #F7F8FA; } .btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { background: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.lg { min-height: 46px; padding: 0 22px; font-size: 15px; } .btn.block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; cursor: pointer; position: relative; flex-shrink: 0; }
.icon-btn:hover { background: #EEF0F3; }
.icon-btn.star.on { color: #C77700; }
.link { color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 500; }
.link-like { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 12px; white-space: nowrap; background: #EEF0F3; color: var(--ink2); }
.chip.grey { background: #EEF0F3; color: var(--ink2); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex-shrink: 0; }
.sq { width: 20px; height: 20px; border-radius: 5px; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sq.lg { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1.5px solid #D5D8DD; background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Khung ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side); flex-shrink: 0; color: #fff; padding: 14px 10px;
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(0,161,154,.55), transparent 70%),
    radial-gradient(90% 30% at 100% 100%, rgba(255,107,87,.28), transparent 70%),
    radial-gradient(70% 25% at 0% 85%, rgba(224,69,123,.18), transparent 70%),
    var(--stage); display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 18px; position: relative; }
.brand::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--art); opacity: .9; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-tag { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .28em; color: var(--mint); margin-top: 3px; }
.logo-full { height: 34px; width: auto; display: block; margin: 0 auto; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #00B5AD, var(--accent) 60%, #0A3F3D); color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo.lg { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; margin: 0 auto 12px; }
.brand-name { font-weight: 700; font-size: 15px; }
.nl { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 8px; color: rgba(255,255,255,.82); font-size: 14px; position: relative; }
.nl:hover { background: rgba(255,255,255,.08); color: #fff; }
.nl.on { background: rgba(0,161,154,.32); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(127,227,216,.25); }
.nl.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--sun), var(--coral)); }
.nb { margin-left: auto; font-size: 12px; background: rgba(255,255,255,.14); color: #fff; border-radius: 10px; padding: 0 8px; font-weight: 600; }
.nb.red { background: var(--coral); color: #2A0F0A; }
.ns { font-size: 11px; font-weight: 600; color: #5F6670; padding: 14px 10px 4px; letter-spacing: .06em; }
.side .ns { font-family: var(--display); font-size: 13px; font-weight: 800; color: var(--mint); padding: 16px 10px 4px; letter-spacing: .14em; opacity: .9; }
.side .sq { box-shadow: 0 0 0 1.5px rgba(255,255,255,.25); }
.side .icon-btn { color: rgba(255,255,255,.85); } .side .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid rgba(255,255,255,.12); }
.side-foot .muted { color: rgba(255,255,255,.6); }
.side .muted { color: rgba(255,255,255,.6); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(244,247,247,.92);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.searchbox { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 520px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: text; text-align: left; }
kbd { font-size: 11px; border: 1px solid #D5D8DD; border-radius: 4px; padding: 1px 6px; font-family: inherit; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { border: 1px solid var(--line); background: #fff; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--late); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; min-width: 200px; z-index: 30; }
.menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: #F0F1F3; }
.content { flex: 1; padding: 24px 28px 48px; }
.page-head h1 { position: relative; padding-bottom: 6px; }
.page-head h1::after { content: ''; position: absolute; left: 0; bottom: 0; width: 44px; height: 4px; border-radius: 2px; background: var(--art); }
.bottombar { display: none; }
.only-mobile { display: none; }
.scrim { display: none; }

/* ---------- Trang ---------- */
.page { display: flex; flex-direction: column; gap: 18px; min-width: 0; flex: 1; }
.page.narrow { max-width: 1000px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.crumb { font-size: 13px; color: var(--muted); } .crumb a:hover { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 16px 20px; } .pad { padding: 12px 16px; } .pad-sm { padding: 8px; } .pad-x { padding-left: 16px; padding-right: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line2); }
.card-head.flat { padding: 0 0 8px; border: 0; }
.card.pad > h2, .card.pad > h3 { margin-bottom: 10px; }
.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.grow1 { flex: 1 1 300px; min-width: 0; } .grow2 { flex: 2 1 520px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.stat:hover { border-color: #C9CDD3; } .stat.sel { border: 2px solid var(--accent); padding: 15px 17px; }
.btnlike { cursor: pointer; font: inherit; color: inherit; }
.num { font-size: 30px; font-weight: 700; line-height: 1.2; } .num-lg { font-size: 30px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.table-wrap .tbl { min-width: 640px; }
.table-wrap .tbl td:first-child { min-width: 170px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: #F7F8FA; }
.tbl tr.grp td { background: #F7F8FA; font-weight: 600; font-size: 13px; }
.th-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-weight: 600; }
.progress { display: inline-flex; align-items: center; gap: 8px; }
.progress .bar { width: 90px; height: 6px; border-radius: 3px; background: #EEF0F3; overflow: hidden; display: inline-block; }
.progress .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--mint)); }
.progress .pct { font-size: 12px; color: var(--muted); }
.barrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.barlabel { width: 92px; font-size: 13px; } .bartrack { flex: 1; height: 10px; border-radius: 5px; background: var(--line2); overflow: hidden; }
.bartrack span { display: block; height: 100%; border-radius: 5px; }
.listrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.listrow:last-child { border-bottom: 0; }
a.listrow:hover { color: var(--accent); }
.datebox { width: 40px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); } .empty-title { font-weight: 600; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.errorbox { background: #FDE8E4; color: #A33A1F; border-radius: 8px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.spinner { width: 28px; height: 28px; margin: 48px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 42px; padding: 0 14px; border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; color: var(--ink2); }
.tabs button.on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab-count { margin-left: 6px; font-size: 12px; color: var(--muted); }

/* ---------- Việc của tôi ---------- */
.taskrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 18px; border-bottom: 1px solid var(--line2); }
.taskrow:last-child { border-bottom: 0; } .taskrow.sel { background: var(--accent-soft); }
.taskrow-title { flex: 1 1 260px; min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.taskrow-title:hover span:first-child { color: var(--accent); }
.due { width: 150px; text-align: right; font-size: 13px; white-space: nowrap; }

/* ---------- Thông báo ---------- */
.notif { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--line2); background: #fff; cursor: pointer; }
.notif:hover { background: #F7F8FA; } .notif.unread { background: #F5F6FF; } .notif.unread .grow > span:first-child { font-weight: 600; }
.udot { width: 8px; height: 8px; border-radius: 50%; margin-top: 13px; flex-shrink: 0; } .notif.unread .udot { background: var(--accent); }

/* ---------- Show ---------- */
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.show-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.h3link { font-size: 16px; font-weight: 600; } .h3link:hover { color: var(--accent); }
.show-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.show-head > .grow { flex: 1 1 420px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink2); margin: 6px 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatars { display: flex; align-items: center; } .avatars .avatar { border: 2px solid var(--bg); margin-left: -6px; }
.stepper { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
.step { flex: 1 1 120px; display: flex; flex-direction: column; gap: 4px; }
.step-bar { height: 6px; border-radius: 3px; background: var(--line); }
.step.done .step-bar { background: var(--ok); } .step.now .step-bar { background: var(--accent); } .step.now .b { color: var(--accent); }
.with-drawer { display: flex; gap: 20px; align-items: flex-start; }

.kanban-wrap { display: flex; flex-direction: column; gap: 8px; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.kcol { background: #EEF0F3; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.kcol.over { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.kcard { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; }
.kcard:hover { border-color: #B9BEC7; } .kcard.sel { outline: 2px solid var(--accent); }
.kcard-title { font-weight: 500; line-height: 1.35; }
.kcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.mm-wrap { overflow-x: auto; }
.mm { display: flex; align-items: center; min-width: 760px; }
.mm-root { padding: 14px 18px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--accent-ink)); color: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; margin-right: 32px; position: relative; }
.mm-root::after { content: ''; position: absolute; right: -32px; top: 50%; width: 32px; height: 2px; background: #B9BEC7; }
.mm-branches { display: flex; flex-direction: column; gap: 12px; border-left: 2px solid #B9BEC7; padding: 6px 0; }
.mm-branch { display: flex; align-items: flex-start; position: relative; padding-left: 24px; }
.mm-branch::before { content: ''; position: absolute; left: 0; top: 18px; width: 24px; height: 2px; background: #B9BEC7; }
.mm-team { padding: 7px 12px; border-radius: 10px; border: 2px solid; background: #fff; font-weight: 600; width: 130px; flex-shrink: 0; }
.mm-leaves { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 20px; }
.mm-leaf { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: #F5F6F7; border: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.mm-leaf:hover { border-color: var(--accent); }

.tl-wrap { overflow-x: auto; }
.tl { position: relative; padding-bottom: 8px; }
.tl-head, .tl-row { display: flex; align-items: center; min-height: 34px; border-bottom: 1px solid var(--line2); }
.tl-head { position: sticky; top: 0; background: #fff; z-index: 2; }
.tl-label { width: 220px; flex-shrink: 0; padding: 0 12px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; }
.tl-row.stage { background: #F7F8FA; } .tl-row.stage .tl-label { background: #F7F8FA; }
.tl-grid { position: relative; height: 34px; }
.tl-grid > span:not(.tl-bar):not(.tl-stage):not(.tl-dep) { position: absolute; top: 0; height: 34px; line-height: 34px; padding-left: 6px; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line2); }
.tl-bar { position: absolute; top: 7px; height: 20px; border-radius: 6px; font-size: 11px; line-height: 20px; padding: 0 8px; white-space: nowrap; overflow: hidden; color: var(--ink2); background: #E8EAED; }
.tl-bar.doing { background: #DCE6F7; color: #1F5BA8; } .tl-bar.review { background: #FFF1DC; color: #8A4B00; } .tl-bar.done { background: #E3F4EA; color: var(--ok); }
.tl-bar.is-late { background: #FDE8E4; color: #A33A1F; }
.tl-stage { position: absolute; top: 12px; height: 10px; border-radius: 5px; background: var(--accent); opacity: .35; }
.tl-dep { position: absolute; top: 8px; font-size: 13px; color: var(--muted); }
.tl-today, .tl-show { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--late); pointer-events: none; }
.tl-show { border-left: 2px solid var(--ink); }

/* ---------- Khung chi tiết việc ---------- */
.drawer { width: 400px; flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: sticky; top: 76px;
  max-height: calc(100vh - 96px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.drawer-head { display: flex; align-items: flex-start; gap: 8px; }
.drawer-head h2 { flex: 1; font-size: 17px; line-height: 1.35; }
.title-input { flex: 1; font-size: 17px; font-weight: 600; border-color: transparent; padding: 4px 6px; }
.title-input:hover { border-color: #D5D8DD; }
.hold-banner { background: #EEF0F3; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.props { display: grid; grid-template-columns: 92px 1fr; gap: 8px 10px; align-items: center; font-size: 13px; }
.props .pl { color: var(--muted); }
.props select, .props input { min-height: 34px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dsec { border-top: 1px solid var(--line2); padding-top: 12px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 16px; background: #F0F1F3; font-size: 13px; }
.x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form input, .inline-form select { min-height: 34px; }
.check-row { display: flex; align-items: center; justify-content: space-between; }
.check-row label, .check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.dep { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.file { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px; color: var(--accent); }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment-form { position: relative; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; margin-top: 6px; }
.mention-pop { position: absolute; bottom: 100%; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.12); padding: 4px; z-index: 5; min-width: 240px; }
.mention-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 6px; }
.mention-pop button:hover { background: #F0F1F3; }
.hist { padding: 2px 0; }

/* ---------- Báo cáo & KPI ---------- */
.team-list { flex: 0 1 280px; min-width: 240px; padding: 6px; }
.team-btn, .person-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; }
.team-btn:hover, .person-btn:hover { background: #F0F1F3; } .team-btn.on, .person-btn.on { background: var(--accent-soft); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.field-inner { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--ink2); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--muted); }
.comment-line { padding: 6px 0; border-bottom: 1px solid var(--line2); }
.score-edit { display: inline-flex; align-items: center; gap: 6px; }
.score-edit input { width: 64px; min-height: 32px; text-align: right; }

/* ---------- Hộp thoại ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,22,26,.42); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line2); }
.modal-body { padding: 8px 20px 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line2); }
.form .field:first-child { margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-lg { min-height: 46px; font-size: 16px; margin-top: 10px; }
.search-res { margin-top: 10px; }
.res { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.res:hover { background: #F0F1F3; } .res.static { cursor: default; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.team-pick { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.team-pick select { width: 130px; margin-left: auto; min-height: 32px; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #2B2F36; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.2); font-size: 14px; }
.toast.err { background: #A33A1F; }

/* ---------- Lời mời bật Face ID ---------- */
.nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: linear-gradient(100deg, #E3F6F4, #FFF4E6 70%, #FFE8E4); border: 1px solid var(--accent-line); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.nudge > svg { color: var(--accent); }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 16px; position: relative; overflow: hidden;
  background:
    radial-gradient(42vmax 42vmax at 12% 18%, rgba(127,227,216,.55), transparent 60%),
    radial-gradient(36vmax 36vmax at 92% 88%, rgba(255,107,87,.55), transparent 62%),
    radial-gradient(28vmax 28vmax at 85% 12%, rgba(255,197,61,.42), transparent 60%),
    radial-gradient(30vmax 30vmax at 8% 95%, rgba(224,69,123,.35), transparent 60%),
    linear-gradient(160deg, #00A19A, #00807A 55%, #063B39); }
.login::before { content: ''; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.18); box-shadow: 0 0 0 9vmax rgba(255,255,255,.04), 0 0 0 18vmax rgba(255,255,255,.03); pointer-events: none; }
.login::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.9) 0 3px, transparent 3px 11px);
  -webkit-mask: linear-gradient(transparent, #000); mask: linear-gradient(transparent, #000);
  clip-path: polygon(0 70%, 4% 40%, 8% 75%, 12% 20%, 16% 60%, 20% 35%, 24% 80%, 28% 10%, 32% 55%, 36% 30%, 40% 70%, 44% 15%, 48% 50%, 52% 25%, 56% 65%, 60% 5%, 64% 45%, 68% 30%, 72% 75%, 76% 20%, 80% 60%, 84% 35%, 88% 80%, 92% 25%, 96% 55%, 100% 40%, 100% 100%, 0 100%); }
.login > * { position: relative; z-index: 1; }
.login-brand { text-align: center; color: #fff; }
.login-brand .logo-full { height: 44px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.18)); }
.login-brand .tag { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .4em; margin-top: 8px; color: #fff; opacity: .92; }
.login-card h1 { font-size: 30px; }
.login-card { background: rgba(255,255,255,.97); border: 1px solid rgba(255,255,255,.6); box-shadow: 0 30px 60px -20px rgba(4,40,38,.45); border-radius: 20px; padding: 32px; width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.btn.google { gap: 10px; }
.dev-login { text-align: left; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.dev-login summary { cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; text-align: center; }
.dev-login summary::-webkit-details-marker { display: none; }
.dev-login[open] summary { margin-bottom: 8px; }

/* ---------- Điện thoại & máy tính bảng ---------- */
@media (max-width: 1100px) {
  .with-drawer { display: block; }
  .drawer { position: fixed; inset: 0 0 0 auto; width: min(440px, 100%); max-height: none; top: 0; border-radius: 0; z-index: 40; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
}
@media (max-width: 760px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 45; transform: translateX(-100%); transition: transform .2s; width: 280px; box-shadow: none; }
  .side.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.15); }
  .toasts { left: 16px; right: 16px; bottom: 84px; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 44; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 10px 12px; } .searchbox kbd { display: none; }
  .content { padding: 16px 16px 96px; }
  h1 { font-size: 27px; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 4px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottombar a, .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border: 0; background: none; font-size: 11px; color: var(--muted); position: relative; cursor: pointer; }
  .bottombar .on { color: var(--accent); font-weight: 600; }
  .bottombar .badge { top: 2px; right: auto; left: 52%; }
  .bottombar .fab { flex: 0 0 56px; height: 56px; min-height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent-ink)); color: #fff; margin-top: -22px; box-shadow: 0 6px 16px rgba(0,128,122,.45), 0 0 0 3px #fff; }
  .topbar-right .btn.primary { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .due { width: auto; text-align: left; }
  .taskrow { padding: 10px 14px; }
  .drawer { width: 100%; }
  .kanban { grid-template-columns: repeat(4, 78vw); scroll-snap-type: x mandatory; } .kcol { scroll-snap-align: start; }
  .team-list { flex-basis: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .num { font-size: 24px; }
}

/* ---------- Điểm nhấn nghệ thuật ---------- */
.stats .stat { position: relative; overflow: hidden; }
.stats .stat::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--brand); }
.stats .stat:nth-child(2)::before { background: var(--coral); }
.stats .stat:nth-child(3)::before { background: var(--sun); }
.stats .stat:nth-child(4)::before { background: var(--rose); }
.stats .stat::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 110px; height: 110px; border-radius: 50%; background: var(--accent-soft); pointer-events: none; }
.stats .stat:nth-child(2)::after { background: #FF6B5714; } .stats .stat:nth-child(3)::after { background: #FFC53D1C; } .stats .stat:nth-child(4)::after { background: #E0457B12; }
::selection { background: #7FE3D866; }

/* ---------- Chat ---------- */
.content:has(> .chat) { padding: 0; }
.shell.in-chat .content { padding: 0; }
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100dvh - 65px); background: var(--card); }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #FAFCFC; }
.chat-list-head { padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 10px; }
.chat-list-head h1 { font-size: 30px; }
.chat-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px; color: var(--muted); }
.chat-search input { border: 0; min-height: 36px; padding: 0; background: transparent; }
.chat-search input:focus { outline: none; }
.chat-search:focus-within { outline: 2px solid var(--accent); }
.chat-list-body { overflow-y: auto; padding: 0 8px 16px; flex: 1; }
.chat-list-body .ns { display: flex; padding: 14px 8px 4px; }
.pad-s { padding: 4px 8px 8px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; min-height: 52px; }
.chat-item:hover { background: #EEF4F4; }
.chat-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--brand); }
.chat-item .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unread .chat-name { font-weight: 700; }
.chat-item.unread .clamp1 { color: var(--ink2); }
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cbadge { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cbadge.at { background: var(--coral); color: #2A0F0A; }
.ch-show { position: relative; flex-shrink: 0; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--accent-ink)); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ch-show .dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; box-shadow: 0 0 0 2px #fff; }
.icon-btn.sm { width: 28px; height: 28px; }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; color: var(--muted);
  background: radial-gradient(60% 50% at 50% 40%, var(--accent-soft), transparent); }
.chat-empty .b { color: var(--ink); font-family: var(--display); font-size: 22px; }

.chat-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); min-height: 60px; }
.chat-title { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 0 8px; overscroll-behavior: contain; }
.chat-start { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px 18px; text-align: center; }
.chat-start .b { font-family: var(--display); font-size: 22px; }
.older { display: block; margin: 6px auto 12px; }
.day-sep { display: flex; align-items: center; gap: 10px; margin: 14px 18px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.msg { position: relative; display: flex; gap: 10px; padding: 6px 18px 2px; }
.msg.grouped { padding-top: 1px; }
.msg:hover, .msg.sel { background: #F5F9F9; }
.msg-av { width: 34px; flex-shrink: 0; display: flex; justify-content: center; }
.msg-time-s { font-size: 10px; color: var(--muted); visibility: hidden; padding-top: 4px; }
.msg:hover .msg-time-s { visibility: visible; }
.msg-main { min-width: 0; flex: 1; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.msg-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.mention { background: #FFF1D6; color: #8A4B00; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.msg-quote { display: flex; align-items: baseline; gap: 5px; font-size: 12.5px; color: var(--muted); border-left: 3px solid var(--accent-line); padding: 2px 8px; margin: 2px 0 4px; max-width: 560px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-quote svg { flex-shrink: 0; align-self: center; }
.msg.pending { opacity: .65; }
.msg.failed .msg-body { color: var(--late); }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 1px 8px; font-size: 12.5px; cursor: pointer; min-height: 26px; }
.react.mine { border-color: var(--brand); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.msg-tools { position: absolute; right: 16px; top: -14px; display: none; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px; box-shadow: 0 4px 14px rgba(0,0,0,.08); z-index: 2; }
.msg:hover .msg-tools, .msg.sel .msg-tools, .msg-tools.open { display: flex; }
.msg-tools .emoji { border: 0; background: none; font-size: 18px; width: 34px; height: 32px; border-radius: 8px; cursor: pointer; }
.msg-tools .emoji:hover { background: #F0F3F3; }
.msg-sys { margin: 8px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sys-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); background: #EEF6F5; border-radius: 14px; padding: 4px 12px; max-width: 100%; }
.sys-line svg { color: var(--accent); flex-shrink: 0; }
.task-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 10px; padding: 8px 10px; margin-top: 6px; background: #fff; max-width: 420px; width: 100%; }
.task-card:hover { border-color: var(--accent-line); background: #FAFDFD; }
.new-below { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 16px; padding: 6px 14px;
  background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(0,128,122,.35); cursor: pointer; z-index: 3; }

.composer { border-top: 1px solid var(--line); padding: 10px 16px 12px; position: relative; background: var(--card); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; border: 1px solid #D5DCDC; border-radius: 12px; padding: 6px 6px 6px 12px; background: #fff; }
.composer-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { border: 0; padding: 6px 0; min-height: 24px; max-height: 180px; resize: none; line-height: 1.45; background: transparent; }
.composer textarea:focus { outline: none; }
.send { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; border: 0; background: #E3EAEA; color: #8A9696; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.send.ready { background: linear-gradient(135deg, var(--brand), var(--accent-ink)); color: #fff; }
.composer-hint { margin-top: 4px; padding-left: 4px; }
.composer-ctx { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); background: #F2F7F7; border-radius: 8px 8px 0 0; padding: 4px 6px 4px 10px; margin: 0 4px; }
.mention-pop { position: absolute; left: 16px; bottom: calc(100% - 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 4px; min-width: 260px; z-index: 5; }
.mention-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 8px; border-radius: 7px; text-align: left; cursor: pointer; }
.mention-pop button.on, .mention-pop button:hover { background: var(--accent-soft); }

@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 59px - 64px - env(safe-area-inset-bottom)); }
  .shell.in-conv .bottombar { display: none; }
  .shell.in-conv .chat { height: calc(100dvh - 59px); }
  .chat.has-conv .chat-list { display: none; }
  .chat:not(.has-conv) .chat-empty { display: none; }
  .chat-head { padding: 8px 10px; }
  .msg { padding-left: 12px; padding-right: 12px; }
  .msg-tools { right: 8px; top: auto; bottom: calc(100% - 6px); }
  .composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .composer textarea { font-size: 16px; } /* tránh iPhone tự phóng to khi gõ */
  .chat-head .btn.sm { padding: 0 8px; font-size: 12px; }
}

/* ---------- Cài đặt thông báo ---------- */
.install-hint { background: #FFF8E6; border: 1px solid #F3DDA6; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.install-hint ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.prefs { width: 100%; border-collapse: collapse; margin-top: 4px; }
.prefs th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.prefs td { padding: 8px; border-bottom: 1px solid var(--line2); }
.prefs th:not(:first-child), .prefs td:not(:first-child) { text-align: center; width: 110px; }
