/* =========================================================
   Trang chủ (01 – chưa đăng nhập / 02 – đã đăng nhập)
   ========================================================= */
.ehs-home { display: grid; grid-template-columns: minmax(0, 1fr) 22.35rem; column-gap: 1.45rem; align-items: start; }
.ehs-home__left, .ehs-home__right { display: flex; flex-direction: column; min-width: 0; }

/* ---------- Hero banner ---------- */
.hero { position: relative; aspect-ratio: 1024 / 417; border-radius: 1rem; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 0.2rem 1rem rgba(238, 238, 238, .5); background: #fff; }
.hero > img { width: 100%; height: 100%; object-fit: cover; }
.hero__actions { position: absolute; left: 33.3%; bottom: 4.8%; display: flex; gap: 0.55rem; }
.hero__actions .btn { width: 8.25rem; }

/* ---------- Activities ("Quy định tính điểm & Thi đua") ---------- */
.activities { margin-top: 1.35rem; height: 18rem; background: #fff; border: 1px solid var(--line); border-radius: 1rem; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .05)); padding: 1.1rem 1.4rem 1.4rem; }
.activities__title { font-size: 1rem; font-weight: 600; line-height: 1.4rem; letter-spacing: -.5px; color: var(--ink-3); height: 1.9rem; }
.activities__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 15.5rem)); justify-content: center; gap: 0.7rem; }

