/* ============================================================
   TEK ACCESS — Cổng nhân viên (ESS). Mobile-first, chỉ xem.
   Dựa trên biến màu của shared/css/tek.css; không dùng sidebar quản trị.
   Bố cục: .ess-top (thanh trên) · .ess-wrap (cột nội dung ≤ 520px) · .ess-nav (thanh tab dưới)
   ============================================================ */
body.ess { background: var(--tek-bg); font-size: .95rem; -webkit-tap-highlight-color: transparent; }
.ess-wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 96px; }

/* thanh trên */
.ess-top { background: var(--tek-primary); color: #fff; position: sticky; top: 0; z-index: 1020; box-shadow: var(--tek-shadow); }
.ess-top .in { max-width: 520px; margin: 0 auto; height: 54px; display: flex; align-items: center; gap: .6rem; padding: 0 16px; }
.ess-brand { font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; white-space: nowrap; }
.ess-brand span { color: #8FB4DA; font-weight: 400; }
.ess-top .org { font-size: .72rem; color: #A9C6E3; line-height: 1.15; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ess-top .btn { color: #fff; min-width: 40px; min-height: 40px; }
.ess-top .dropdown-menu { font-size: .9rem; }

/* hồ sơ */
.ess-me { display: flex; align-items: center; gap: .75rem; padding: 14px 0 10px; }
.ess-me .nm { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.ess-me small { color: var(--tek-muted); font-size: .8rem; display: block; }
.ess-ro { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--tek-info); background: var(--tek-info-100); border-radius: 99px; padding: .1rem .55rem; font-weight: 600; white-space: nowrap; }

/* chọn tháng */
.ess-month { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--tek-line); border-radius: var(--tek-radius); padding: 4px; margin-bottom: 10px; }
.ess-month .btn { min-width: 44px; min-height: 40px; }
.ess-month b { font-size: 1rem; color: var(--tek-primary); }
.ess-month small { display: block; text-align: center; font-size: .72rem; color: var(--tek-muted); }

/* thẻ & ô số */
.ess-card { background: #fff; border: 1px solid var(--tek-line); border-radius: var(--tek-radius); padding: 12px 14px; margin-bottom: 12px; }
.ess-card h2 { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tek-muted); font-weight: 700; margin: 0 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.ess-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ess-tile { background: #fff; border: 1px solid var(--tek-line); border-radius: var(--tek-radius); padding: 10px 12px; }
.ess-tile .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tek-muted); font-weight: 700; }
.ess-tile .v { font-size: 1.45rem; font-weight: 700; color: var(--tek-primary); line-height: 1.2; }
.ess-tile .v small { font-size: .8rem; color: var(--tek-muted); font-weight: 400; }
.ess-tile .d { font-size: .74rem; color: var(--tek-muted); }

.ess-banner { border-radius: var(--tek-radius-sm); padding: 8px 12px; font-size: .8rem; margin-bottom: 12px; display: flex; gap: .5rem; align-items: flex-start; }
.ess-banner.open { background: var(--tek-primary-100); color: var(--tek-primary); }
.ess-banner.locked { background: var(--tek-ok-100); color: #154f31; }

/* lịch tháng */
.ess-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ess-cal .dh { text-align: center; font-size: .68rem; font-weight: 700; color: var(--tek-muted); padding-bottom: 2px; }
.ess-cal .dh.we { color: #a0a4a8; }
.ess-cal .dd { aspect-ratio: 1 / 1.08; min-height: 44px; border-radius: 6px; border: 1px solid #e6e8eb; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; cursor: pointer; padding: 0; background: #fff; }
.ess-cal .dd .n { position: absolute; top: 2px; left: 4px; font-size: .62rem; color: var(--tek-muted); font-weight: 600; }
.ess-cal .dd .s { font-size: .9rem; font-weight: 700; margin-top: 6px; }
.ess-cal .dd .t { font-size: .56rem; color: var(--tek-muted); font-family: Consolas, monospace; line-height: 1; }
.ess-cal .dd.late::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--tek-warn); }
.ess-cal .dd.ot .s::after { content: "+"; font-size: .7rem; color: var(--tek-accent); vertical-align: super; }
.ess-cal .dd.today { box-shadow: 0 0 0 2px var(--tek-accent); }
.ess-cal .dd.edited { border: 2px solid #D6B656; }
.ess-cal .dd.ts-future { cursor: default; }
.ess-cal .dd.ts-future .t, .ess-cal .dd.ts-future .s { visibility: hidden; }
.ess-cal .blank { visibility: hidden; }
.ess-legend { display: flex; flex-wrap: wrap; gap: .35rem .7rem; font-size: .72rem; color: var(--tek-muted); margin-top: 10px; }
.ess-legend b { display: inline-flex; min-width: 22px; height: 18px; border-radius: 3px; border: 1px solid #e0e3e7; align-items: center; justify-content: center; font-size: .64rem; margin-right: .2rem; }

/* danh sách */
.ess-list { list-style: none; margin: 0; padding: 0; }
.ess-list li { display: flex; align-items: center; gap: .65rem; padding: .6rem 0; border-bottom: 1px solid #f0f1f3; font-size: .86rem; }
.ess-list li:last-child { border-bottom: 0; }
.ess-list .tm { font-family: Consolas, monospace; font-weight: 700; color: var(--tek-primary); min-width: 44px; }
.ess-list .ic { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 34px; background: var(--tek-primary-100); color: var(--tek-primary); }
.ess-list .ic.ok { background: var(--tek-ok-100); color: var(--tek-ok); }
.ess-list .ic.danger { background: var(--tek-danger-100); color: var(--tek-danger); }
.ess-list .ic.warn { background: var(--tek-warn-100); color: var(--tek-warn); }
.ess-list .bd { flex: 1 1 auto; min-width: 0; }
.ess-list .bd small { display: block; color: var(--tek-muted); font-size: .75rem; }
.ess-list .rt { text-align: right; font-size: .78rem; white-space: nowrap; }
.ess-day { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tek-muted); font-weight: 700; margin: .8rem 0 .1rem; }

.ess-shift { display: inline-flex; min-width: 46px; height: 26px; border-radius: 5px; color: #fff; font-weight: 700; font-size: .78rem; align-items: center; justify-content: center; padding: 0 .4rem; }
.ess-shift.off { background: #E6E9EE; color: var(--tek-muted); }
.ess-big { font-size: 2.4rem; font-weight: 700; color: var(--tek-primary); line-height: 1; }
.ess-bar { height: 10px; border-radius: 99px; background: #eceef1; overflow: hidden; display: flex; }
.ess-bar i { display: block; height: 100%; }

/* đoạn chú thích chỉ xem */
.ess-foot { font-size: .78rem; color: var(--tek-muted); text-align: center; padding: 6px 8px 12px; }

/* thanh tab dưới */
.ess-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--tek-line); padding-bottom: env(safe-area-inset-bottom); }
.ess-nav .in { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.ess-nav button { border: 0; background: none; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; color: var(--tek-muted); font-weight: 600; }
.ess-nav button i { font-size: 1.15rem; }
.ess-nav button.on { color: var(--tek-primary); box-shadow: inset 0 3px 0 var(--tek-primary); }
.ess-pane { display: none; } .ess-pane.on { display: block; }

/* ngăn chi tiết ngày (offcanvas bottom) */
.offcanvas-bottom.ess-sheet { height: auto; max-height: 82vh; border-radius: 14px 14px 0 0; max-width: 520px; margin: 0 auto; }
.ess-sheet .grab { width: 40px; height: 4px; border-radius: 99px; background: #d5d9de; margin: 8px auto 0; }
.ess-kv { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px solid #f0f1f3; font-size: .88rem; }
.ess-kv:last-child { border-bottom: 0; }
.ess-kv .k { color: var(--tek-muted); }
.ess-kv .v { font-weight: 600; text-align: right; }

/* trang đăng nhập */
.ess-login { min-height: 100vh; display: flex; flex-direction: column; }
.ess-login .hero { background: var(--tek-primary); color: #fff; padding: 28px 20px 64px; text-align: center; }
.ess-login .hero .lg { width: 64px; height: 64px; border-radius: 14px; background: #fff; color: var(--tek-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.ess-login .hero .org { font-weight: 700; font-size: 1.05rem; }
.ess-login .hero small { color: #A9C6E3; display: block; font-size: .8rem; }
.ess-login .box { background: #fff; border: 1px solid var(--tek-line); border-radius: 14px; box-shadow: var(--tek-shadow-lg); padding: 20px 18px; margin: -44px 16px 0; max-width: 440px; width: calc(100% - 32px); align-self: center; }
.ess-login .form-control { min-height: 48px; font-size: 1rem; }
.ess-login .btn-lg { min-height: 52px; }
.ess-login .input-group .btn { min-width: 48px; }
.ess-login .step { display: none; } .ess-login .step.on { display: block; }
.ess-login .foot { text-align: center; font-size: .76rem; color: var(--tek-muted); padding: 18px 20px 24px; max-width: 460px; align-self: center; }
.ess-login .tek-mock-note { margin: 12px 16px 0; max-width: 440px; align-self: center; width: calc(100% - 32px); }
.ess-login .lang { position: absolute; top: 12px; right: 12px; }
.ess-login .lang .btn { color: #fff; border-color: rgba(255,255,255,.35); }

@media (min-width: 768px) {
    .ess-wrap { padding-top: 6px; }
    .ess-cal .dd .t { font-size: .62rem; }
}
