/* ===== Phong cách thống nhất toàn ứng dụng: xanh lục đậm, nền ấm, điểm nhấn vàng đồng =====
   Bảng màu, cỡ chữ và bo góc của Tailwind được đặt trong index.html (tailwind.config). Tệp này chứa phần còn lại:
   biến thiết kế, font, khung chính, ô nhập, chữ nhỏ, hiệu ứng và dòng danh sách. Không đặt display ở đây
   (tránh đè lớp .hidden của ứng dụng). */
:root {
  --font: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --brand: #065f46; --brand-hover: #047857; --brand-soft: #e7f3ee; --accent: #c9a24b;
  --bg: #e9efeb; --card: #ffffff; --line: #d2ddd6; --line-strong: #a9bbb0;
  --ink: #14211b; --muted: #5b6b63;
  --ok: #15803d; --ok-bg: #eaf6ee; --warn: #b45309; --warn-bg: #fdf3e1; --bad: #b91c1c; --bad-bg: #fdecec;
  --info: #0369a1; --info-bg: #e8f3fa; --me: #6d28d9; --me-bg: #f1ecfc; --neutral: #64748b; --neutral-bg: #eef0f3;
  --r: 12px; --sh1: 0 1px 2px rgba(20,33,27,.06); --sh2: 0 6px 18px rgba(20,33,27,.10);
}
html body { font-family: var(--font); line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
html body input, html body select, html body textarea, html body button { font-family: inherit; }

/* chữ nhỏ lẻ: không dùng cỡ dưới 12px */
html .text-\[7px\], html .text-\[10px\], html .text-\[11px\] { font-size: 12px; }
html .text-\[12px\] { font-size: 13px; }

/* thanh tiêu đề: xanh lục đậm, viền vàng đồng */
html body > header.bg-emerald-900, html body header.bg-emerald-900 { background: linear-gradient(135deg, #0a3a2d, #0f5a45 60%, #136b52); border-bottom: 3px solid var(--accent); }

/* ô nhập: viền xanh khi chọn, dễ thấy khi dùng bàn phím */
html input:not([type="checkbox"]):not([type="radio"]):focus, html select:focus, html textarea:focus { outline: 3px solid rgba(6,95,70,.25); outline-offset: 1px; border-color: var(--brand); }
html button:focus-visible, html a:focus-visible, html [tabindex]:focus-visible { outline: 3px solid rgba(6,95,70,.35); outline-offset: 2px; }
html input::placeholder, html textarea::placeholder { color: #8a948d; }

/* thẻ và bóng đổ nhẹ, đồng đều */
html .shadow, html .shadow-sm { box-shadow: var(--sh1); }
html .shadow-md, html .shadow-lg, html .shadow-xl { box-shadow: var(--sh2); }
html .border-slate-200 { border-color: var(--line); }

/* thanh cuộn ngang gọn */
html ::selection { background: rgba(6,95,70,.18); }

/* ===== Dòng danh sách (Giao việc, Việc được giao, Hẹn công dân) ===== */
.ds-dong { display: flex; flex-direction: column; gap: 6px; }
.ds-dong > * { flex-shrink: 0; } /* trong khung cuộn (bảng chip) hàng không bị co lại */
.ds-hd, .ds-row { display: grid; align-items: center; column-gap: 14px; padding: 0 14px; }
.ds-hd { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 4px; padding-bottom: 4px; }
.ds-row { position: relative; min-height: 56px; padding-top: 9px; padding-bottom: 9px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: var(--r); cursor: pointer; transition: box-shadow .15s, transform .15s, background-color .15s; }
.ds-row:hover { box-shadow: var(--sh2); transform: translateY(-1px); }
.ds-row .t { font-weight: 600; overflow-wrap: anywhere; }
.ds-row .s { font-size: 13px; color: var(--muted); }
.ds-row .tag { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.ds-row .due b { font-weight: 700; }
.ds-late2 { border-left-color: #b91c1c; background: #ffcdd2; }
.ds-late1 { border-left-color: #dc2626; background: #ffe0e3; }
.ds-soon { border-left-color: #d9640a; background: #ffe0c2; }
.ds-me { border-left-color: var(--me); background: #e6dcfb; animation: dsPulse 1.1s ease-in-out 2; }
.ds-new { border-left-color: var(--info); background: #d8edfb; }
.ds-ok { border-left-color: var(--ok); background: #ddf3e4; }
.ds-done { border-left-color: var(--neutral); background: #e4e8ec; color: #4b5a54; } .ds-done .t { font-weight: 500; }
.ds-stop { border-left-color: #8a8f99; background: #e0ddf0; color: var(--muted); } .ds-stop .t { text-decoration: line-through; font-weight: 500; }
.ds-late2 .due b, .ds-late1 .due b { color: var(--bad); } .ds-soon .due b { color: #b45309; }
.ds-flash { animation: dsFlash 1.4s ease-out 1; }
@keyframes dsFlash { 0% { box-shadow: 0 0 0 3px rgba(3,105,161,.4); } 100% { box-shadow: 0 0 0 0 rgba(3,105,161,0); } }
@keyframes dsPulse { 0%, 100% { border-left-color: var(--me); } 50% { border-left-color: #c4b5fd; } }
.ds-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; }
.ds-chip.c-ok { color: var(--ok); background: var(--ok-bg); } .ds-chip.c-warn { color: var(--warn); background: var(--warn-bg); } .ds-chip.c-bad { color: var(--bad); background: var(--bad-bg); }
.ds-chip.c-info { color: var(--info); background: var(--info-bg); } .ds-chip.c-me { color: var(--me); background: var(--me-bg); } .ds-chip.c-neutral { color: var(--neutral); background: var(--neutral-bg); }
.ds-chip.solid.c-bad { background: var(--bad); color: #fff; } .ds-chip.solid.c-me { background: var(--me); color: #fff; }
.ds-grp { margin: 14px 2px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); display: flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; }
.ds-grp small { color: var(--muted); font-weight: 600; } .ds-grp .ln { flex: 1; border-top: 1px solid var(--line); }
.ds-act { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; background: inherit; padding-left: 8px; }
.ds-row:hover .ds-act, .ds-row:focus-within .ds-act { opacity: 1; pointer-events: auto; }
.ds-giao .ds-hd, .ds-giao .ds-row { grid-template-columns: 1.3fr minmax(240px, 3fr) 1.2fr 1.1fr 120px 170px; }
.ds-toi .ds-hd, .ds-toi .ds-row { grid-template-columns: 1.3fr minmax(240px, 3fr) 1.2fr 120px 170px; }
.ds-hen .ds-hd, .ds-hen .ds-row { grid-template-columns: 1.5fr minmax(180px, 2fr) 130px 1fr 120px 170px; }
.ds-mm { display: none; }
.ds-row .ds-mm { font-size: 13px; color: var(--muted); }
.ds-row .cs { justify-self: start; }
/* điện thoại: dòng hai tầng */
@media (max-width: 767px) {
  .ds-hd { visibility: hidden; height: 0; padding: 0; overflow: hidden; }
  .ds-row { grid-template-columns: 1fr auto !important; row-gap: 3px; padding: 9px 10px; }
  .ds-row .o { visibility: hidden; position: absolute; width: 0; height: 0; overflow: hidden; }
  .ds-row .cs { grid-column: 2; grid-row: 1; justify-self: end; }
  .ds-mm { display: block; grid-column: 1 / 3; }
  .ds-act { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ds-row, .ds-flash, .ds-me { animation: none !important; transition: none !important; } .ds-row:hover { transform: none; } }

/* ===== Khối "Văn bản chỉ đạo" ở đầu chi tiết việc ===== */
.vb-khung { background: #fbf8f0; border: 1px solid #eadfc4; border-left: 5px solid var(--accent); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.vb-tit { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.vb-cv { font-size: 17px; font-weight: 600; color: var(--ink); } .vb-cv b { color: var(--brand); font-weight: 800; }
.vb-dong { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 14px; } .vb-dong span { color: var(--muted); min-width: 118px; } .vb-dong b { font-weight: 600; color: var(--ink); }
.vb-muc { border-top: 1px dashed #e3d7b8; padding-top: 10px; }
.vb-nh { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.vb-khung .vb-mota { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink); }

/* ===== Chữ "Quá n ngày / Còn n ngày": đậm, đỏ chói ===== */
html .dn, html .ds-row .dn { color: #e60000 !important; font-weight: 800 !important; }
html .ds-chip.c-warn { color: #e60000; font-weight: 800; }

/* ===== Khối "Nhiệm vụ con" trong chi tiết việc ===== */
.vc-khung { background: #fff; border: 1px solid var(--line-strong); border-left: 5px solid var(--brand); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.vc-tit { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); } .vc-tit b { font-size: 15px; color: var(--ink); font-weight: 700; }
.vc-dong { padding: 8px 8px; border-top: 1px solid var(--line); border-radius: 8px; } .vc-dong:first-child { border-top: 0; }
.vc-nd { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.vc-phu { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--muted); }
.vc-ai { font-weight: 600; }
.vc-cua { background: var(--brand-soft); } .vc-cua .vc-ai { color: var(--brand); font-weight: 800; }
.vc-xong .vc-nd { text-decoration: line-through; font-weight: 500; color: var(--muted); }
.vc-mo { opacity: .78; }

/* ===== Việc con ngay trong danh sách dạng Dòng (cây) ===== */
.ds-caret { background: none; border: 0; cursor: pointer; color: var(--brand); font-size: 15px; line-height: 1; width: 24px; height: 24px; margin-right: 4px; border-radius: 6px; vertical-align: middle; }
.ds-caret:hover { background: var(--brand-soft); }
.ds-con { margin: -2px 0 6px 26px; padding-left: 14px; border-left: 2px solid var(--line-strong); display: flex; flex-direction: column; gap: 3px; }
.ds-con-dong { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 2px 12px; padding: 6px 10px; border-radius: 8px; background: #ddf3e4; border: 1px solid var(--line); border-left: 4px solid var(--ok); cursor: pointer; font-size: 14px; }
.ds-con-dong:hover { box-shadow: var(--sh1); }
.ds-con-dong input { margin-top: 3px; }
.ds-c-late { border-left-color: var(--bad); background: #ffe0e3; } .ds-c-soon { border-left-color: #d9640a; background: #ffe0c2; } .ds-c-done { border-left-color: var(--neutral); background: #e4e8ec; color: #4b5a54; }
.ds-con-dong .cn { flex: 1 1 220px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; } .ds-c-done .cn { text-decoration: line-through; font-weight: 500; }
.ds-con-dong .ca { color: var(--muted); font-size: 13px; } .ds-con-dong .ca.cua { color: var(--brand); font-weight: 800; }
.ds-con-them { font-size: 13px; color: var(--brand); font-weight: 700; padding: 2px 10px; cursor: pointer; }
@media (max-width: 767px) { .ds-con { margin-left: 10px; padding-left: 8px; } }

/* ===== Form Cập nhật công việc hàng ngày (v13) ===== */
#formAddWorkItem .wf-l { display: block; font-size: 13px; font-weight: 600; color: var(--muted, #5b6b63); margin-bottom: 4px; }
#formAddWorkItem .wf-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px; border-radius: 12px; background: #f2f6f3; border: 1px solid #d2ddd6; }
#formAddWorkItem .wf-note { font-size: 13px; color: var(--muted, #5b6b63); align-self: center; }
#formAddWorkItem .wf-card { padding: 14px; border-radius: 12px; border: 1px solid #d2ddd6; background: #fff; }
#formAddWorkItem .group-title { font-size: 15px; font-weight: 800; color: #065f46; padding-bottom: 6px; border-bottom: 2px solid #d1ede0; }
#formAddWorkItem .wf-sub { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #5b6b63; margin-top: 4px; }
#formAddWorkItem .wf-in { position: relative; display: block; }
#formAddWorkItem .wf-n { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 12px; font-size: 16px; font-weight: 700; color: #14211b; background: #fff; }
#formAddWorkItem .wf-in .wf-n { padding-right: 64px; }
#formAddWorkItem .wf-n:focus { outline: none; border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.2); }
#formAddWorkItem .wf-u { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #6b7a73; pointer-events: none; }
#formAddWorkItem .wf-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f2f6f3; border: 1px solid #d2ddd6; box-shadow: 0 -4px 12px rgba(0,0,0,.06); }
#formAddWorkItem .wf-prev { font-size: 15px; color: #14211b; }
#formAddWorkItem .wf-prev b { color: #047857; font-size: 18px; }
#formAddWorkItem .wf-prev span { font-size: 12px; color: #6b7a73; }
@media (max-width: 1023px) { #formAddWorkItem .wf-foot { bottom: 64px; } }

/* Form Giao nhiệm vụ: cỡ chữ nhãn và ô nhập giống form Cập nhật công việc hàng ngày (nhãn 13px đậm vừa, ô nhập 14px) */
#formAssign label.font-bold { font-size: 13px; font-weight: 600; color: var(--muted, #5b6b63); margin-bottom: 4px; }
#formAssign textarea { line-height: 1.5; }
/* Giao việc / Việc được giao: nội dung hiện tối đa 2 dòng; cột Công văn có số đậm và dòng nhỏ ngày, nơi gửi */
.ds-giao .ds-row .c1 .t, .ds-toi .ds-row .c1 .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ds-giao .ds-row .o b, .ds-toi .ds-row .o b { font-weight: 700; color: var(--ink); }

/* Viền form Cập nhật công việc hàng ngày: xanh lá cây */
#workFormBlock { border: 2px solid #3aa879; }
#formAddWorkItem .wf-bar, #formAddWorkItem .wf-card, #formAddWorkItem .wf-foot { border-color: #5fbf93; }
#formAddWorkItem .group-title { border-bottom-color: #5fbf93; }
#formAddWorkItem .wf-n, #formAddWorkItem input[type=text], #formAddWorkItem .vd-txt, #formAddWorkItem select { border-color: #86cfae; }
#formAddWorkItem .wf-n:focus { border-color: #059669; }

/* Ô nhập ngày dd/mm/yyyy (assets/ngay-vn.js): báo đỏ khi ngày không hợp lệ */
.vd-txt.vd-loi { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,.18); }

/* Ô ngày / tháng / tuần dd/mm/yyyy và lịch tự vẽ (assets/ngay-vn.js) */
.vd-wrap { position: relative; display: block; }
.vd-wrap.hidden { display: none; }
.vd-wrap .vd-txt { padding-right: 40px !important; }
.vd-lich { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; min-height: 0 !important; border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.vd-bg { position: fixed; inset: 0; z-index: 2147483000; background: transparent; }
.vd-bg[hidden] { display: none; }
.vd-bg.vd-dt { background: rgba(15,23,20,.45); }
.vd-cal { position: fixed; width: 300px; background: #fff; border: 1px solid #bccbc2; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 10px; font-family: var(--font); color: #14211b; }
.vd-dt .vd-cal { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: 480px; margin: 0 auto; border-radius: 18px 18px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
.vd-dau { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.vd-tieu { flex: 1; text-align: center; font-weight: 700; font-size: 14px; white-space: nowrap; }
.vd-nut { min-width: 36px; height: 40px; border: 0; background: #f2f6f3; border-radius: 10px; font-size: 18px; font-weight: 700; color: #14211b; cursor: pointer; padding: 0; min-height: 0; }
.vd-luoi { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.vd-month .vd-luoi { grid-template-columns: repeat(3, 1fr); }
.vd-thu { text-align: center; font-size: 12px; font-weight: 700; color: #5b6b63; padding: 4px 0; }
.vd-o { height: 42px; border: 1px solid transparent; border-radius: 10px; background: #fff; font-size: 15px; font-weight: 600; color: #14211b; cursor: pointer; padding: 0; min-height: 0; }
.vd-ngoai { color: #9aa8a0; font-weight: 400; }
.vd-homnay { border-color: #0f8560; }
.vd-chon-dang { background: #0f8560 !important; color: #fff !important; border-color: #0f8560; }
.vd-cuoi { display: flex; gap: 8px; margin-top: 10px; }
.vd-chon { flex: 1; height: 42px; border: 1px solid #bccbc2; border-radius: 10px; background: #fff; font-weight: 700; font-size: 14px; color: #14211b; cursor: pointer; min-height: 0; }
.vd-xoa { color: #b91c1c; }
/* Ô giờ 24 giờ: bảng chọn giờ rồi phút, không có nút năm / tháng */
.vd-time .vd-nut { display: none; }
.vd-time.vd-gio .vd-luoi { grid-template-columns: repeat(6, 1fr); }
.vd-time.vd-phut .vd-luoi { grid-template-columns: repeat(4, 1fr); }
.vd-time .vd-quay { grid-column: 1 / -1; font-weight: 700; color: #0f8560; }