.act { position: relative; height: 13.5rem; background: #fff; border: 1px solid var(--line-2); border-radius: 1rem; box-shadow: 0 0.2rem 0.9rem rgba(0, 18, 45, .05); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.act:hover { transform: translateY(-0.15rem); box-shadow: 0 0.6rem 1.4rem rgba(0, 18, 45, .1); }
.act__img { height: 5.4rem; margin: -1px -1px 0; border-radius: 0.6rem 0.6rem 0 0; overflow: hidden; }
.act__img img { width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.act__body { position: absolute; left: 0.75rem; right: 1px; top: 5.85rem; height: 7.5rem; }
.act__head { display: flex; align-items: center; gap: 0.5rem; min-height: 2.3rem; }
.act__icon { width: 2.3rem; height: 2.3rem; border-radius: 1.3rem; flex: none; }
.act__name { font-size: 0.75rem; font-weight: 500; line-height: 1rem; }
.act__desc { margin-top: 1px; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.8rem; color: #73839a; }
.act__status { position: absolute; left: 2px; right: 0.7rem; top: 3.7rem; display: flex; justify-content: space-between; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 600; line-height: 0.8rem; color: #23436b; }
.act__track { position: absolute; left: 2px; right: 0.7rem; top: 4.9rem; }
.act__foot { position: absolute; left: 2px; right: 0; top: 5.4rem; height: 2.1rem; display: flex; align-items: center; justify-content: space-between; }
.act__score { height: 1.25rem; padding: 0 0.45rem; font-weight: 600; }
.act__cta { height: 2.1rem; width: 5.2rem; border-radius: 0.45rem; font-size: max(0.7rem, var(--fs-min2, 0px)); font-weight: 600; line-height: 1rem; color: #123a73; display: grid; place-items: center; transition: background-color .2s; }
.act__cta:hover { background: #f2f7fc; }

.act--news .act__name { color: #00a66a; }
.act--news .act__desc { height: 0.65rem; line-height: 0.85rem; color: #77869c; }
.act--gemba .act__desc { height: 1.25rem; }
.act--news .act__pct, .act--news .act__score { color: var(--green-2); }
.act--news .act__score { background: #e0f7ee; }
.act--news .track__value { background: var(--green-2); }
.act--game .act__name, .act--game .act__pct, .act--game .act__score { color: var(--blue); }
.act--game .act__score { background: #e6eeff; }
.act--game .track__value { background: var(--blue); }
.act--gemba .act__name, .act--gemba .act__pct, .act--gemba .act__score { color: var(--orange); }
.act--gemba .act__score { background: #fff1df; }
.act--gemba .track__value { background: var(--orange); }

/* ---------- Score structure ---------- */
.score { margin-top: 1.2rem; margin-left: -0.15rem; padding: 0.75rem 0.85rem 0.85rem 0.85rem; border-radius: 1rem; }
.score .card__title { padding-left: 2px; }
.score__sub { margin-top: 1px; padding-left: 2px; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.85rem; color: #7d8ba1; }
.score__bar { margin-top: 0.9rem; display: flex; height: 1.2rem; border-radius: 0.5rem; overflow: hidden; }
.score__bar span { display: grid; place-items: center; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 700; line-height: 0.8rem; color: #fff; }
.score__bar span:nth-child(1) { flex: 250; background: #00a66a; }
.score__bar span:nth-child(2) { flex: 500; background: var(--blue); }
.score__bar span:nth-child(3) { flex: 234; background: var(--orange); }
.score__items { margin-top: 1.35rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.score-item { position: relative; min-height: 9.1rem; height: 100%; padding: 0.45rem 0.4rem 0.6rem 0.4rem; background: #fafcfe; border: 1px solid #e5ebf3; border-radius: 0.7rem; }
.score-item__head { display: flex; align-items: flex-start; gap: 0.55rem; }
.score-item__head img { width: 2.3rem; height: 2.3rem; border-radius: 1.3rem; flex: none; }
.score-item__name { font-size: max(0.7rem, var(--fs-min2, 0px)); font-weight: 500; line-height: 0.8rem; color: #243957; padding-top: 2px; }
.score-item__pill { position: absolute; right: 0.4rem; top: 0.35rem; width: 3.1rem; height: 1rem; }
.score-item__body { margin: -1.3rem 0 0 2.85rem; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 1rem; color: #78869a; }
.score-item__body ul { list-style: none; padding: 0; margin: 0; }
.score-item__body ol { margin: 0; padding-left: 0.9rem; }
.score-item__body ol li::marker { font-weight: 500; }
.score-item__body ol ul { padding-left: 0.2rem; }
.score-item__body ol ul li { position: relative; padding-left: 0.5rem; }
.score-item__body ol ul li::before { content: '•'; position: absolute; left: 0; }
.score-item__body b { font-weight: 500; }

/* ---------- Login card (right column) ---------- */
.login-card { height: 20.8rem; box-shadow: 0 0.2rem 1rem rgba(238, 238, 238, .5); }
.login-card .panel__body { padding-top: 1rem; }

/* ---------- Progress card (logged in) ---------- */
.progress-card { position: relative; height: 20.85rem; border-radius: 0.7rem; overflow: hidden; color: #fff; background: linear-gradient(90deg, #07539d, #063a76); }
.progress-card__title { position: absolute; left: 1.4rem; top: 1.4rem; font-size: 1rem; font-weight: 600; line-height: 1.3rem; }
.progress-card__more { position: absolute; right: 1.45rem; top: 1.7rem; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 600; line-height: 0.8rem; color: #e6f0ff; white-space: pre; }
.progress-card__more:hover { text-decoration: underline; }
.ring { position: absolute; left: 1.4rem; top: 4.2rem; width: 7rem; height: 7rem; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__num { position: absolute; inset: 1.85rem 0 auto; text-align: center; font-size: 1.9rem; font-weight: 700; line-height: 2.2rem; }
.ring__unit { position: absolute; inset: 3.95rem 0 auto; text-align: center; font-size: max(0.65rem, var(--fs-min, 0px)); font-weight: 600; line-height: 0.9rem; color: #d9e8f8; }
.rank-box { position: absolute; left: 9.5rem; top: 3.9rem; width: 11.3rem; height: 2.9rem; background: #0c4a88; border: 1px solid #2b6ea8; border-radius: 0.5rem; }
.rank-box img { position: absolute; left: 0.4rem; top: 0.3rem; width: 2rem; height: 2rem; transform: scaleX(-1); }
.rank-box__title { position: absolute; left: 2.6rem; top: 0.45rem; font-size: 0.75rem; font-weight: 500; line-height: 1rem; }
.rank-box__sub { position: absolute; left: 2.6rem; top: 1.45rem; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.8rem; color: #c9ddf0; }
.stat-list { position: absolute; left: 9.5rem; top: 7rem; width: 11.3rem; list-style: none; margin: 0; padding: 0; }
.stat-list li + li { border-top: 1px solid #1b659f; }
.stat-list a { display: flex; align-items: center; gap: 0.5rem; height: 1.9rem; padding: 0 0 0 0.3rem; font-size: max(0.65rem, var(--fs-min, 0px)); font-weight: 500; line-height: 0.9rem; color: #f3f8fe; }
.stat-list a img { width: 1.15rem; height: 1.15rem; }
.stat-list a span { flex: 1; }
.stat-list a i { font-style: normal; font-size: 0.8rem; font-weight: 600; width: 1.15rem; text-align: center; }
.stat-list a:hover span { text-decoration: underline; }
.progress-card__art { position: absolute; left: 0; bottom: 0; width: 22.35rem; height: 8.3rem; pointer-events: none; }

/* ---------- Ranking card ---------- */
.ranking { margin-top: 1.3rem; height: 14.45rem; padding: 0.75rem 0.65rem 0; }
/* Đăng nhập xong ẩn .login-card (xem main.js renderUser()) -> bỏ khoảng trống margin-top để lại ở trên. */
section.panel.login-card[hidden] + section.card.ranking { margin: 0; }
.ranking .card__title { padding-left: 0.3rem; }
.ranking__week { position: absolute; right: 0.7rem; top: 0.75rem; width: 3.9rem; height: 1.4rem; background: #e6eeff; color: var(--blue); font-size: max(0.7rem, var(--fs-min2, 0px)); }
.rank-rows { list-style: none; margin: 0.7rem 0 0; padding: 0; }
.rank-row { position: relative; height: 2.75rem; border-bottom: 1px solid #eef2f7; margin-bottom: 0.15rem; border-radius: 0.45rem 0.45rem 0 0; transition: background-color .2s; }
.rank-row:hover { background: #f8fafc; }
.rank-row__no { position: absolute; left: 0.4rem; top: 0.85rem; width: 1.7rem; text-align: center; font-size: max(0.65rem, var(--fs-min, 0px)); font-weight: 700; line-height: 0.9rem; color: #8ea3bb; }
.rank-row:nth-child(1) .rank-row__no { color: #f5b000; }
.rank-row:nth-child(3) .rank-row__no { color: #d8772d; }
.rank-row__avatar { position: absolute; left: 2.5rem; top: 0.5rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #e7edf4; display: grid; place-items: center; font-size: max(0.65rem, var(--fs-min, 0px)); font-weight: 600; line-height: 0.85rem; color: #223955; }
.rank-row__avatar--gold { background: #fff2d2; border: 1px solid #ffc737; }
.rank-row__crown { position: absolute; left: 3.55rem; top: 0.3rem; width: 0.75rem; height: 0.75rem; }
.rank-row__name { position: absolute; left: 4.8rem; top: 0.4rem; font-size: max(0.65rem, var(--fs-min, 0px)); font-weight: 600; line-height: 0.85rem; color: #223955; }
.rank-row__unit { position: absolute; left: 4.8rem; top: 1.35rem; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.7rem; color: #8290a4; }
.rank-row__pt { position: absolute; right: 1px; top: 0.8rem; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 500; line-height: 0.8rem; color: #223955; }
.ranking__more { position: absolute; left: 50%; bottom: 0.55rem; transform: translateX(-50%); width: 11.9rem; height: 2rem; }

/* ---------- Latest news ---------- */
.latest { margin-top: 1.2rem; height: 20.1rem; overflow: hidden; }
.latest__head { position: absolute; left: 0.75rem; top: 0.6rem; width: 20.75rem; display: flex; align-items: center; justify-content: space-between; }
.latest__head .card__title { line-height: 1.2rem; }
.latest__head .btn { height: 1.85rem; width: 6.3rem; font-size: max(0.7rem, var(--fs-min2, 0px)); }

/* Footer trang chủ chỉ nằm dưới cột trái (theo thiết kế) – .footer--static (templates/static.php)
   dùng chung layout .ehs-home nên cần giới hạn y hệt, nếu không footer kéo full-width đè lên cột phải. */
.footer--home, .footer--static { max-width: calc(100% - 22.35rem - 1.45rem); }
