:root {
  --bg: #f3f4f3; --panel: #fff; --line: #e4e4e4; --text: #2b2b2b; --muted: #6f6f6f; --brand: #006838; --brand-d: #004d29;
  --hpd: #006838; --side: #f7f8f7; --side-active: #e1efe6; --danger: #d64545; --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 27, 45, .05);
  --c-gray: #6f6f6f; --c-blue: #006838; --c-purple: #7b5cd6; --c-orange: #e08a1e; --c-green: #3f9a5f; --c-red: #d64545;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.overdue { color: var(--danger); font-weight: 600; }
.tick { color: var(--text); }

/* logo */
.logo { text-align: center; padding: 4px 18px 14px; }
.logo img { max-width: 100%; height: auto; max-height: 64px; mix-blend-mode: multiply; }
.auth .logo img { max-height: 80px; }
.logo-t { font-weight: 900; font-size: 20px; letter-spacing: -.5px; color: #4e4e4e; }
.logo-t span { color: var(--hpd); }
.logo-s { font-size: 9px; color: #4e4e4e; font-weight: 600; margin-top: -3px; }

/* layout */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 14px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.nav a, .nav summary { display: flex; align-items: center; gap: 12px; padding: 9px 18px; color: var(--text); cursor: pointer; list-style: none; user-select: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: '▸'; margin-left: auto; color: var(--muted); font-size: 11px; }
.nav details[open] summary::after { content: '▾'; }
.nav a:hover, .nav summary:hover { background: #eef5f0; text-decoration: none; }
.nav a.active { background: var(--side-active); font-weight: 600; }
.nav .sub a { padding-left: 46px; font-size: 13.5px; }
.nav .sub .ico { display: none; }
.nav .ico { width: 20px; text-align: center; opacity: .85; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 52px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 18px; position: sticky; top: 0; z-index: 5; }
.top .title { font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.burger { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.user-btn:hover { background: var(--bg); }
.avatar { width: 22px; height: 22px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 9px; flex: none; vertical-align: middle; }
.note .avatar, .user-btn .avatar { width: 28px; height: 28px; font-size: 11px; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.dropdown { position: absolute; right: 0; top: 110%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.12); min-width: 220px; padding: 6px; display: none; z-index: 20; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; background: none; border: 0; cursor: pointer; color: var(--text); }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); text-decoration: none; }
.content { padding: 18px 20px 40px; width: 100%; }

/* page header */
.page-h { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.page-h h1 { font-size: 22px; font-weight: 400; margin: 0; }
.page-h h1 a { color: var(--brand); }
.page-h .sp, .toolbar .sp, .panel-h .sp { flex: 1; }
.hello { font-size: 20px; font-weight: 400; margin: 0 0 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 5px; border: 1px solid #d6d6d6; background: var(--panel); cursor: pointer; white-space: nowrap; color: var(--text); }
.btn:hover { background: #f6f7f6; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 3px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 5px 0 0 5px; }
.btn-group .btn:last-child { border-radius: 0 5px 5px 0; margin-left: -1px; }
.btn.on { background: #e9f1ec; border-color: #b8d9c4; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid #d6d6d6; background: #fff; border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { border-color: var(--brand); font-weight: 600; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel, #related > .panel, #sidepanels > .panel { margin-top: 14px; }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.panel-b { padding: 14px; }
.empty { color: var(--muted); padding: 18px 14px; text-align: center; }

/* toolbar */
.toolbar, .quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.input, .toolbar select, .quick select, .page-h select { padding: 6px 9px; border: 1px solid #d6d6d6; border-radius: 5px; background: #fff; min-width: 0; }
.searchbox { display: flex; border: 1px solid #d6d6d6; border-radius: 5px; background: #fff; width: 380px; max-width: 100%; }
.searchbox .input { border: 0; flex: 1; }
.searchbox span { padding: 6px 12px; border-left: 1px solid #d6d6d6; color: var(--muted); }
.chk-inline { display: inline-flex; align-items: center; gap: 5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b8d9c4; }

/* table */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.grid td.wrap { white-space: normal; min-width: 200px; max-width: 360px; }
.grid th { color: var(--muted); font-weight: 400; cursor: pointer; user-select: none; }
.grid th.nosort { cursor: default; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: #f7faf8; }
.grid.compact th, .grid.compact td { padding: 7px 12px; }
.grid td.num, .grid th.num { text-align: right; }
.grid td b { font-weight: 500; }
.lnk::before { content: '▪ '; color: #7fb394; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 8px 12px; color: var(--muted); }

.badge { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 13px; color: #fff; background: var(--c-gray); white-space: nowrap; }
.badge.blue { background: #2f8a57; } .badge.purple { background: #8a6fd6; } .badge.orange { background: #e5a033; }
.badge.green { background: #55b468; } .badge.red { background: #dc5e6a; } .badge.gray { background: #e9e9e9; color: #4e4e4e; }

/* detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-h { padding: 12px 16px 0; font-size: 15px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; padding: 12px 16px 16px; }
.field .lbl { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.field .val { min-height: 21px; word-break: break-word; }
.field.wide { grid-column: 1 / -1; }
.field .val.pre { white-space: pre-wrap; }
.side-card { padding: 14px 16px; display: grid; gap: 12px; }
.stagebar { display: flex; gap: 2px; margin-bottom: 14px; overflow-x: auto; }
.stagebar .st { flex: 1; min-width: 110px; border: 0; padding: 7px 8px; background: #e6e6e6; color: #4e4e4e; font-size: 12px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); }
.stagebar .st:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); }
.stagebar .st.past { background: #c4dccb; color: #004d29; }
.stagebar .st.cur { color: #fff; font-weight: 600; background: var(--brand); }
.stagebar .st.cur.gray { background: #8a8a8a; } .stagebar .st.cur.orange { background: var(--c-orange); } .stagebar .st.cur.green { background: var(--c-green); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 9px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .grow { flex: 1; min-width: 0; }
.mini-list .t { color: var(--text); }
.post-box { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.post-box textarea { flex: 1; resize: vertical; min-height: 36px; padding: 7px 9px; border: 1px solid #d6d6d6; border-radius: 5px; }
.note { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.note:last-child { border-bottom: 0; }
.note .body { flex: 1; min-width: 0; }
.note .post { white-space: pre-wrap; background: #f4f5f4; border-radius: 6px; padding: 7px 9px; margin-top: 4px; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpis .panel + .panel { margin-top: 0; }
.kpi { padding: 14px 16px; color: var(--text); }
a.kpi:hover { text-decoration: none; border-color: #b8d9c4; }
.kpi .k { color: var(--muted); font-size: 13px; }
.kpi .v { font-size: 24px; font-weight: 600; margin-top: 2px; }
.kpi .s { color: var(--muted); font-size: 12px; }
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dash > .panel + .panel { margin-top: 0; }
.dash .wide { grid-column: 1 / -1; }
.funnel { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 10px; }
.fn-row { width: 100%; display: flex; justify-content: center; }
.fn-bar { height: 26px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; clip-path: polygon(0 0, 100% 0, 97% 100%, 3% 100%); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.legend i, .pie-leg i { display: inline-block; width: 12px; height: 9px; border-radius: 2px; margin-right: 5px; }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 230px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.vb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.vb-bar { width: 70%; max-width: 36px; background: #6abf69; border-radius: 2px 2px 0 0; min-height: 2px; }
.vb-v { font-size: 10px; color: var(--muted); white-space: nowrap; }
.vb-l { font-size: 12px; margin-top: 4px; transform: translateY(18px); }
.vbars + * { margin-top: 22px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: 190px 1fr 80px; gap: 8px; align-items: center; font-size: 12.5px; }
.hb-t { height: 16px; background: #f1f2f1; }
.hb-t div { height: 100%; }
.hb-v { text-align: right; }
.pie-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pie { width: 180px; height: 180px; border-radius: 50%; flex: none; }
.pie-leg { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.kcol { display: flex; flex-direction: column; min-height: 300px; }
.kcol-h { padding: 4px 9px; color: #fff; font-size: 12.5px; background: #8f8f8f; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcol-h.blue { background: #2f8a57; } .kcol-h.orange { background: #e5a033; } .kcol-h.green { background: #55b468; }
.kcol-s { font-size: 11.5px; color: var(--muted); padding: 3px 2px 6px; }
.kcol-b { flex: 1; display: flex; flex-direction: column; gap: 8px; border-radius: 4px; }
.kcol.drag-over .kcol-b { outline: 2px dashed var(--brand); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; cursor: grab; font-size: 12.5px; }
.kcard .t { font-weight: 500; font-size: 13px; }
.kcard .m { color: var(--muted); }
.kcard .who { margin-top: 3px; }

/* calendar */
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 6px; overflow-x: auto; }
.day { background: #fff; border: 1px solid var(--line); border-radius: 5px; min-height: 340px; }
.day.today { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.day-h { padding: 7px 9px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ev { display: block; margin: 5px; padding: 5px 7px; border-radius: 4px; background: #e6f2ea; color: var(--text); font-size: 12.5px; border-left: 3px solid var(--brand); }
.ev:hover { text-decoration: none; background: #d4eadb; }
.ev.done { background: #eef7f0; border-color: var(--c-green); color: var(--muted); text-decoration: line-through; }
.ev.late { background: #fdeeee; border-color: var(--danger); }
.ev .tm { font-weight: 600; }

.checkin .sp { flex: 1; }
.checkin { display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin-bottom: 14px; flex-wrap: wrap; }

/* forms & modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 820px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.sm { max-width: 460px; }
.modal-h { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 17px; display: flex; }
.modal-h .x { margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-b { padding: 16px 20px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.form.one { grid-template-columns: 1fr; }
.form .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form .f.wide { grid-column: 1 / -1; }
.form label { font-size: 13px; color: var(--muted); }
.form label .req { color: var(--danger); }
.form input:not([type=checkbox]), .form select, .form textarea { padding: 7px 9px; border: 1px solid #d6d6d6; border-radius: 5px; background: #fff; width: 100%; }
.form textarea { min-height: 70px; resize: vertical; }
.form .chk { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.form .chk label { color: var(--text); }
.section-title { grid-column: 1 / -1; font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.parent-pick { display: grid; grid-template-columns: 150px 1fr; gap: 6px; }
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 6px 24px rgba(0,0,0,.12); z-index: 60; max-height: 240px; overflow-y: auto; display: none; }
.picker-list.open { display: block; }
.picker-list div { padding: 7px 10px; cursor: pointer; }
.picker-list div:hover { background: #eef5f0; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth .card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; width: 100%; max-width: 380px; }
.auth p { color: var(--muted); margin: 0 0 12px; }
.auth .btn { margin-top: 4px; }
.pw { display: flex; border: 1px solid #d6d6d6; border-radius: 5px; }
.pw input { border: 0 !important; }
.pw button { border: 0; background: none; padding: 0 10px; cursor: pointer; }

#toast-root { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #2b2b2b; color: #fff; padding: 10px 16px; border-radius: 6px; max-width: 420px; animation: tin .2s; }
.toast.error { background: var(--danger); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 1100px) { .detail, .dash { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; z-index: 40; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .burger { display: block; }
  .content { padding: 12px; }
  .fields, .form { grid-template-columns: 1fr; }
  .user-btn .nm, .top .btn-sm { display: none; }
  .hb { grid-template-columns: 110px 1fr 60px; }
}

/* thông báo */
.bell-wrap { position: relative; }
.bell { background: none; border: 0; font-size: 18px; cursor: pointer; padding: 4px 8px; position: relative; border-radius: 6px; }
.bell:hover { background: var(--bg); }
.bell-n { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; min-width: 16px; text-align: center; line-height: 16px; }
.dropdown.notif { width: 380px; max-width: 92vw; padding: 0; }
.notif-h { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notif-h .sp { flex: 1; }
.notif-h b { white-space: nowrap; }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 12.5px; }
#nlist { max-height: 420px; overflow-y: auto; }
.notif-i { display: flex !important; gap: 10px; padding: 10px 12px !important; border-bottom: 1px solid var(--line); border-radius: 0 !important; }
.notif-i.unread { background: #e8f3ec; }
.notif-i .ni { flex: none; }
/* chấm công */
.ck { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.ck-cam { position: relative; background: #111; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; }
.ck-cam video, .ck-cam img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.ck-cam img { transform: none; }
.ck-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; padding: 20px; text-align: center; }
.ck-info { display: flex; flex-direction: column; gap: 12px; }
.ck-info .btns { display: flex; gap: 8px; }
.ck-info .btns .btn { flex: 1; justify-content: center; padding: 10px; font-size: 15px; }
.seg { display: flex; gap: 6px; }
.seg label { flex: 1; border: 1px solid #d6d6d6; border-radius: 6px; padding: 8px; text-align: center; cursor: pointer; }
.seg label:has(input:checked) { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg input { display: none; }
.att { display: grid; grid-template-columns: 320px 1fr; gap: 16px; padding: 14px; margin-bottom: 14px; }
.att img { width: 100%; border-radius: 6px; }
.att .map { width: 100%; height: 220px; border: 0; border-radius: 6px; margin: 8px 0; }
@media (max-width: 760px) { .ck, .att { grid-template-columns: 1fr; } }

/* phép năm */
.balance { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.balance .sp { flex: 1; }
.bal-l { min-width: 260px; }
.bal-v { font-size: 28px; font-weight: 600; color: var(--hpd); }
.bal-v span { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.bar-t { height: 8px; background: #eef5f0; border-radius: 4px; margin: 4px 0 6px; width: 320px; max-width: 100%; }
.bar-t div { height: 100%; background: var(--hpd); border-radius: 4px; }

.panel.warn { padding: 12px 16px; background: #fff8e6; border-color: #f0d38a; }

/* ===== Mobile: vừa khung điện thoại, không phóng to/thu nhỏ ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: pan-x pan-y; }
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe, canvas { max-width: 100%; }
@media (max-width: 760px) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  /* iOS tự phóng to khi chữ ô nhập < 16px → đặt 16px */
  input, select, textarea, button { font-size: 16px !important; }
  .content { min-width: 0; overflow-x: hidden; }
  .layout, .main, .content > * { min-width: 0; max-width: 100%; }
  .card, .panel, .detail, .dash { min-width: 0; max-width: 100%; }
  .table-wrap, .kanban, .week, .stagebar { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .modal-bg { padding: 10px; }
  .modal-b { padding: 12px 14px; }
  .modal-h, .modal-f { padding-left: 14px; padding-right: 14px; }
  .dropdown { max-width: calc(100vw - 16px); }
  .top { gap: 6px; }
  h1, h2 { word-break: break-word; }
}

/* ===== Tông màu logo HPD: xanh lá #006838, xám #4e4e4e ===== */
:root { --gray: #4e4e4e; }
.top { border-top: 3px solid var(--brand); }
.nav a.active { background: var(--side-active); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.nav a.active .ico { opacity: 1; }
.nav summary { color: var(--gray); font-weight: 600; }
h1, .page-h h1, .modal-h { color: var(--gray); }
a { color: var(--brand); }
.btn.primary, .btn-primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover, .btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
::selection { background: #cfe6d8; }
input:focus, select:focus, textarea:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(0,104,56,.15) !important; outline: none; }
