/* HOME MART ERP 2 — bố cục theo KiotViet (thanh menu ngang + menu xổ, trang danh sách có bộ lọc trái), màu Home Mart */
:root {
  --brand: #448127; --brand-2: #57a131; --brand-bright: #76b82a; --brand-soft: #eef6e8; --brand-line: #d6e9c8;
  --red: #e30613; --bg: #f1f3f6; --card: #fff; --line: #e7eaef; --line-2: #f0f2f5; --text: #1d2733; --muted: #6b7684; --head: #edf5e8;
  --c-ok: #1e78ff; --c-late: #9b51e0; --c-miss: #e5484d; --c-none: #f59e0b; --c-off: #9aa1ab; --c-work: #1f9d63;
  --r: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }

/* ---------------------------------------------------------------- thanh đầu */
.topbar { position: sticky; top: 0; z-index: 60; padding: 8px 10px 0; background: var(--bg); }
.topbar-in { display: flex; align-items: center; height: 50px; border-radius: 12px; padding: 0 10px 0 14px; color: #fff;
  background: linear-gradient(90deg, #3a7320 0%, #468a26 55%, #4f962b 100%); box-shadow: 0 3px 10px rgba(40, 80, 15, .18); }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; flex: none; }
.logo img { height: 25px; display: block; }
.logo .v2 { font-size: 10.5px; font-weight: 700; background: rgba(255, 255, 255, .2); border-radius: 5px; padding: 1px 5px; letter-spacing: .3px; }
.tnav { display: flex; align-items: stretch; height: 100%; margin: 0 0 0 16px; padding: 0; list-style: none; }
.tnav > li { position: relative; display: flex; }
.tnav > li > a { display: flex; align-items: center; gap: 3px; padding: 0 11px; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; position: relative; }
.tnav > li > a::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.tnav > li.active > a::after { background: #fff; }
.tnav > li:hover > a { background: rgba(255, 255, 255, .08); }
.dd { position: absolute; top: 100%; left: 0; min-width: 210px; padding: 6px; margin-top: 0; background: #fff; color: var(--text); border-radius: 10px; box-shadow: 0 10px 32px rgba(15, 23, 42, .18); display: none; z-index: 70; }
.tnav > li:hover > .dd, .tnav > li.open > .dd { display: block; }
.dd a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; color: var(--text); text-decoration: none; white-space: nowrap; font-size: 14px; }
.dd a:hover, .dd a.on { background: var(--brand-soft); color: #2f6118; }
.dd a .ext { margin-left: auto; color: var(--muted); width: 14px; height: 14px; }
.dd .gt { font-size: 12px; color: var(--muted); padding: 9px 12px 3px; border-top: 1px solid var(--line); margin-top: 5px; }
.dd.mega { width: 620px; padding: 10px; }
.tnav > li:hover > .dd.mega, .tnav > li.open > .dd.mega { display: grid; grid-template-columns: 1.15fr 1fr; gap: 6px; }
.mega .col-r { border-left: 1px solid var(--line); padding-left: 10px; }
.mega .gt0 { font-size: 12px; color: var(--muted); padding: 4px 12px 6px; }
.mega .grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.mega .trend { align-items: flex-start; white-space: normal; }
.mega .trend .ti { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.mega .trend b { display: block; font-size: 14px; }
.mega .trend span { display: block; font-size: 12px; color: var(--muted); }
.tright { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.tbtn { height: 32px; border: 0; border-radius: 8px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .94); color: #2f6118; font: 600 13px/1 inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tbtn:hover { background: #fff; }
.tbtn.ic { width: 32px; padding: 0; justify-content: center; }
.tbtn .cnt { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #4b8f28; }
.tpop { position: relative; }
.tpop > .dd { left: auto; right: 0; top: calc(100% + 8px); }
.tpop.open > .dd { display: block; }
.dd .sub { display: block; font-size: 12px; color: var(--muted); white-space: normal; }
.dd .set-item { align-items: flex-start; }
.dd .set-item svg { margin-top: 2px; color: var(--brand); }
.dd .all { justify-content: center; background: var(--brand-soft); color: #2f6118; font-weight: 600; margin-top: 6px; }
.brsel { max-height: 60vh; overflow: auto; min-width: 250px; }
.brsel a.on::after { content: "✓"; margin-left: auto; font-weight: 700; }
.uinfo { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.uinfo b { display: block; }
.burger { display: none; }

/* ---------------------------------------------------------------- khung trang */
.main { padding: 10px 10px 30px; max-width: 1800px; margin: 0 auto; }
.ph { display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 2px 0 10px; flex-wrap: wrap; }
.ph h1 { font-size: 20px; font-weight: 700; width: 220px; flex: none; }
.ph h1.auto { width: auto; }
.ph .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 0 1 400px; min-width: 200px; }
.search input { width: 100%; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 0 12px 0 36px; font: inherit; outline: none; }
.search input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(87, 161, 49, .14); }
.search svg { position: absolute; left: 11px; top: 9px; color: var(--muted); width: 17px; height: 17px; }
.btn { height: 34px; border-radius: 8px; border: 1px solid var(--brand); background: #fff; color: var(--brand); padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1 inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-soft); }
.btn.pri { background: var(--brand); color: #fff; }
.btn.pri:hover { background: #3b7221; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.lf { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 10px; align-items: start; }
.fp { background: #fff; border-radius: var(--r); padding: 12px 12px 14px; position: sticky; top: 70px; max-height: calc(100vh - 80px); overflow: auto; }
.fp h4 { font-size: 13px; font-weight: 700; margin: 16px 0 7px; display: flex; justify-content: space-between; align-items: center; }
.fp h4:first-child { margin-top: 0; }
.fp h4 a { font-weight: 600; font-size: 12.5px; text-decoration: none; }
.fp label.r { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; font-size: 13.5px; }
.fp label.r input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; }
.fp select, .fp input[type=text], .fp input[type=date], .fp input[type=month], .inp { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; font: inherit; font-size: 13px; background: #fff; color: var(--text); }
.fp .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.fp .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.fp-toggle { display: none; }
.cat-tree { font-size: 13.5px; max-height: 360px; overflow: auto; margin: 0 -4px; }
.cat-tree details > summary { list-style: none; cursor: pointer; }
.cat-tree details > summary::-webkit-details-marker { display: none; }
.cat-tree .cn { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 6px; text-decoration: none; color: var(--text); }
.cat-tree .cn:hover { background: var(--line-2); }
.cat-tree .cn.on { background: var(--brand-soft); color: #2f6118; font-weight: 600; }
.cat-tree .cn .car { width: 14px; color: var(--muted); flex: none; text-align: center; font-size: 11px; }
.cat-tree details[open] > summary .car { transform: rotate(90deg); }
.cat-tree .kids { padding-left: 14px; }
.cat-tree .cnt { margin-left: auto; color: var(--muted); font-size: 12px; }
.card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 14px 16px; }
.card + .card { margin-top: 10px; }
.card h3 { font-size: 16px; font-weight: 700; }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }

/* bảng */
.tw { overflow: auto; border-radius: var(--r); background: #fff; }
.tw.max { max-height: calc(100vh - 150px); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th { background: var(--head); text-align: left; font-weight: 600; padding: 11px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 2; color: #24321b; font-size: 13px; }
table.t th:first-child { border-top-left-radius: var(--r); }
table.t th:last-child { border-top-right-radius: var(--r); }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .c { text-align: center; }
table.t tr.sum td { font-weight: 700; background: #fafbf8; }
table.t tr.row { cursor: pointer; }
table.t tr.row:hover td { background: #f7faf4; }
table.t tr.row.open td { background: var(--brand-soft); }
table.t tr.det > td { padding: 0; background: #fff; border-bottom: 2px solid var(--brand-line); }
.det-in { padding: 14px 18px 16px; border-left: 3px solid var(--brand); }
table.t td.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.stick { position: sticky; left: 0; z-index: 1; background: #fff; }
th.stick { z-index: 3; background: var(--head) !important; }
.code { color: var(--brand); font-weight: 600; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--line-2); color: #4b5563; white-space: nowrap; }
.badge.green { background: #e6f5e4; color: #2e7d32; }
.badge.blue { background: #e7f0ff; color: #1d5fc2; }
.badge.orange { background: #fff1df; color: #b45f00; }
.badge.red { background: #fdeaea; color: #c22a2a; }
.badge.purple { background: #f1e8fc; color: #7b3cc4; }
.pager { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager .sp { margin-left: auto; display: flex; gap: 4px; }
.pager a, .pager span.cur, .pager span.gap { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 7px; display: inline-grid; place-items: center; border: 1px solid var(--line); color: var(--text); text-decoration: none; background: #fff; }
.pager span.cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager span.gap { border: 0; }
.pager select { height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; font: inherit; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs a, .tabs button { padding: 9px 12px; font: 600 14px/1.2 inherit; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 24px; }
.kv > div { border-bottom: 1px solid var(--line-2); padding: 6px 0; }
.kv span { display: block; font-size: 12px; color: var(--muted); }
.kv b { font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg a { padding: 7px 12px; text-decoration: none; color: var(--text); font-size: 13px; font-weight: 600; border-right: 1px solid var(--line); white-space: nowrap; }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--brand); color: #fff; }
.navd { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; height: 34px; padding: 0 4px; }
.navd a { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--text); text-decoration: none; }
.navd a:hover { background: var(--line-2); }
.navd span { font-weight: 600; font-size: 13px; padding: 0 6px; white-space: nowrap; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r); background: #fff7e6; border: 1px solid #ffe0a3; color: #7a4b00; font-size: 13.5px; margin-bottom: 10px; }
.banner.info { background: #eef5ff; border-color: #cfe0ff; color: #1f4f8f; }
.banner svg { margin-top: 1px; }
.banner b { font-weight: 700; }

/* ---------------------------------------------------------------- tổng quan */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 10px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.kpi { background: #fff; border-radius: var(--r); padding: 14px 16px; min-height: 122px; position: relative; overflow: hidden; }
.kpi h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.kpi .big { font-size: 26px; font-weight: 750; letter-spacing: -.3px; }
.kpi .lines { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.kpi .lines i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.kpi .deco { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .deco svg { width: 28px; height: 28px; }
.ring { width: 76px; height: 76px; border-radius: 50%; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: conic-gradient(var(--brand-2) calc(var(--p) * 1%), #e8efe3 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.ring span { position: relative; font-weight: 700; font-size: 14px; }
.ring small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; text-align: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.chip.up { background: #e6f5e4; color: #2e7d32; }
.chip.down { background: #fdeaea; color: #c22a2a; }
.chip.flat { background: var(--line-2); color: #555; }
.chip.blue { background: #e7f0ff; color: #1d5fc2; }
.chip.green { background: #e6f5e4; color: #2e7d32; }
.chip.orange { background: #fff1df; color: #b45f00; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cbox { background: #fff; border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.cbox h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.cbox .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ctabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 10px 0 10px; }
.ctabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 7px 2px; font: 500 14px/1 inherit; color: var(--muted); cursor: pointer; }
.ctabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.cv { position: relative; height: 250px; }
.cv.tall { height: 320px; }
.ddsel { height: 32px; border: 0; background: var(--line-2); border-radius: 8px; padding: 0 8px; font: 600 13px/1 inherit; color: var(--text); cursor: pointer; }
.rcol .card { padding: 14px 14px; margin-bottom: 10px; }
.rcol h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.rcol h5 { font-size: 13px; margin: 10px 0 6px; }
.remind { display: flex; gap: 10px; padding: 10px; border-radius: 8px; background: #f7f8fa; margin-bottom: 8px; font-size: 13.2px; align-items: flex-start; text-decoration: none; color: var(--text); }
.remind:hover { background: #f0f3f6; }
.remind .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: #fff1df; color: #c66d00; }
.remind .ic.red { background: #fdeaea; color: #c22a2a; }
.remind .ic.green { background: #e6f5e4; color: #2e7d32; }
.remind .ic.blue { background: #e7f0ff; color: #1d5fc2; }
.remind b { color: var(--brand); }
.act { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.act:last-child { border-bottom: 0; }
.act .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e7f0ff; color: #1d5fc2; flex: none; }
.act .ic.out { background: #f1e8fc; color: #7b3cc4; }
.act small { display: block; color: var(--muted); font-size: 11.5px; }
.toplist { display: grid; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 24px 130px minmax(0, 1fr) 110px; gap: 10px; align-items: center; font-size: 13.5px; }
.tl-row .rk { width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #555; }
.tl-row:nth-child(1) .rk { background: #ffd54f; color: #6b4e00; }
.tl-row:nth-child(2) .rk { background: #e0e0e0; }
.tl-row:nth-child(3) .rk { background: #ffcc9e; color: #7a3e00; }
.bar { height: 10px; border-radius: 6px; background: #edf1ea; overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--brand-2), var(--brand-bright)); }
.bar > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #c22a2a; }
.prog { display: flex; align-items: center; gap: 8px; }
.prog .bar { flex: 1; }

/* ---------------------------------------------------------------- chấm công / lịch */
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: center; background: #fff; border-radius: 999px; padding: 8px 18px; box-shadow: 0 2px 12px rgba(0, 0, 0, .09); font-size: 13px; width: fit-content; max-width: 100%; margin: 12px auto 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.legend a { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 999px; }
.legend a.on { background: var(--brand-soft); font-weight: 600; }
i.d-ok { background: var(--c-ok); } i.d-late { background: var(--c-late); } i.d-miss { background: var(--c-miss); } i.d-none { background: var(--c-none); } i.d-off { background: var(--c-off); } i.d-working { background: var(--c-work); } i.d-nosync { background: repeating-linear-gradient(45deg, #c9ced6, #c9ced6 2px, #eef0f3 2px, #eef0f3 4px); } i.d-future { background: #fff; box-shadow: inset 0 0 0 1.5px #b9c0c9; }
.sc { display: block; border-radius: 6px; padding: 4px 7px; font-size: 12px; line-height: 1.32; margin-bottom: 4px; border-left: 3px solid; background: #f4f6f8; text-align: left; cursor: pointer; color: var(--text); text-decoration: none; }
.sc:last-child { margin-bottom: 0; }
.sc b { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc span { color: #4b5563; white-space: nowrap; }
.st-ok { border-color: var(--c-ok) !important; background: #eaf2ff; }
.st-late { border-color: var(--c-late) !important; background: #f3ebfd; }
.st-miss { border-color: var(--c-miss) !important; background: #fdecec; }
.st-none { border-color: var(--c-none) !important; background: #fff4e1; }
.st-off { border-color: var(--c-off) !important; background: #f1f2f4; color: #5f6670; }
.st-working { border-color: var(--c-work) !important; background: #e6f6ee; }
.st-nosync { border-color: #c4cad3 !important; background: repeating-linear-gradient(45deg, #f7f8fa, #f7f8fa 6px, #eff1f4 6px, #eff1f4 12px); color: #6b7280; }
.st-future { border-color: #c9d0d8 !important; background: #fff; box-shadow: inset 0 0 0 1px #e6e9ee; color: #4b5563; }
table.cal { table-layout: fixed; min-width: 980px; }
table.cal th.day { text-align: center; font-weight: 500; }
table.cal th.day .dn { display: block; font-size: 12px; color: var(--muted); }
table.cal th.day .dnum { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; font-size: 14px; font-weight: 700; }
table.cal th.today .dnum { background: var(--brand); color: #fff; }
table.cal th.wkend .dn { color: #c22a2a; }
table.cal td.cell { vertical-align: top; padding: 6px; border-left: 1px solid var(--line-2); }
table.cal td.cell.today { background: #f7fbf3; }
table.cal td.who { width: 190px; }
table.cal td.who b { display: block; font-weight: 600; }
table.cal td.who small { color: var(--muted); }
table.cal th.who { width: 190px; }
table.cal th.tot, table.cal td.tot { width: 92px; text-align: right; }
table.mg { min-width: 1100px; }
table.mg td.mc { min-width: 38px; }
table.mg th.d { text-align: center; padding: 8px 2px; font-weight: 500; min-width: 38px; }
table.mg th.d .dn { display: block; font-size: 11px; color: var(--muted); }
table.mg th.d b { font-size: 13px; }
table.mg th.d.today b { background: var(--brand); color: #fff; border-radius: 10px; padding: 1px 5px; }
table.mg th.d.wkend .dn { color: #c22a2a; }
table.mg td.mc { padding: 4px 2px; text-align: center; border-left: 1px solid var(--line-2); vertical-align: top; }
table.mg td.mc.today { background: #f7fbf3; }
.dot { display: block; height: 20px; border-radius: 4px; margin: 0 auto 2px; width: 34px; border-left: 3px solid; font-size: 10.5px; line-height: 20px; color: #374151; cursor: pointer; overflow: hidden; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dot.st-future { box-shadow: none; background: #fafbfc; border-left-color: #dfe3e8 !important; }
.dot:last-child { margin-bottom: 0; }
table.mg td.who { min-width: 180px; }
table.mg td.who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
table.mg td.who small { color: var(--muted); }
table.mg td.s, table.mg th.s { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pop { position: fixed; z-index: 90; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .22); padding: 12px 14px; font-size: 13px; min-width: 220px; max-width: 300px; }
.pop h5 { font-size: 14px; margin: 0 0 6px; }
.pop .l { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line-2); }
.pop .l:last-child { border-bottom: 0; }
.pop .l span { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.stat { background: #fff; border-radius: var(--r); padding: 12px 14px; }
.stat span { display: block; font-size: 12.5px; color: var(--muted); }
.stat b { font-size: 20px; font-weight: 750; }
.stat small { display: block; font-size: 12px; color: var(--muted); }
.stat.c-ok b { color: var(--c-ok); } .stat.c-late b { color: var(--c-late); } .stat.c-miss b { color: var(--c-miss); } .stat.c-none b { color: #c97a00; } .stat.c-off b { color: #6b7280; }

/* ---------------------------------------------------------------- thiết lập */
.setl { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 10px; align-items: start; }
.snav { background: #fff; border-radius: var(--r); padding: 10px 8px; position: sticky; top: 70px; }
.snav .g { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 10px 10px 4px; }
.snav .g:first-child { padding-top: 2px; }
.snav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.snav a:hover { background: var(--line-2); }
.snav a.on { background: var(--brand-soft); color: #2f6118; font-weight: 600; }
.snav a svg { color: #5b6573; width: 17px; height: 17px; }
.snav a.on svg { color: var(--brand); }
.snav a .ext { margin-left: auto; width: 13px; height: 13px; }
.chk { display: flex; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.chk:last-child { border-bottom: 0; }
.chk .tick { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #9aa3ad; display: grid; place-items: center; color: #6b7280; flex: none; }
.chk .tick.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.chk .tx { flex: 1; min-width: 0; }
.chk .tx b { display: block; font-weight: 650; }
.chk .tx span { font-size: 12.5px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; }
.form-row label { font-weight: 600; font-size: 13.5px; }
.form-row .inp { height: 36px; max-width: 460px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 38px; height: 22px; appearance: none; background: #cfd5dc; border-radius: 11px; position: relative; cursor: pointer; transition: .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--brand-2); }
.switch input:checked::after { left: 18px; }
.empty-box { text-align: center; padding: 46px 20px 50px; color: var(--muted); }
.empty-box .ill { width: 74px; height: 74px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.empty-box .ill svg { width: 34px; height: 34px; }
.empty-box h4 { color: var(--text); font-size: 15px; margin-bottom: 6px; }
.empty-box p { max-width: 520px; margin: 0 auto 14px; font-size: 13.5px; }
.msg-page { max-width: 560px; margin: 40px auto; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 14px 0 0; }

/* ---------------------------------------------------------------- đăng nhập */
.login-bg { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #dff0d2 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e2f1d6 0, transparent 55%), #f3f6f1; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(30, 60, 10, .14); padding: 30px 28px 24px; }
.login-card .lg { display: flex; justify-content: center; margin-bottom: 6px; }
.login-card .lg img { height: 54px; }
.login-card h1 { text-align: center; font-size: 19px; margin: 8px 0 2px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-card label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 5px; }
.login-card input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; outline: none; }
.login-card input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(87, 161, 49, .15); }
.login-card .go { width: 100%; height: 44px; margin-top: 18px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: 700 15px/1 inherit; cursor: pointer; }
.login-card .go:hover { background: #3b7221; }
.login-card .err { background: #fdeaea; color: #b42318; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 4px; }
.login-card .note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------------------------------------------------------------- màn hẹp */
@media (max-width: 1180px) {
  .tnav > li > a { padding: 0 8px; font-size: 13.5px; }
  .tbtn .lbl { display: none; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .rcol { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
  .rcol .card { margin: 0; }
}
@media (max-width: 960px) {
  .tnav { display: none; }
  .burger { display: inline-flex; }
  .topbar-in { padding-left: 6px; }
  .logo { margin-left: 4px; }
  .lf, .setl { grid-template-columns: minmax(0, 1fr); }
  .fp { position: static; max-height: none; display: none; }
  .fp.show { display: block; }
  .fp-toggle { display: inline-flex; }
  .snav { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 6px; }
  .snav .g { display: none; }
  .snav a { white-space: nowrap; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .ph h1 { width: auto; }
  .search { flex: 1 1 100%; order: 5; }
  .tl-row { grid-template-columns: 22px 92px minmax(0, 1fr) 84px; gap: 8px; font-size: 13px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 8px 8px 24px; }
  .topbar { padding: 6px 6px 0; }
  .tright { gap: 5px; }
  .tbtn.hide-sm { display: none; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  table.t th, table.t td { padding: 9px 9px; }
  .ph .acts { margin-left: 0; }
  .cv { height: 220px; }
  table.t .hide-sm { display: none; }
}
/* menu điện thoại */
.mnav { position: fixed; inset: 0; z-index: 100; display: none; }
.mnav.show { display: block; }
.mnav .shade { position: absolute; inset: 0; background: rgba(15, 23, 42, .4); }
.mnav .panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(330px, 88vw); background: #fff; overflow: auto; padding: 10px 10px 30px; box-shadow: 4px 0 24px rgba(0, 0, 0, .18); }
.mnav .mh { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.mnav .mh img { height: 24px; }
.mnav details { border-bottom: 1px solid var(--line-2); }
.mnav summary { list-style: none; padding: 12px 10px; font-weight: 650; display: flex; justify-content: space-between; cursor: pointer; }
.mnav summary::-webkit-details-marker { display: none; }
.mnav summary::after { content: "›"; transform: rotate(90deg); color: var(--muted); }
.mnav details[open] summary::after { transform: rotate(-90deg); }
.mnav details a, .mnav > .panel > a { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 22px; color: var(--text); text-decoration: none; border-radius: 8px; }
.mnav > .panel > a { padding-left: 10px; font-weight: 650; border-bottom: 1px solid var(--line-2); border-radius: 0; }
.mnav details a.on, .mnav > .panel > a.on { background: var(--brand-soft); color: #2f6118; }
.mnav .mg { font-size: 12px; color: var(--muted); padding: 8px 10px 2px 22px; }
@media print { .topbar, .fp, .ph .acts, .legend { display: none !important; } .lf { grid-template-columns: 1fr; } body { background: #fff; } }
