:root {
  --blue: #0068ff;
  --blue-dark: #0052cc;
  --blue-light: #e8f1ff;
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1a1d21;
  --muted: #6b7280;
  --border: #e5e7eb;
  --red: #e02424;
  --red-light: #fde8e8;
  --orange: #c05621;
  --orange-light: #fff3e0;
  --green: #046c4e;
  --green-light: #def7ec;
  --gray-chip: #eef0f3;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: 90px; }
#app:has(.chat-room) { padding-bottom: 0; }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: var(--blue); color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
}
.header .title { font-size: 19px; font-weight: 700; flex: 1; }
.header .back {
  background: none; border: none; color: #fff; font-size: 22px;
  padding: 2px 8px 2px 0; cursor: pointer; line-height: 1;
}
.header .me {
  background: rgba(255,255,255,.18); border: none; color: #fff;
  padding: 6px 12px; border-radius: 99px; font-size: 14px; cursor: pointer;
  white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- summary ---------- */
.summary { display: flex; gap: 8px; padding: 12px 16px 0; flex-wrap: wrap; }
.summary .chip {
  background: var(--card); border-radius: 99px; padding: 6px 13px;
  font-size: 13.5px; box-shadow: var(--shadow); color: var(--muted);
}
.summary .chip b { color: var(--text); }
.summary .chip.late b { color: var(--red); }

/* ---------- tabs & filters ---------- */
.tabs { display: flex; gap: 6px; padding: 12px 16px 4px; }
.tabs button {
  flex: 1; padding: 9px 0; border-radius: 10px; border: none;
  background: var(--gray-chip); color: var(--muted);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.tabs button.on { background: var(--blue); color: #fff; }

.filters { display: flex; gap: 7px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); font-size: 13.5px;
  white-space: nowrap; cursor: pointer; flex-shrink: 0; line-height: 1.6;
}
/* hàng lọc trên máy tính: select + nút cùng 1 dòng, tự xuống dòng khi hẹp, không cắt chữ */
.filters-row { flex-wrap: wrap; overflow: visible; row-gap: 10px; }
.filters button.on { background: var(--blue-light); border-color: var(--blue); color: var(--blue-dark); font-weight: 600; }

/* ---------- task cards ---------- */
.list { padding: 4px 16px; display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); cursor: pointer; border-left: 4px solid transparent;
}
.task-card.late { border-left-color: var(--red); }
.task-card.done { opacity: .62; }
.task-card .t-title { font-weight: 600; font-size: 16px; margin-bottom: 7px; }
.task-card.done .t-title { text-decoration: line-through; }
.task-card .t-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.badge.todo { background: var(--gray-chip); color: var(--muted); }
.badge.doing { background: var(--blue-light); color: var(--blue-dark); }
.badge.done { background: var(--green-light); color: var(--green); }
.badge.deadline { background: var(--gray-chip); color: var(--muted); font-weight: 500; }
.badge.deadline.soon { background: var(--orange-light); color: var(--orange); }
.badge.deadline.late { background: var(--red-light); color: var(--red); }
.badge.person { background: transparent; color: var(--muted); font-weight: 500; padding-left: 0; }
.badge.q { background: var(--orange-light); color: var(--orange); }

.empty { text-align: center; color: var(--muted); padding: 48px 24px; font-size: 15px; }
.empty .big { font-size: 44px; margin-bottom: 10px; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 18px; bottom: 22px; z-index: 30;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--blue); color: #fff; border: none;
  font-size: 30px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 104, 255, .4);
}
@media (min-width: 680px) { .fab { right: calc(50vw - 320px + 18px); } }

