:root{--sidew:212px;
  --navy:#123a5e; --navy2:#1b4e7a; --amber:#f6a623; --amber-dark:#d98a06;
  --bg:#f2f5f8; --card:#fff; --line:#e3e9ef; --text:#16232e; --muted:#6b7c8c;
  --green:#1a9c5b; --red:#d8402f; --orange:#e8811a; --blue:#2b74d4; --purple:#7b53c1;
  --radius:16px; --shadow:0 2px 10px rgba(18,58,94,.08);
  --tabh:64px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
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;
  padding-bottom:env(safe-area-inset-bottom);
}
.hidden{display:none !important}
.hidden-input{position:fixed;left:-9999px;width:1px;height:1px;opacity:0}
.muted{color:var(--muted);font-size:13px}
button{font-family:inherit;font-size:16px}

/* ---------- ĐĂNG NHẬP ---------- */
.login-wrap{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:20px;
  background:linear-gradient(160deg,#123a5e,#1b4e7a 55%,#2a6ea8)}
.login-card{width:100%;max-width:380px;background:#fff;border-radius:22px;padding:28px 22px 22px;box-shadow:0 18px 50px rgba(0,0,0,.3)}
.logo{font-size:30px;font-weight:800;letter-spacing:.5px;color:var(--navy);text-align:center}
.logo span{color:var(--amber)}
.login-sub{text-align:center;color:var(--muted);font-size:14px;margin:6px 0 22px}
.fld{display:block;margin-bottom:14px}
.fld>span{display:block;font-size:13px;font-weight:600;color:var(--muted);margin-bottom:6px}
.fld input,.fld select,.fld textarea{width:100%;padding:14px 14px;font-size:17px;border:1.5px solid var(--line);
  border-radius:12px;background:#fbfcfd;color:var(--text)}
.fld input:focus,.fld select:focus,.fld textarea:focus{outline:none;border-color:var(--navy2);background:#fff}
.showpass{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);margin-bottom:14px}
.showpass input{width:18px;height:18px}
.err{color:var(--red);font-size:14px;min-height:20px;margin-bottom:8px;font-weight:600}
.hint{text-align:center;color:var(--muted);font-size:12.5px;margin:14px 0 0}

/* ---------- NÚT ---------- */
.btn{border:none;border-radius:12px;padding:12px 16px;font-weight:700;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;background:#eef2f6;color:var(--text)}
.btn:active{transform:scale(.98)}
.btn-lg{width:100%;padding:16px;font-size:18px}
.btn-primary{background:var(--navy);color:#fff}
.btn-amber{background:var(--amber);color:#3b2600}
.btn-green{background:var(--green);color:#fff}
.btn-red{background:var(--red);color:#fff}
.btn-ghost{background:#fff;border:1.5px solid var(--line)}
.btn[disabled]{opacity:.5;pointer-events:none}
.icon-btn{background:rgba(255,255,255,.14);border:none;color:#fff;width:42px;height:42px;border-radius:12px;font-size:20px;cursor:pointer}

/* ---------- TOP BAR ---------- */
.topbar{position:sticky;top:0;z-index:30;background:var(--navy);color:#fff;display:flex;align-items:center;
  justify-content:space-between;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top));box-shadow:0 2px 8px rgba(0,0,0,.15)}
.tb-left{display:flex;flex-direction:column;gap:2px;min-width:0}
.brand{font-weight:800;font-size:18px;letter-spacing:.3px}
.brand span{color:var(--amber)}
.who{font-size:12.5px;opacity:.92;display:flex;gap:8px;align-items:center}
.chip-role{background:var(--amber);color:#3b2600;border-radius:20px;padding:1px 9px;font-size:11px;font-weight:800}

/* ---------- DRAWER ---------- */
.drawer{position:fixed;inset:0;z-index:60;background:rgba(10,25,40,.5)}
.drawer-inner{position:absolute;right:0;top:0;bottom:0;width:min(320px,86vw);background:#fff;padding:20px 16px;
  padding-top:calc(20px + env(safe-area-inset-top));display:flex;flex-direction:column;gap:6px;overflow:auto}
.drawer-user{display:flex;gap:12px;align-items:center;padding-bottom:14px;margin-bottom:8px;border-bottom:1px solid var(--line)}
.avatar{width:46px;height:46px;border-radius:50%;background:var(--navy);color:#fff;display:flex;align-items:center;
  justify-content:center;font-weight:800;font-size:18px;flex:none}
.drawer-item{text-align:left;background:none;border:none;padding:14px 10px;border-radius:12px;font-size:16px;cursor:pointer}
.drawer-item:hover{background:#f2f5f8}
.drawer-item.danger{color:var(--red);font-weight:700}
.drawer-ver{margin-top:auto;color:var(--muted);font-size:12px;text-align:center}

/* ---------- TABBAR ---------- */
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:40;background:#fff;border-top:1px solid var(--line);
  display:flex;padding-bottom:env(safe-area-inset-bottom)}
.tabbar button{flex:1;background:none;border:none;padding:8px 2px 10px;display:flex;flex-direction:column;
  align-items:center;gap:2px;color:var(--muted);font-size:11px;font-weight:600;cursor:pointer;position:relative}
.tabbar button .ic{font-size:21px;line-height:1}
.tabbar button.on{color:var(--navy)}
.tabbar button.on .ic{transform:translateY(-1px)}
.tab-badge{position:absolute;top:3px;left:50%;margin-left:3px;background:var(--red);color:#fff;font-size:10px;
  min-width:18px;height:18px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px}

/* ---------- LAYOUT ---------- */
main{padding:14px 14px calc(var(--tabh) + 24px);max-width:900px;margin:0 auto}
.page-title{font-size:20px;font-weight:800;margin:4px 0 12px}
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;margin-bottom:12px}
.card h3{margin:0 0 10px;font-size:16px}
.row{display:flex;gap:10px;align-items:center}
.row.wrap{flex-wrap:wrap}
.spacer{flex:1}
.center{text-align:center}

/* ---------- THẺ CÔNG VIỆC ---------- */
.job{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:13px 14px;margin-bottom:11px;
  border-left:5px solid var(--line);cursor:pointer}
.job:active{background:#fafcfe}
.job.p-gap{border-left-color:var(--red)}
.job.p-cao{border-left-color:var(--orange)}
.job.p-tb{border-left-color:var(--blue)}
.job.p-thap{border-left-color:#9bb0c2}
.job-top{display:flex;gap:8px;align-items:flex-start;margin-bottom:6px}
.job-title{font-weight:700;font-size:16.5px;flex:1;word-break:break-word}
.job-meta{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 4px}
.tag{background:#eef3f8;color:#3d5568;border-radius:20px;padding:3px 10px;font-size:12px;font-weight:600;white-space:nowrap}
.tag.site{background:#e7f0fb;color:#1d5ba6}
.tag.team{background:#eae6f8;color:#5b3ea8}
.tag.gap{background:#fde3df;color:#b32a1a}
.tag.cao{background:#fdeedb;color:#a35a06}
.tag.late{background:#fde3df;color:#b32a1a}
.tag.due{background:#fff5d6;color:#8a6300}
.tag.ok{background:#e2f5eb;color:#137a45}
.tag.wait{background:#e9edf2;color:#526475}
.tag.warn{background:#fdeedb;color:#a35a06}
.bar{height:9px;background:#e9eef3;border-radius:6px;overflow:hidden;margin-top:8px}
.bar i{display:block;height:100%;background:linear-gradient(90deg,#2b74d4,#1a9c5b);border-radius:6px}
.bar.stop i{background:#9bb0c2}
.job-foot{display:flex;justify-content:space-between;align-items:center;margin-top:7px;font-size:12.5px;color:var(--muted)}
.photo-need{font-weight:700}
.photo-need.ok{color:var(--green)}
.photo-need.miss{color:var(--red)}
.photo-need.wait{color:var(--orange)}

/* ---------- BỘ LỌC ---------- */
.filters{display:flex;gap:8px;overflow-x:auto;padding:2px 0 10px;-webkit-overflow-scrolling:touch}
.filters::-webkit-scrollbar{display:none}
.fchip{background:#fff;border:1.5px solid var(--line);border-radius:22px;padding:8px 14px;font-size:14px;
  font-weight:600;white-space:nowrap;cursor:pointer;color:#41586c}
.fchip.on{background:var(--navy);border-color:var(--navy);color:#fff}
.search{width:100%;padding:12px 14px;border:1.5px solid var(--line);border-radius:12px;font-size:16px;margin-bottom:10px}

/* ---------- CHI TIẾT ---------- */
.detail-head{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;margin-bottom:12px}
.back{background:none;border:none;color:var(--navy);font-weight:700;padding:6px 0;margin-bottom:6px;cursor:pointer;font-size:15px}
.dt-title{font-size:20px;font-weight:800;margin:2px 0 8px;line-height:1.3}
.kv{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px dashed var(--line);font-size:14.5px}
.kv:last-child{border-bottom:none}
.kv b{font-weight:700;text-align:right}
.state-banner{border-radius:12px;padding:11px 13px;font-weight:700;margin-bottom:12px;font-size:14.5px}
.sb-wait{background:#fff5d6;color:#7a5800}
.sb-fix{background:#fde3df;color:#a3271a}
.sb-done{background:#e2f5eb;color:#0f6b3c}

/* tiến độ */
.prog-opts{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.popt{flex:1;min-width:62px;border:1.5px solid var(--line);background:#fff;border-radius:12px;padding:12px 4px;
  font-weight:800;font-size:15px;cursor:pointer;color:#41586c}
.popt.on{background:var(--navy);border-color:var(--navy);color:#fff}
.popt.stop.on{background:var(--muted);border-color:var(--muted)}

/* ảnh */
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px;margin-top:10px}
.jitem-anh{display:flex;gap:6px;margin-top:7px;flex-wrap:wrap}
.jitem-anh .ph.nho{width:52px;height:52px;aspect-ratio:auto;border-radius:9px;flex:none}
.ph{position:relative;aspect-ratio:1;border-radius:12px;overflow:hidden;background:#e9eef3;cursor:pointer}
.ph img{width:100%;height:100%;object-fit:cover;display:block}
.ph .stamp{position:absolute;left:0;right:0;bottom:0;background:linear-gradient(transparent,rgba(0,0,0,.78));
  color:#fff;font-size:9.5px;padding:12px 5px 4px;line-height:1.25}
.ph .del{position:absolute;top:4px;right:4px;background:rgba(0,0,0,.55);color:#fff;border:none;border-radius:50%;
  width:24px;height:24px;font-size:14px;line-height:1;cursor:pointer}
.ph .gps-no{position:absolute;top:4px;left:4px;background:var(--red);color:#fff;font-size:9px;padding:2px 5px;border-radius:6px;font-weight:700}
.uploaders{display:flex;gap:10px;margin-top:12px}
.uploaders .btn{flex:1;padding:15px 8px;font-size:15.5px}
.need-line{display:flex;align-items:center;gap:8px;font-weight:700;font-size:15px;margin-bottom:2px}
.dots{display:flex;gap:5px}
.dot{width:13px;height:13px;border-radius:50%;background:#dde5ec;border:1.5px solid #cfd9e2}
.dot.on{background:var(--green);border-color:var(--green)}

/* tuần */
.week-item{border:1.5px solid var(--line);border-radius:12px;padding:10px 12px;margin-bottom:8px}
.week-item.cur{border-color:var(--navy);background:#f7fafd}
.week-item.miss{border-color:#f3c0b8;background:#fff8f7}
.week-head{display:flex;justify-content:space-between;align-items:center;gap:8px;font-weight:700;font-size:14.5px}

/* nghiệm thu */
.review-box{border:2px dashed #cfd9e2;border-radius:14px;padding:14px;background:#fbfdff}
.gps-line{display:flex;gap:8px;align-items:flex-start;font-size:13.5px;padding:10px 12px;border-radius:12px;margin-bottom:10px}
.gps-ok{background:#e2f5eb;color:#0f6b3c}
.gps-bad{background:#fde3df;color:#a3271a}
.gps-wait{background:#fff5d6;color:#7a5800}
.verdict-row{display:flex;gap:10px;margin-top:12px}
.verdict-row .btn{flex:1;padding:16px 8px;font-size:16px}

/* thống kê */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:10px;margin-bottom:14px}
.stat{background:#fff;border-radius:14px;box-shadow:var(--shadow);padding:12px 10px;text-align:center}
.stat-btn{border:0;width:100%;font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:transform .08s,box-shadow .12s}
.stat-btn:active{transform:scale(.96)}
.stat-btn::after{content:'›';position:absolute;top:6px;right:9px;color:var(--muted);font-size:15px;opacity:.55}
.stat{position:relative}
.stat b{display:block;font-size:26px;line-height:1.1;font-weight:800}
.stat span{font-size:11.5px;color:var(--muted);font-weight:600}
.stat.red b{color:var(--red)} .stat.orange b{color:var(--orange)}
.stat.green b{color:var(--green)} .stat.blue b{color:var(--blue)} .stat.purple b{color:var(--purple)}
.tbar{margin-bottom:11px}
.tbar-head{display:flex;justify-content:space-between;font-size:13.5px;margin-bottom:4px;font-weight:600}
.track{display:block;height:12px;background:#e9eef3;border-radius:7px;overflow:hidden}
.fill{display:block;height:100%;border-radius:7px}

/* bảng */
.tbl{width:100%;border-collapse:collapse;font-size:13.5px}
.tbl th,.tbl td{text-align:left;padding:8px 6px;border-bottom:1px solid var(--line);vertical-align:top}
.tbl th{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.3px}
.tbl-wrap{overflow-x:auto}

/* modal */
.modal{position:fixed;inset:0;z-index:80;background:rgba(10,25,40,.55);display:flex;align-items:flex-end;justify-content:center}
.modal-card{background:#fff;border-radius:20px 20px 0 0;width:100%;max-width:560px;max-height:92dvh;overflow:auto;
  padding:20px 16px calc(20px + env(safe-area-inset-bottom))}
@media(min-width:600px){.modal{align-items:center}.modal-card{border-radius:20px}}
.modal-title{font-size:19px;font-weight:800;margin:0 0 14px}

/* xem ảnh to */
.viewer{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.94);display:flex;flex-direction:column}
.viewer img{flex:1;object-fit:contain;width:100%;min-height:0}
.viewer .vinfo{color:#fff;padding:14px 16px calc(14px + env(safe-area-inset-bottom));font-size:13.5px;line-height:1.5;background:#000}
.viewer .vclose{position:absolute;top:calc(12px + env(safe-area-inset-top));right:12px;background:rgba(255,255,255,.2);
  color:#fff;border:none;width:40px;height:40px;border-radius:50%;font-size:20px;cursor:pointer}

/* toast + busy */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--tabh) + 16px);z-index:100;
  background:#16232e;color:#fff;padding:12px 18px;border-radius:14px;font-size:14.5px;max-width:90vw;
  box-shadow:0 8px 24px rgba(0,0,0,.3);font-weight:600}
.toast.err{background:var(--red)}
.toast.ok{background:var(--green)}
.busy{position:fixed;inset:0;z-index:110;background:rgba(255,255,255,.82);display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:14px;font-weight:700;color:var(--navy)}
.spinner{width:44px;height:44px;border:4px solid #d8e2ec;border-top-color:var(--navy);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.empty{text-align:center;color:var(--muted);padding:40px 20px}
.empty .big{font-size:44px;margin-bottom:8px}

/* hồ sơ ảnh PDF */
.pdf-list{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.pdf-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1.5px solid var(--line);
  border-radius:12px;text-decoration:none;color:inherit;background:#fff}
.pdf-row:active{background:#f2f6fa}
.pdf-row b{display:block;font-size:14.5px}
.pdf-row .muted{font-size:12.5px}
.pdf-ic{font-size:22px;line-height:1}
.pdf-go{margin-left:auto;font-size:22px;color:var(--muted)}
.pdf-row.empty{opacity:.55;padding:12px 14px;text-align:left;background:#f7f9fb}

/* hạng mục (công đoạn) */
.item-list{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.jitem{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;border:1.5px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff}
.jitem.done{border-color:#bfe6ce;background:#f4fbf7}
.jitem.doing{border-color:#f2d7a8;background:#fffaf1}
.jitem-main{flex:1;min-width:0;font-size:14.5px}
.jitem-main b{display:block}
.jitem.done .jitem-main b{text-decoration:line-through;color:var(--muted)}
.jitem-btns{display:flex;gap:4px;flex:none}
.ist{border:1.5px solid var(--line);background:#fff;border-radius:9px;padding:6px 9px;font-size:12.5px;font-weight:700;color:var(--muted)}
.ist.on{color:#fff;border-color:transparent}
.ist.on.chua{background:#8b98a6}
.ist.on.dang{background:var(--amber)}
.ist.on.xong{background:var(--green)}
.idel{border:none;background:none;color:#c9d2da;font-size:16px;padding:4px 2px;flex:none}
/* Điện thoại: tên hạng mục nằm riêng 1 dòng, hàng nút to cho dễ bấm */
@media (max-width:560px){
  .jitem-main{flex:1 1 100%}
  .jitem-btns{flex:1 1 auto}
  .jitem-btns .ist{flex:1;padding:9px 4px}
}
.ph-item{position:absolute;left:0;top:0;right:0;background:rgba(18,58,94,.82);color:#fff;font-size:10.5px;
  font-weight:700;padding:3px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* phòng / khu trong 1 dự án */
.area-box{border:2px solid #dde5ee;border-radius:14px;padding:10px;margin-bottom:12px;background:#fbfdff}
.area-box.done{border-color:#bfe6ce;background:#f4fbf7}
.area-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.area-name{font-size:17px;font-weight:800;color:var(--navy);flex:1;min-width:0}
.area-cnt{font-size:13px;font-weight:700;color:var(--orange)}
.area-cnt.ok{color:var(--green)}
.area-box .item-list{margin-top:0}
.area-box .jitem{border-color:#e8edf3}
.area-head{cursor:pointer}
.area-caret{font-size:15px;color:var(--muted);flex:none;width:14px}
.area-cnt.doing{color:var(--amber-dark)}
.area-box:not(.open) .bar{margin-top:4px}

/* --- duyệt từng hạng mục --- */
.jitem.wait{background:#fff8e6}
.cho-nhe{color:#9aa8b4;font-weight:500}
.jitem.bad{background:#fdecec}
.ist.duyet-ok{background:#e7f7ec;border-color:#7fd0a0;color:#1c7a45;font-weight:700}
.ist.duyet-no{background:#fdecec;border-color:#f0a9a9;color:#b32020;font-weight:700}
.area-review{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:space-between;
  margin:8px 10px 10px;padding:9px 11px;border-radius:10px;background:#fff5e0;font-size:13px}
.area-review.ok{background:#e7f7ec}
.area-review .btn{padding:7px 12px;font-size:13px}

/* --- màn hình hiệu quả --- */
.hq-team{border-top:1px solid var(--line);padding:10px 0}
.hq-team:first-of-type{border-top:0}
.hq-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.hq-tab{width:100%;border-collapse:collapse;font-size:13px}
.hq-tab td{padding:3px 4px;color:var(--muted)}
.hq-tab td:nth-child(2),.hq-tab td:nth-child(4){color:var(--ink);text-align:right;width:22%}

/* --- biểu đồ --- */
.chart{width:100%;height:auto;display:block}
.chart-note{display:flex;gap:14px;flex-wrap:wrap;justify-content:center;margin-top:6px;font-size:11.5px;color:var(--muted)}
.chart-note i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:4px}
.hbars{display:flex;flex-direction:column;gap:9px;margin-top:4px}
.hbar{display:flex;align-items:center;gap:8px;font-size:12.5px}
.hb-ten{width:82px;flex:none;color:var(--muted)}
.hb-track{position:relative;flex:1;height:14px;background:#eef2f6;border-radius:7px;overflow:hidden}
.hb-mo{position:absolute;left:0;top:0;height:100%;background:#3b82f6;border-radius:7px}
.hb-tre{position:absolute;left:0;top:0;height:100%;background:#e5484d;border-radius:7px}
.hb-so{width:78px;text-align:right;flex:none}

/* nut thu gon menu — chi co tren man hinh rong */
.side-toggle{display:none}

/* ================== MÀN HÌNH RỘNG (máy tính) ================== */
@media (min-width:1000px){
  body{background:#eef2f6}
  .topbar{padding-left:calc(var(--sidew) + 18px)}
  :root{--sidew:212px}
  /* thanh tab dưới đáy -> menu dọc bên trái */
  .tabbar{position:fixed;left:0;top:0;bottom:0;right:auto;width:var(--sidew);
    flex-direction:column;justify-content:flex-start;align-items:stretch;gap:2px;
    border-top:0;border-right:1px solid var(--line);padding:66px 10px 14px;height:100vh;background:#fff}
  .tabbar button{flex:none;flex-direction:row;gap:11px;justify-content:flex-start;
    padding:11px 13px;border-radius:11px;font-size:14px;font-weight:600}
  .tabbar button .ic{font-size:19px}
  .tabbar button.on{background:#eaf1f8;color:var(--navy)}
  .tab-badge{position:static;margin-left:auto}
  main{margin-left:var(--sidew);max-width:1560px;padding:18px 26px 40px}
  /* nut thu gon nam duoi day thanh menu */
  .side-toggle{display:flex;position:fixed;left:0;bottom:0;width:var(--sidew);height:42px;z-index:41;
    align-items:center;justify-content:center;gap:7px;cursor:pointer;
    border:0;border-top:1px solid var(--line);border-right:1px solid var(--line);
    background:#fff;color:var(--muted);font-size:13px;font-weight:600;font-family:inherit}
  .side-toggle:hover{background:#f4f7fa;color:var(--navy)}
  .side-toggle .sc{font-size:17px;line-height:1}
  /* ---- thu gon: menu con 60px, bang duoc rong het co ---- */
  body.thu-gon{--sidew:60px}
  body.thu-gon .tabbar{padding:66px 7px 52px}
  body.thu-gon .tabbar button{justify-content:center;padding:11px 0;gap:0}
  body.thu-gon .tabbar button .lbl{display:none}
  body.thu-gon .tabbar button .ic{font-size:21px}
  body.thu-gon .tab-badge{position:absolute;top:4px;right:6px;margin-left:0}
  body.thu-gon .tabbar button{position:relative}
  body.thu-gon .side-toggle .lbl{display:none}
  body.thu-gon .side-toggle .sc{transform:rotate(180deg)}
  body.thu-gon main{max-width:1900px}
  /* 2 cột: danh sách trái — chi tiết phải */
  .split{display:grid;grid-template-columns:minmax(420px,0.85fr) minmax(520px,1.15fr);gap:18px;align-items:start}
  .split > .pane{min-width:0}
  .split .pane-right{position:sticky;top:74px;max-height:calc(100vh - 96px);overflow:auto}
  /* biểu đồ xếp 2 cái một hàng */
  .charts2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
  .charts2 .card{margin-bottom:0}
  .cards{grid-template-columns:repeat(4,1fr)}
  .filters{flex-wrap:wrap;overflow:visible}
  /* bảng công việc */
  .jtab{width:100%;border-collapse:collapse;background:#fff;border-radius:var(--radius);
    overflow:hidden;box-shadow:var(--shadow);font-size:13.5px}
  .jtab th{background:#f4f7fa;color:var(--muted);font-size:12px;text-align:left;padding:9px 10px;font-weight:700}
  .jtab td{padding:9px 10px;border-top:1px solid var(--line);vertical-align:middle}
  .jtab tr{cursor:pointer}
  .jtab tr:hover td{background:#f7fbff}
  .jtab tr.on td{background:#eaf1f8}
  .jtab .jt-ten{font-weight:700;color:var(--ink)}
  .jtab .mini-bar{height:6px;background:#eef2f6;border-radius:3px;overflow:hidden;min-width:64px}
  .jtab .mini-bar i{display:block;height:100%;background:var(--blue)}
  .jtab td,.jtab th{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .jtab .jt-ten{max-width:260px}
  .jtab tr{height:40px}
  /* Khi mở chi tiết bên phải, danh sách hẹp lại -> giấu cột phụ cho khỏi vỡ */
  .split .jtab .col-noi,.split .jtab .col-team{display:none}
  .split .jtab .jt-ten{max-width:210px}
  .pane-right .card:first-child{margin-top:0}
}
@media (max-width:999px){ .only-pc{display:none!important} }
@media (min-width:1000px){ .only-mobile{display:none!important} }

/* --- hồ sơ & file --- */
.hs-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:space-between;
  padding:9px 0;border-top:1px solid var(--line)}
.hs-row:first-child{border-top:0}
.hs-ten{min-width:180px;flex:1}
.hs-nut{display:flex;gap:6px;flex-wrap:wrap}
.hs-nut .btn{padding:7px 11px;font-size:13px}

/* --- ô chọn ngày --- */
.daterow{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-bottom:12px}
.dt{display:flex;flex-direction:column;gap:4px;flex:1;min-width:140px}
.dt span{font-size:12px;color:var(--muted);font-weight:600;padding-left:2px}
.dt input[type=date]{font-family:inherit;font-size:14.5px;padding:10px 12px;border:1.5px solid var(--line);
  border-radius:11px;background:#fff;color:var(--ink);width:100%;-webkit-appearance:none;appearance:none}
.dt input[type=date]:focus{outline:none;border-color:var(--navy2);box-shadow:0 0 0 3px rgba(18,58,94,.08)}
.daterow .btn{padding:10px 20px;font-size:14.5px;border-radius:11px}
/* --- kích thước biểu đồ, chữ khỏi bị phóng to --- */
.chart{max-width:560px;margin:0 auto}
.chart-tron{max-width:480px}
@media (min-width:1000px){ .chart{max-width:100%} .chart-tron{max-width:100%} }

/* --- màn "Việc hôm nay" của thợ (29/07/2026) --- */
.nhom{margin-bottom:18px}
.nhom-ten{font-size:13px;font-weight:800;color:var(--muted);text-transform:none;
  margin:0 2px 8px;letter-spacing:.2px}
.nhom-ten.sua{color:var(--orange)}
.nhom-ten.homnay{color:var(--navy)}
.tre-head{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;
  background:#fdecea;color:#8f2418;border:1.5px solid #f3c3bc;border-radius:12px;
  padding:13px 14px;font-size:15px;font-weight:800;font-family:inherit;cursor:pointer;margin-bottom:8px}
.tre-head.open{margin-bottom:10px}
.tre-caret{font-size:13px;opacity:.8}
/* nút chụp ảnh cỡ lớn, xếp dọc cho thợ lớn tuổi */
.uploaders.doc{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.uploaders.doc .btn{width:100%}
/* mục "Xem thêm thông tin việc" — gom ngày tháng, ảnh cũ, file PDF */
.xemthem{margin-top:6px}
.xemthem>summary{list-style:none;cursor:pointer;padding:13px 14px;border-radius:12px;
  background:var(--card);border:1.5px solid var(--line);color:var(--muted);
  font-size:14.5px;font-weight:700;text-align:center}
.xemthem>summary::-webkit-details-marker{display:none}
.xemthem>summary::after{content:' ▾'}
.xemthem[open]>summary::after{content:' ▴'}
.xemthem[open]>summary{margin-bottom:10px}
.canhbao-sheet{margin-top:8px;padding:9px 11px;border-radius:10px;background:#fff8e6;
  border:1.5px solid #f0d79a;color:#6b4a06;font-size:13px;line-height:1.55}

/* --- chữ to hơn cho màn thợ (user chốt 29/07/2026) --- */
.chu-to .page-title{font-size:23px}
.chu-to .job{padding:15px 16px}
.chu-to .job-title{font-size:19px;line-height:1.4}
.chu-to .tag{font-size:14px;padding:4px 12px}
.chu-to .job-foot{font-size:14.5px}
.chu-to .nhom-ten{font-size:15px}
.chu-to .tre-head{font-size:17px;padding:15px 16px}
.chu-to .muted{font-size:14.5px}
.chu-to .dt-title{font-size:22px;line-height:1.35}
.chu-to .kv{font-size:15.5px}
.chu-to .card h3{font-size:18px}
.chu-to .btn{font-size:16px}
.chu-to .btn-lg{font-size:18px}
.chu-to .fchip{font-size:15.5px;padding:9px 16px}
.chu-to .jitem-main{font-size:17px}
.chu-to .area-name{font-size:19px}
.chu-to .ist{font-size:15px;padding:9px 12px}
.chu-to .empty{font-size:16.5px}

/* --- Bảng công việc kiểu Excel (máy tính) --- */
.bang-wrap{overflow:auto;max-height:calc(100vh - 250px);border:1.5px solid var(--line);
  border-radius:12px;background:#fff}
.bang{border-collapse:separate;border-spacing:0;width:100%;font-size:13.5px}
.bang th{position:sticky;top:0;z-index:2;background:#eef3f8;color:#3d5568;font-weight:800;
  text-align:left;padding:9px 8px;border-bottom:1.5px solid var(--line);white-space:nowrap}
.bang td{padding:0;border-bottom:1px solid #eef2f6;border-right:1px solid #f2f5f8;vertical-align:middle}
.bang tr:hover td{background:#f9fcff}
.bang tr.tre td{background:#fff7f6}
.bang tr.tre:hover td{background:#ffefed}
.bang tr.xong td{background:#f6faf7;color:var(--muted)}
.bang td.stt{text-align:center;color:var(--muted);font-size:12px;padding:0 6px;width:38px}
.bang td.ro{padding:8px}
.bang .bo{width:100%;border:none;background:transparent;font-family:inherit;font-size:13.5px;
  color:var(--text);padding:8px;border-radius:0;-webkit-appearance:none;appearance:none}
.bang .bo:focus{outline:none;background:#fff;box-shadow:inset 0 0 0 2px var(--navy2)}
.bang select.bo{cursor:pointer}
.bang .bo.dangluu{background:#fff8e6}
.bang .bo.daluu{background:#e8f7ee}
/* Cot # dinh han ben trai — vuot ngang bao nhieu van biet dang o dong nao */
.bang th.stt:first-child,.bang td.stt:first-child{position:sticky;left:0;z-index:3;
  background:#fff;border-right:1px solid var(--line)}
.bang th.stt:first-child{z-index:5;background:#eef3f8}
.bang tr:hover td.stt:first-child{background:#f9fcff}
.bang tr.tre td.stt:first-child{background:#fff7f6}
.bang tr.tre:hover td.stt:first-child{background:#ffefed}
.bang tr.xong td.stt:first-child{background:#f6faf7}
.bang-dt tr.dang-mo td.stt:first-child{background:#eef5fc}

/* 2 cot cuoi luon dinh ben phai — bang keo ngang bao nhieu van bam duoc */
.bang th.dinh1,.bang td.dinh1{position:sticky;right:0;z-index:3;background:#fff;border-left:1px solid var(--line)}
.bang th.dinh2,.bang td.dinh2{position:sticky;right:38px;z-index:3;background:#fff;border-left:1px solid var(--line);width:52px}
.bang th.dinh1,.bang th.dinh2{background:#eef3f8;z-index:4}
.bang tr.tre td.dinh1,.bang tr.tre td.dinh2{background:#fff7f6}
.bang tr.xong td.dinh1,.bang tr.xong td.dinh2{background:#f6faf7}
.bang .bmo .so{font-size:11px;font-weight:700;margin-left:1px}
.bang th.cot-anh,.bang td.cot-anh{text-align:center;min-width:66px;padding:0 4px}

/* --- Bảng rút gọn trên điện thoại: bấm vào dòng thì xổ mốc ngày ra dưới --- */
.bang-dt td.stt{width:46px;padding:0 4px}
.bang-dt .bmui{color:var(--navy2);font-weight:900;margin-right:3px}
.bang-dt tr.dang-mo td{background:#eef5fc}
.bang-dt tr.dang-mo td.dinh1{background:#eef5fc}
.bang tr.bct td{padding:0;background:#f5f8fb;border-bottom:2px solid var(--line)}
/* Ghim khối xổ dính mép trái + rộng đúng bằng màn hình, để khỏi phải vuốt ngang */
.bct-luoi{position:sticky;left:0;box-sizing:border-box;width:calc(100vw - 34px);max-width:100vw;
  display:flex;flex-direction:column;background:#f9fbfd}
.bct-o{display:flex;align-items:center;gap:8px;padding:4px 9px;border-bottom:1px solid #eaeff4}
.bct-o:last-child{border-bottom:0}
.bct-nhan{flex:0 0 116px;font-size:11px;font-weight:800;color:var(--muted);
  text-transform:uppercase;letter-spacing:.02em;line-height:1.2}
.bct-gt{flex:1;min-width:0;font-size:13px;font-weight:600;color:var(--navy)}
.bct-gt .bo{width:100%;box-sizing:border-box;border:1px solid var(--line);background:#fff;
  border-radius:6px;padding:4px 7px;font-family:inherit;font-size:13px}
.bct-gt.ro{color:#5b6f80}
.bct-gt.khoa{color:var(--muted)}
.bct-gt.nt-chua{color:var(--red);font-weight:800}
.btn-anh{border:1px solid var(--line);background:#fff;border-radius:8px;padding:4px 8px;
  font-family:inherit;font-size:12.5px;font-weight:700;color:var(--navy2);cursor:pointer}
.btn-anh:hover{background:#eaf1f8;border-color:var(--navy2)}
/* thu vien anh trong hop thoai */
.tv-nhom{margin-bottom:14px}
.tv-ten{font-weight:800;color:var(--navy);margin-bottom:6px;font-size:14px}

.bang .bmo{border:none;background:none;color:var(--navy2);font-size:15px;font-weight:800;
  cursor:pointer;padding:6px 8px}
.bang .bmo:hover{color:var(--amber-dark)}
/* Điện thoại: bảng cuộn ngang, nhắc dùng máy tính */
@media (max-width:999px){
  .bang-wrap{max-height:none}
  .bang{font-size:12.5px}
}

/* --- Danh mục trong Quản trị --- */
.dm-nhom{padding:12px 0;border-top:1px solid var(--line)}
.dm-nhom:first-child{border-top:0;padding-top:4px}
.dm-ten{font-weight:800;font-size:15px;color:var(--navy)}
.dm-dau{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.dm-mo{border:1px dashed #b9c9d8;background:#fff;color:var(--blue);border-radius:20px;
  padding:5px 14px;font-size:13.5px;font-weight:700;cursor:pointer;white-space:nowrap}
.dm-mo:hover{background:#eef3f8;border-style:solid}
.dm-list{display:flex;flex-wrap:wrap;gap:6px}
/* Ô điền ẩn sẵn, chỉ hiện khi bấm "＋ Thêm" */
.dm-form{display:none;gap:8px;margin-top:10px;padding:10px;background:#f5f8fb;
  border:1px solid var(--line);border-radius:10px}
.dm-form.mo{display:flex;flex-wrap:wrap;align-items:center}
.dm-form input{flex:1 1 220px;min-width:0;margin:0}
.dm-form input.dm-phu{flex:0 1 200px}
.dm-form .btn{margin:0;padding:9px 18px;flex:0 0 auto}
.dm-item{display:inline-flex;align-items:center;gap:6px;background:#eef3f8;color:#3d5568;
  border-radius:20px;padding:5px 6px 5px 12px;font-size:13.5px;font-weight:600}
.dm-extra{font-style:normal;color:var(--muted);font-weight:600;font-size:12.5px}
.dm-xoa{border:none;background:none;color:#98a8b6;font-size:14px;cursor:pointer;padding:0 4px;line-height:1}
.dm-xoa:hover{color:var(--red)}

/* --- công tắc cắt Google Sheet --- */
.sheet-ct{padding:11px 13px;border-radius:12px;font-size:13.5px;line-height:1.6}
.sheet-ct.bat{background:#fff8e6;border:1.5px solid #f0d79a;color:#6b4a06}
.sheet-ct.tat{background:#eaf6ef;border:1.5px solid #b9e0c8;color:#14603a}
.sheet-ct .btn{width:100%}

/* --- chọn quán cho tài khoản --- */
.quan-list{display:flex;flex-wrap:wrap;gap:6px 12px;max-height:200px;overflow:auto;
  border:1.5px solid var(--line);border-radius:12px;padding:10px;background:#fbfcfd}
.quan-o{display:flex;align-items:center;gap:6px;font-size:14px;min-width:120px}
.quan-o input{width:17px;height:17px}
/* ô bị khoá trong bảng công việc */
.bang td.khoa{background:#f7f9fb;color:var(--muted)}
.bang tr:hover td.khoa{background:#f2f6fa}
.bang td.nt-chua{color:var(--red);font-weight:700}
