
:root{
  --bg:#F1F5F9; --card:#FFFFFF; --ink:#0F172A; --muted:#64748B;
  --line:#E2E8F0; --brand:#2563EB; --red:#DC2626; --amber:#D97706; --green:#059669;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
  font-size:15px;line-height:1.5}
header{position:sticky;top:0;z-index:20;background:var(--brand);color:#fff;
  padding:12px 14px;display:flex;align-items:center;gap:10px;box-shadow:0 2px 8px rgba(0,0,0,.15)}
header h1{font-size:17px;margin:0;font-weight:700;flex:1}
header .back{color:#fff;text-decoration:none;font-size:20px;font-weight:700;padding:0 6px}
main{padding:12px;max-width:900px;margin:0 auto}
.card{background:var(--card);border-radius:14px;padding:14px;margin-bottom:12px;
  box-shadow:0 1px 3px rgba(15,23,42,.08)}
.card h2{font-size:15px;margin:0 0 10px;display:flex;align-items:center;gap:8px}
.stats{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.stat{flex:1 1 84px;background:#F8FAFC;border:1px solid var(--line);border-radius:10px;
  padding:8px 6px;text-align:center}
.stat b{display:block;font-size:19px;line-height:1.2}
.stat span{font-size:11px;color:var(--muted)}
.stat.red b{color:var(--red)} .stat.amber b{color:var(--amber)} .stat.green b{color:var(--green)}
.row{display:flex;gap:8px;align-items:flex-start}
.row .grow{flex:1;min-width:0}
.t{font-weight:600;word-break:break-word}
.m{font-size:13px;color:var(--muted);word-break:break-word}
.badge{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:999px;
  white-space:nowrap}
.b-done{background:#DCFCE7;color:#15803D}
.b-overdue{background:#FEE2E2;color:#B91C1C}
.b-pending{background:#FEF3C7;color:#B45309}
.b-info{background:#DBEAFE;color:#1D4ED8}
.btn{border:0;border-radius:10px;padding:9px 12px;font-size:13px;font-weight:600;
  cursor:pointer;color:#fff;background:var(--brand);min-height:40px}
.btn.ghost{background:#E2E8F0;color:#334155}
.btn.ok{background:var(--green)}
.btn.sm{padding:6px 10px;font-size:12px;min-height:34px}
.empty{text-align:center;color:var(--muted);padding:26px 10px}
.navlink{display:block;text-decoration:none;color:inherit}
.install-banner{border:2px dashed var(--brand);background:linear-gradient(180deg,#EFF6FF,#FFFFFF)}
.install-banner h2{color:#1D4ED8}
.filter{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.filter button{border:1px solid var(--line);background:#fff;border-radius:999px;
  padding:7px 13px;font-size:13px;cursor:pointer;color:#475569}
.filter button.on{background:var(--brand);color:#fff;border-color:var(--brand)}
/* [12/11/2026] Badge số lượng trên nút lọc */
.filter button .cnt{display:inline-block;margin-left:5px;padding:1px 7px;
  border-radius:999px;background:#E2E8F0;color:#334155;font-size:11px;
  font-weight:700;line-height:16px;vertical-align:1px}
.filter button.on .cnt{background:rgba(255,255,255,.25);color:#fff}
select,input[type=search]{width:100%;padding:10px;border:1px solid var(--line);border-radius:10px;
  font-size:14px;background:#fff;margin-bottom:10px}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{text-align:left;padding:8px 6px;border-bottom:1px solid var(--line);vertical-align:top}
th{font-size:12px;color:var(--muted);font-weight:700}
footer{text-align:center;color:var(--muted);font-size:12px;padding:18px}
.spin{display:inline-block;width:14px;height:14px;border:2px solid #fff;border-top-color:transparent;
  border-radius:50%;animation:sp .7s linear infinite;vertical-align:-2px;margin-right:6px}
@keyframes sp{to{transform:rotate(360deg)}}

/* ===== FORM THÊM / SỬA VIỆC (mobile) ===== */
.modal{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:100;
  display:flex;align-items:flex-end;justify-content:center;padding:0}
.modal.hide{display:none}
.sheet{background:#fff;width:100%;max-width:560px;border-radius:18px 18px 0 0;
  max-height:92vh;overflow-y:auto;padding:16px 14px calc(16px + env(safe-area-inset-bottom));
  box-shadow:0 -4px 20px rgba(0,0,0,.2)}
@media(min-width:640px){.modal{align-items:center;padding:16px}
  .sheet{border-radius:16px;max-height:88vh}}
.sheet h2{font-size:16px;margin:0 0 12px;display:flex;align-items:center;gap:8px}
.sheet .x{margin-left:auto;background:none;border:0;font-size:24px;color:#64748B;
  cursor:pointer;line-height:1;padding:0 4px}

/* ===== [13/11/2026] POPUP NHẮC VIỆC TRÊN ĐIỆN THOẠI =====
   Giống popup nút 19 của app PC: mở app là thấy NGAY việc cần làm,
   không phải cuộn tìm. Hiện dạng bottom-sheet trên điện thoại. */
.vcmodal{position:fixed;inset:0;background:rgba(15,23,42,.62);z-index:200;
  display:flex;align-items:flex-end;justify-content:center;padding:0;
  opacity:1;transition:opacity .18s}
.vcmodal.hide{display:none}
.vcmodal.fading{opacity:0}
.vcsheet{background:#fff;width:100%;max-width:560px;border-radius:20px 20px 0 0;
  max-height:88vh;display:flex;flex-direction:column;
  padding:0 0 calc(10px + env(safe-area-inset-bottom));
  box-shadow:0 -6px 28px rgba(0,0,0,.28);
  animation:vcsheetUp .22s ease-out}
@keyframes vcsheetUp{from{transform:translateY(28px);opacity:.6}to{transform:none;opacity:1}}
@media(min-width:640px){.vcmodal{align-items:center;padding:16px}
  .vcsheet{border-radius:18px;max-height:84vh;animation:none}}
.vchead{background:#FEF3C7;border-bottom:1px solid #FCD34D;padding:12px 14px 10px;
  display:flex;align-items:center;gap:8px;position:relative}
.vchead h2{font-size:16px;margin:0;color:#92400E;font-weight:700;flex:1;
  display:flex;align-items:center;gap:8px}
.vchead .x{background:none;border:0;font-size:26px;color:#92400E;cursor:pointer;
  line-height:1;padding:0 4px;font-weight:700}
.vcbody{overflow-y:auto;padding:10px 14px 4px;-webkit-overflow-scrolling:touch}
.vcitem{display:flex;gap:9px;align-items:flex-start;padding:9px 0;
  border-bottom:1px solid #F1F5F9}
.vcitem:last-child{border-bottom:0}
.vcdot{flex:0 0 auto;width:10px;height:10px;border-radius:50%;margin-top:6px}
.vcdot.late{background:var(--red)}
.vcdot.ok{background:var(--amber)}
.vctxt{flex:1;min-width:0;font-size:14px;line-height:1.45;word-break:break-word}
.vcmeta{font-size:11px;color:var(--muted);margin-top:3px}
.vcdo{flex:0 0 auto;align-self:center;min-height:32px;padding:5px 10px;font-size:12px}
.vcdo:disabled{opacity:.6}
.vcfoot{padding:10px 14px 0;display:flex;gap:8px}
.vcfoot .btn{flex:1;min-height:44px}
.vcempty{padding:26px 10px;text-align:center;color:var(--muted);font-size:14px}
.vcbadge{display:inline-block;background:var(--red);color:#fff;border-radius:999px;
  font-size:11px;font-weight:700;padding:1px 8px;margin-left:4px;vertical-align:2px}
/* Nút nổi (FAB) — mở lại popup nhắc việc bất cứ lúc nào */
.vcfab{position:fixed;right:14px;bottom:calc(18px + env(safe-area-inset-bottom));
  z-index:150;width:56px;height:56px;border-radius:50%;border:0;cursor:pointer;
  background:#F59E0B;color:#fff;font-size:24px;display:none;
  align-items:center;justify-content:center;
  box-shadow:0 4px 14px rgba(0,0,0,.28)}
.vcfab:active{transform:scale(.93)}
.vcfabn{position:absolute;top:-3px;right:-3px;min-width:22px;height:22px;border-radius:999px;
  background:#DC2626;color:#fff;font-size:11px;font-weight:700;padding:0 5px;
  display:none;align-items:center;justify-content:center;border:2px solid #fff}
.field{margin-bottom:12px}
.field>label{display:block;font-size:12px;font-weight:700;color:#334155;margin-bottom:5px}
.field input[type=text],.field input[type=date],.field input[type=time],
.field textarea,.field select{width:100%;padding:11px;border:1px solid var(--line);
  border-radius:10px;font-size:16px;background:#fff;color:var(--ink);font-family:inherit}
.field textarea{min-height:74px;resize:vertical;line-height:1.45}
.field input:focus,.field textarea:focus,.field select:focus{outline:2px solid var(--brand);
  outline-offset:-1px;border-color:var(--brand)}
.req{color:var(--red)}
.hint{font-size:11px;color:var(--muted);margin-top:4px}
/* [06/11/2026] Nút voice to text + trạng thái đang ghi âm */
.btn.mic{flex:0 0 auto;width:46px;height:46px;border-radius:50%;font-size:20px;
  display:flex;align-items:center;justify-content:center;padding:0;
  background:#EFF6FF;color:#1D4ED8;border:2px solid #BFDBFE}
.btn.mic:active{transform:scale(.94)}
.btn.mic.rec{background:#FEE2E2;color:#B91C1C;border-color:#FCA5A5;
  animation:micpulse 1.1s ease-in-out infinite}
@keyframes micpulse{0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.45)}
  50%{box-shadow:0 0 0 8px rgba(220,38,38,0)}}
@media (prefers-reduced-motion:reduce){.btn.mic.rec{animation:none}}
/* [08/11/2026] Nút quay clip */
.btn.rec{background:#FEE2E2;color:#B91C1C;border-color:#FCA5A5;
  animation:micpulse 1.1s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){.btn.rec{animation:none}}
.row2{display:flex;gap:10px}
.row2>*{flex:1;min-width:0}
.chk{display:flex;align-items:center;gap:8px;font-size:13px;color:#475569;
  margin:-6px 0 12px;cursor:pointer}
.chk input{width:18px;height:18px;accent-color:var(--brand)}
.acts{display:flex;gap:10px;margin-top:6px}
.acts>*{flex:1}
.btn.danger{background:var(--red)}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:24px;z-index:200;
  background:#0F172A;color:#fff;padding:11px 18px;border-radius:999px;font-size:13px;
  font-weight:600;box-shadow:0 4px 16px rgba(0,0,0,.3);max-width:90vw;text-align:center}
.toast.err{background:var(--red)}
.toast.ok{background:var(--green)}
.fab{position:fixed;right:16px;bottom:22px;z-index:60;border:0;border-radius:999px;
  background:var(--brand);color:#fff;font-size:15px;font-weight:700;padding:14px 20px;
  box-shadow:0 6px 20px rgba(37,99,235,.45);cursor:pointer;min-height:48px}
@media(max-width:900px){.fab{bottom:calc(20px + env(safe-area-inset-bottom))}}
/* ===== Banner trạng thái mạng (offline-first) ===== */
.netbar{position:sticky;top:0;z-index:70;padding:10px 14px;font-size:13px;font-weight:600;
  text-align:center;line-height:1.4}
.netbar.ok{display:none}
.netbar.off{background:#FEF3C7;color:#92400E;border-bottom:1px solid #FCD34D}
.netbar.wait{background:#DBEAFE;color:#1E40AF;border-bottom:1px solid #93C5FD}
/* [09/11/2026] Nút xoá hết việc chờ gửi nằm trong banner mạng */
.netbar{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px}
.netbar .btn.sm{padding:6px 10px;font-size:12px}