/* ---------- detail ---------- */
.detail { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.detail h2 { font-size: 19px; margin-bottom: 10px; }
.detail .desc { color: var(--text); white-space: pre-wrap; margin-top: 10px; font-size: 15px; }
.kv { display: flex; gap: 8px; margin-top: 8px; font-size: 14.5px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.task-timeline { margin-top: 10px; padding: 10px 13px; background: var(--bg); border-radius: 11px; }
.task-timeline .kv { margin-top: 4px; }
.task-timeline .kv:first-child { margin-top: 0; }
.task-timeline b { color: var(--text); font-weight: 600; }

.status-row { display: flex; gap: 8px; }
.status-row button {
  flex: 1; padding: 12px 0; border-radius: 11px; font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer;
}
.status-row button.on.todo { background: var(--gray-chip); border-color: #9ca3af; color: var(--text); }
.status-row button.on.doing { background: var(--blue-light); border-color: var(--blue); color: var(--blue-dark); }
.status-row button.on.done { background: var(--green-light); border-color: var(--green); color: var(--green); }

.share-row { display: flex; gap: 8px; }
.share-row button {
  flex: 1; padding: 11px 0; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  border: none; cursor: pointer;
}
.btn-zalo { background: var(--blue); color: #fff; }
.btn-copy { background: var(--gray-chip); color: var(--text); }
.btn-danger { background: none; border: none; color: var(--red); font-size: 14px; cursor: pointer; padding: 10px; }

/* ---------- comments ---------- */
.comments h3 { font-size: 16px; margin-bottom: 12px; }
.cmt { display: flex; gap: 9px; margin-bottom: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.cmt .bubble { background: var(--bg); border-radius: 4px 14px 14px 14px; padding: 8px 12px; max-width: 85%; }
.cmt.mine { flex-direction: row-reverse; }
.cmt.mine .bubble { background: var(--blue-light); border-radius: 14px 4px 14px 14px; }
.cmt .who { font-size: 13.5px; color: var(--muted); margin-bottom: 2px; }
.cmt .txt { font-size: 16px; white-space: pre-wrap; }
.cmt .when { font-size: 12px; color: var(--muted); margin-top: 3px; }

.cmt-form { display: flex; gap: 8px; margin-top: 6px; }
.cmt-form textarea {
  flex: 1; border: 1.5px solid var(--border); border-radius: 11px;
  padding: 10px 12px; font-size: 15px; font-family: inherit; resize: none; min-height: 44px; max-height: 120px;
}
.cmt-form textarea:focus { outline: none; border-color: var(--blue); }
.cmt-form button {
  background: var(--blue); color: #fff; border: none; border-radius: 11px;
  padding: 0 18px; font-size: 15px; font-weight: 600; cursor: pointer;
}

/* ---------- forms ---------- */
.form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.form label { font-size: 14px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 12px 13px; border: 1.5px solid var(--border);
  border-radius: 11px; font-size: 16px; font-family: inherit; background: var(--card);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--blue); }
.form textarea { min-height: 90px; resize: vertical; }
.btn-primary {
  width: 100%; padding: 14px 0; border-radius: 12px; border: none;
  background: var(--blue); color: #fff; font-size: 16.5px; font-weight: 700; cursor: pointer;
}
.btn-primary:active { background: var(--blue-dark); }

/* ---------- members ---------- */
.member-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.member-row .m-name { flex: 1; font-weight: 600; font-size: 15.5px; }
.member-row .m-role { font-size: 12.5px; color: var(--muted); }
.member-row .rm, .member-row .ed { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.member-row .ed:hover, .member-row .rm:hover { color: var(--text); }

/* ---------- user picker overlay ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 20, 40, .5); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 680px) { .overlay { align-items: center; } }
.sheet {
  background: var(--card); border-radius: 18px 18px 0 0; width: 100%; max-width: 640px;
  padding: 22px 18px 30px; max-height: 80vh; overflow-y: auto;
}
@media (min-width: 680px) { .sheet { border-radius: 18px; width: 420px; } }
.sheet h3 { font-size: 18px; margin-bottom: 4px; }
.sheet .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.pick-user {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--bg); border: none; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 9px; cursor: pointer; text-align: left; font-size: 16px; font-weight: 600;
}
.pick-user:active { background: var(--blue-light); }
.pick-user .pr { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* hộp thoại xác nhận */
.confirm-sheet { max-width: 92vw; padding: 34px 32px 32px; }
@media (min-width: 680px) { .overlay .sheet.confirm-sheet { width: 560px; } }
.confirm-sheet h3 { font-size: 24px; margin-bottom: 10px; }
.confirm-sheet .sub { font-size: 17px; line-height: 1.55; margin-bottom: 18px; }
.confirm-sheet .cf-btn { flex: 1; font-size: 18px; padding: 16px 0; border-radius: 13px; }

.toast {
  position: fixed; bottom: 95px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 99px;
  font-size: 14.5px; z-index: 60; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  animation: toastIn .2s ease;
  max-width: 88vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.section-note { padding: 0 16px; color: var(--muted); font-size: 13.5px; }

/* ---------- lịch ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.cal-cell {
  min-height: 96px; background: var(--bg); border-radius: 10px; padding: 5px;
  cursor: pointer; border: 1.5px solid transparent; overflow: hidden;
}
.cal-cell:hover { border-color: var(--border); }
.cal-cell.off { background: transparent; cursor: default; }
.cal-cell.today { border-color: var(--blue); background: var(--blue-light); }
.cal-num { font-size: 13.5px; font-weight: 700; margin: 1px 3px 4px; }
.cal-cell.today .cal-num { color: var(--blue-dark); }
.cal-chip {
  font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 600;
}
.cal-chip.ev { background: var(--green-light); color: var(--green); }
.cal-chip.tk { background: var(--blue-light); color: var(--blue-dark); }
.cal-chip.tk-late { background: var(--red-light); color: var(--red); }
.cal-chip.tk-done { background: var(--gray-chip); color: var(--muted); text-decoration: line-through; font-weight: 500; }
.cal-chip.pl { background: var(--orange-light); color: var(--orange); font-weight: 500; }
.cal-chip.more { background: transparent; color: var(--muted); font-weight: 500; }
.cal-chip.big { font-size: 15px; padding: 10px 12px; border-radius: 10px; white-space: normal; margin-top: 6px; }
.ev-guests { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ev-guest {
  display: flex; align-items: center; gap: 6px; background: var(--bg);
  padding: 8px 12px; border-radius: 10px; font-size: 15px; cursor: pointer;
}
.ev-guest input { width: 17px; height: 17px; }
@media (max-width: 1023px) {
  .cal-cell { min-height: 64px; padding: 3px; }
  .cal-chip { font-size: 10px; padding: 2px 4px; }
  .cal-num { font-size: 12px; }
}

/* ---------- trung tâm thông báo ---------- */
.notif-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 99px; background: var(--red); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1;
}
.ntf-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px; border-radius: 11px; cursor: pointer;
}
.ntf-row:hover { background: var(--bg); }
.ntf-row.unread { background: var(--blue-light); }
.ntf-row.unread + .ntf-row.unread { margin-top: 3px; }
.ntf-ic { font-size: 24px; flex-shrink: 0; }
.ntf-body { flex: 1; min-width: 0; }
.ntf-title { font-weight: 700; font-size: 16px; }
.ntf-text { font-size: 15px; color: var(--text); margin-top: 2px; word-break: break-word; }
.ntf-time { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ntf-row .c-dot { margin-top: 6px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 640px; z-index: 25;
  display: flex; background: var(--card); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1; padding: 8px 0 9px; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 20px; color: var(--muted); position: relative;
}
.bottom-nav button span { font-size: 10px; font-weight: 600; white-space: nowrap; }
.bottom-nav button.on { color: var(--blue); }
.bottom-nav .dot {
  position: absolute; top: 6px; right: calc(50% - 20px);
  width: 9px; height: 9px; border-radius: 50%; background: var(--red);
}
.bottom-nav .bn-count {
  position: absolute; top: 2px; right: calc(50% - 24px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.fab { bottom: 76px; }

/* ---------- chat list ---------- */
.chat-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer;
}
.chat-row .avatar { width: 42px; height: 42px; font-size: 16px; }
.chat-row .c-body { flex: 1; min-width: 0; }
.chat-row .c-name { font-weight: 600; font-size: 15.5px; }
.chat-row .c-name small { color: var(--muted); font-weight: 400; }
.chat-row .c-last { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .c-last { color: var(--text); font-weight: 600; }
.chat-row .c-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.chat-row .c-time { font-size: 11.5px; color: var(--muted); }
.chat-row .c-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ---------- chat room ---------- */
.chat-room {
  display: flex; flex-direction: column;
  height: calc(100vh - 54px); height: calc(100dvh - 54px);
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 6px; }
.chat-input {
  display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--border);
}
.chat-input textarea {
  flex: 1; border: 1.5px solid var(--border); border-radius: 11px;
  padding: 10px 12px; font-size: 15px; font-family: inherit; resize: none; min-height: 42px; max-height: 110px;
}
.chat-input textarea:focus { outline: none; border-color: var(--blue); }
.chat-input .ci-send {
  background: var(--blue); color: #fff; border: none; border-radius: 11px;
  padding: 0 20px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.chat-input .ci-attach {
  background: var(--gray-chip); border: none; border-radius: 11px;
  width: 44px; font-size: 20px; cursor: pointer; flex-shrink: 0;
}
.chat-input .ci-attach:hover { background: var(--border); }

/* hình ảnh & file trong chat */
.bubble.img-bubble { background: transparent !important; padding: 0 !important; }
.cmt.mine .bubble.img-bubble { background: transparent !important; }
.msg-img {
  max-width: min(300px, 70vw); max-height: 300px; border-radius: 14px;
  display: block; cursor: zoom-in; box-shadow: var(--shadow);
}
.img-bubble .who { margin: 0 0 4px 4px; }
.img-bubble .when { margin: 4px 0 0 4px; }
.msg-file {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--text); min-width: 200px;
}
.msg-file .mf-ic { font-size: 26px; }
.msg-file .mf-body { display: flex; flex-direction: column; min-width: 0; }
.msg-file .mf-name { font-weight: 600; font-size: 15px; word-break: break-all; }
.msg-file .mf-size { font-size: 12.5px; color: var(--muted); }

/* ---------- dùng chung ---------- */
.input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border);
  border-radius: 11px; font-size: 15px; font-family: inherit; background: var(--card);
}
.input:focus { outline: none; border-color: var(--blue); }
textarea.input { min-height: 90px; resize: vertical; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-inline { width: auto; padding: 10px 20px; font-size: 15px; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.logo-img { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; background: #fff; flex-shrink: 0; }
.logo-img.sm { width: 32px; height: 32px; border-radius: 8px; }
.spacer { flex: 1; }

/* ---------- PC (>=1024px): bố cục kiểu Lark ---------- */
@media (min-width: 1024px) {
  #app { max-width: none; padding-bottom: 0; }
  .bottom-nav, .fab { display: none !important; }

  .shell { display: flex; height: 100vh; overflow: hidden; }
  .rail {
    width: 224px; flex-shrink: 0; background: var(--card);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 16px 10px 14px; gap: 3px;
  }
  .rail .logo { display: flex; align-items: center; gap: 11px; padding: 0 10px 18px; }
  .rail .logo-t1 { display: block; font-size: 19px; font-weight: 800; color: #2e7d32; line-height: 1.15; }
  .rail .logo-t2 { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
  .rail .nav-item {
    display: flex; align-items: center; gap: 12px; padding: 13px 14px;
    border: none; background: none; border-radius: 10px; font-size: 16.5px; font-weight: 500;
    color: var(--text); cursor: pointer; text-align: left; position: relative; font-family: inherit;
  }
  .rail .nav-item:hover { background: var(--bg); }
  .rail .nav-item.on { background: var(--blue-light); color: var(--blue-dark); font-weight: 700; }
  .rail .ni-ic { font-size: 21px; width: 26px; text-align: center; }
  .rail .nav-item .dot { position: absolute; top: 9px; left: 26px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  .rail-user { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; border-radius: 10px; }
  .rail-user:hover { background: var(--bg); }
  .main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }

  /* bảng công việc */
  .dt-toolbar { display: flex; align-items: center; gap: 18px; padding: 24px 28px 0; }
  .dt-title { font-size: 26px; font-weight: 800; }
  .dt-table { margin: 16px 28px 28px; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
  .dt-row {
    display: grid; grid-template-columns: minmax(240px, 1fr) 140px 190px 170px 90px;
    align-items: center; gap: 10px; padding: 15px 20px;
    border-bottom: 1px solid var(--border); cursor: pointer; font-size: 16px;
  }
  .dt-row:last-child { border-bottom: none; }
  .dt-row:not(.dt-head):hover { background: #f8fafc; }
  .dt-row.selected { background: var(--blue-light); }
  .dt-row.dt-head { font-size: 13.5px; color: var(--muted); font-weight: 700; cursor: default; background: #fafbfc; text-transform: uppercase; letter-spacing: .3px; }
  .badge { font-size: 13.5px; }
  .filters button { font-size: 14.5px; padding: 8px 16px; }
  .tabs button { font-size: 15.5px; }
  .dt-c-title { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .dt-c-title .late-bar { width: 4px; height: 18px; border-radius: 2px; background: var(--red); flex-shrink: 0; }
  .dt-row.done-row .dt-c-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
  .dt-c-person { display: flex; align-items: center; gap: 7px; }

  /* panel chi tiết trượt phải */
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 40, .28); z-index: 39; }
  .drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 470px; background: var(--bg);
    box-shadow: -10px 0 30px rgba(0,0,0,.15); z-index: 40; overflow-y: auto;
    animation: drawerIn .18s ease;
  }
  @keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .drawer-head {
    position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--border);
    padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; font-weight: 700;
  }
  .drawer-close { border: none; background: var(--gray-chip); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; color: var(--muted); }
  .drawer-close:hover { background: var(--border); }

  /* modal giao việc */
  .modal { position: fixed; inset: 0; background: rgba(10, 20, 40, .45); z-index: 50; display: flex; align-items: center; justify-content: center; }
  .modal .box { background: var(--card); border-radius: 16px; width: 560px; max-width: 92vw; max-height: 88vh; overflow-y: auto; padding: 22px; }
  .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .modal-head h3 { font-size: 18px; }
  .modal .form { display: flex; flex-direction: column; gap: 13px; }
  .modal .form label { font-size: 13.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; }

  /* chat 2 cột */
  .chat-split { display: flex; flex: 1; min-height: 0; }
  .convo-col { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--card); overflow-y: auto; }
  .convo-head { padding: 20px 16px 12px; font-size: 20px; font-weight: 800; }
  .convo-col .chat-row { border-radius: 0; box-shadow: none; padding: 12px 14px; }
  .convo-col .chat-row:hover { background: var(--bg); }
  .convo-col .chat-row.selected { background: var(--blue-light); }
  .convo-col .chat-row .c-name { font-size: 16px; }
  .convo-col .chat-row .c-last { font-size: 14px; }
  .thread-col { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
  .thread-head { padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 18px; }
  .thread-col .chat-msgs { flex: 1; overflow-y: auto; padding: 18px 22px 8px; }
  .thread-col .chat-input { padding: 12px 18px 14px; }
  .thread-col .chat-input textarea { font-size: 17px; min-height: 48px; }
  .thread-col .chat-input .ci-send { font-size: 17px; padding: 0 26px; }
  .thread-col .chat-input .ci-attach { width: 50px; font-size: 22px; }
  .thread-col .msg-img { max-width: 380px; max-height: 360px; }
  .thread-col .cmt { margin-bottom: 16px; }
  .thread-col .cmt .bubble { max-width: 60%; padding: 11px 15px; }
  .thread-col .cmt .txt { font-size: 17.5px; }
  .thread-col .cmt .who { font-size: 14px; }
  .thread-col .cmt .when { font-size: 13px; }
  .thread-col .avatar { width: 40px; height: 40px; font-size: 16px; }
  .thread-col .task-bubble .tb-title { font-size: 17px; }
  .thread-col .task-bubble .tb-open, .thread-col .task-bubble .tb-meta { font-size: 14.5px; }
  .att-table { font-size: 15.5px; }
  .rp-tile .rp-num { font-size: 30px; }
  .rp-tile .rp-lbl { font-size: 14px; }

  .members-wrap { padding: 14px 28px 28px; max-width: 640px; display: flex; flex-direction: column; gap: 10px; }

  /* chấm công + báo cáo */
  .module-wrap { padding: 14px 28px 28px; max-width: 900px; display: flex; flex-direction: column; gap: 14px; }
  .module-wrap:has(.rp-split) { max-width: 1440px; } /* báo cáo dùng 2 cột nên cần rộng hơn */
}

/* ---------- app chấm công nhúng ---------- */
.att-frame { border: none; width: 100%; flex: 1; background: #fff; display: block; min-height: 0; }
.att-frame.mobile { height: calc(100vh - 118px); height: calc(100dvh - 118px); }
#app:has(.att-frame.mobile) { padding-bottom: 0; }

/* ---------- chấm công ---------- */
.att-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.att-clock { font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.att-btns { display: flex; gap: 10px; }
.att-btns .btn-primary { width: auto; padding: 13px 26px; }
.att-btns .btn-out { background: var(--card); color: var(--blue-dark); border: 1.5px solid var(--blue); }
.att-status { color: var(--muted); font-size: 14px; margin-top: 6px; }
.att-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.att-table th { text-align: left; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.att-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.att-table tr:last-child td { border-bottom: none; }
.att-ok { color: var(--green); font-weight: 600; }
.att-miss { color: var(--muted); }

/* ---------- báo cáo ngày ---------- */
.wl-add { margin-top: 12px; padding: 14px; background: var(--bg); border-radius: 12px; }
.wl-add-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.wl-add-row .input { flex: 1; min-width: 150px; font-size: 16px; }
.wl-muted { color: var(--muted); font-size: 15.5px; }
.wl-edit {
  width: 100%; min-width: 130px; font-size: 15.5px; font-family: inherit;
  border: none; border-bottom: 1.5px dotted #c3c9d2;
  background: transparent; padding: 6px 2px; border-radius: 0; color: var(--text);
}
.wl-edit::placeholder { color: #c3c9d2; letter-spacing: 2px; }
.wl-edit:hover { border-bottom-color: #9ca3af; }
.wl-edit:focus { outline: none; border-bottom: 1.5px solid var(--blue); }
.rp-navbtn { width: 42px; padding: 10px 0; background: var(--gray-chip); color: var(--text); }

/* bố cục 2 cột: phiếu chi tiết bên trái + nhật ký 14 ngày bên phải */
.rp-split { display: flex; flex-direction: column; gap: 14px; }
.rp-main { display: flex; flex-direction: column; gap: 14px; flex: 1; min-width: 0; }
.rp-side { min-width: 0; }
@media (min-width: 1024px) {
  .rp-split { flex-direction: row; align-items: flex-start; }
  .rp-side { width: 400px; flex-shrink: 0; position: sticky; top: 14px; }
  .rp-side .panel { max-height: calc(100vh - 40px); overflow-y: auto; }
}
.hist-day { padding: 11px 12px; border-radius: 11px; cursor: pointer; border: 1.5px solid transparent; margin-bottom: 4px; }
.hist-day:hover { background: var(--bg); }
.hist-day.on { background: var(--blue-light); border-color: var(--blue); }
.hist-head { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 15.5px; }
.hist-toggle {
  background: var(--gray-chip); border: none; border-radius: 7px;
  width: 28px; height: 28px; font-size: 14px; cursor: pointer; color: var(--blue-dark);
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.hist-toggle:hover { background: var(--border); }
.hist-items { margin-top: 6px; }
.hist-head .hist-empty { font-weight: 400; }
.hist-item { font-size: 15px; padding: 2.5px 0 2.5px 4px; display: flex; gap: 7px; align-items: flex-start; line-height: 1.4; }
.hist-item b { color: var(--blue-dark); }
.hist-empty { color: var(--muted); font-size: 14px; padding-left: 4px; }
.att-table td .rm { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.att-table td .rm:hover { color: var(--red); }

/* ---------- báo cáo ---------- */
.rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rp-tile { background: var(--card); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.rp-tile .rp-num { font-size: 26px; font-weight: 800; }
.rp-tile .rp-lbl { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rp-tile.late .rp-num { color: var(--red); }
.rp-tile.done .rp-num { color: var(--green); }
.rp-tile.doing .rp-num { color: var(--blue-dark); }
.rp-bar { height: 8px; border-radius: 99px; background: var(--gray-chip); overflow: hidden; margin-top: 6px; }
.rp-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }

/* ---------- thẻ công việc trong chat ---------- */
.chat-msgs .cmt .bubble { cursor: pointer; }
.task-bubble {
  background: var(--card) !important;
  border: 1.5px solid var(--blue);
  border-radius: 14px !important;
  min-width: 220px;
}
.task-bubble .tb-head { font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: .3px; }
.task-bubble .tb-title { font-weight: 700; font-size: 15px; margin-top: 3px; }
.task-bubble .tb-meta { font-size: 13px; color: var(--muted); margin-top: 5px; }
.task-bubble .tb-open { font-size: 13px; color: var(--blue); font-weight: 600; margin-top: 7px; }

/* ==== Phóng to cỡ chữ toàn siêu app (yêu cầu 09/2026) ==== */
body { font-size: 17px; }
.att-table { font-size: 16px; }
.att-table th { font-size: 14px; }
.att-table td { padding: 11px 10px; }
.badge { font-size: 14.5px; }
.input { font-size: 16.5px; }
.section-note { font-size: 15px; }
.panel .kv { font-size: 15.5px; }
.detail .desc { font-size: 16.5px; }
.rp-tile .rp-num { font-size: 32px; }
.rp-tile .rp-lbl { font-size: 15px; }
.summary .chip { font-size: 15px; }
.task-card .t-title { font-size: 17px; }
.chat-row .c-name { font-size: 17px; }
.chat-row .c-last { font-size: 14.5px; }
@media (min-width: 1024px) {
  .att-table { font-size: 16.5px; }
  .rail .nav-item { font-size: 17.5px; }
  .tabs button { font-size: 16.5px; }
  .filters button { font-size: 15.5px; }
  .dt-row { font-size: 16.5px; }
}
