/* App nhân viên (mobile-first) */
body { overscroll-behavior-y: contain; }
.app { min-height: 100dvh; background: radial-gradient(120% 50% at 80% 0%, color-mix(in srgb, #7dd3fc 35%, transparent), transparent 70%), var(--bg); padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.appbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.appbar h1 { flex: 1; margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.sync { padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-3); }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync.offline .dot { background: var(--bad); } .sync.pending .dot { background: var(--warn); }
.view { padding: 14px 14px 8px; display: grid; gap: 12px; max-width: 640px; margin: 0 auto; }

/* thẻ hồ sơ trung tâm */
.hero { position: relative; overflow: hidden; text-align: center; padding: 22px 16px 18px; border-radius: 20px;
  background: linear-gradient(160deg, #dbeafe 0%, #ede9fe 60%, #fce7f3 130%); border: 1px solid #c7d7fb; box-shadow: var(--shadow); color: #0f172a; }
.hero::before { content: ""; position: absolute; inset: 14px 26px auto; height: 70%; border-radius: 16px; background: rgba(255,255,255,.45); }
.hero > * { position: relative; }
.avatar { width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 24px;
  color: #fff; background: linear-gradient(135deg, #1d4ed8, #0ea5e9); border: 3px solid #fff; box-shadow: 0 4px 14px rgba(29,78,216,.3); object-fit: cover; }
.avatar.sm { width: 54px; height: 54px; font-size: 18px; margin: 0; }
.hero .name { font-size: 19px; font-weight: 800; text-transform: uppercase; letter-spacing: .2px; }
.hero .meta { font-size: 13.5px; color: #475569; margin-top: 4px; line-height: 1.4; }
.hero .meta.code { color: #1d4ed8; }
:root[data-theme="dark"] .hero { background: linear-gradient(160deg, #172554, #2e1065 80%); border-color: #2b3b66; color: #e6ecf5; }
:root[data-theme="dark"] .hero::before { background: rgba(255,255,255,.05); }
:root[data-theme="dark"] .hero .meta { color: #a9b6cb; } :root[data-theme="dark"] .hero .meta.code { color: #93c5fd; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .hero { background: linear-gradient(160deg, #172554, #2e1065 80%); border-color: #2b3b66; color: #e6ecf5; }
  :root[data-theme="auto"] .hero::before { background: rgba(255,255,255,.05); }
  :root[data-theme="auto"] .hero .meta { color: #a9b6cb; }
}
.today-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.today-row .clock { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.today-row .date { font-size: 13px; color: var(--text-3); text-align: right; }

/* lưới thao tác nhanh / tính năng */
.qa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px 8px; }
.qa { display: grid; justify-items: center; gap: 7px; border: 0; background: none; padding: 4px 2px; cursor: pointer; font-size: 12.5px; color: var(--text-2); line-height: 1.25; text-align: center; }
.qa-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 18%, transparent); }
.qa-ic svg { width: 26px; height: 26px; }
.qa:active .qa-ic { transform: scale(.94); }

/* nút chấm công nổi */
.fab { position: fixed; z-index: 70; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 50%;
  border: 0; color: #fff; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #fb923c, #ea580c 70%); box-shadow: 0 8px 22px rgba(234,88,12,.45); }
.fab svg { width: 32px; height: 32px; }
.fab:active { transform: scale(.94); }

/* thẻ tóm tắt báo cáo */
.summary-card { border-radius: 18px; padding: 14px; background: linear-gradient(160deg, #e0edff, #ede9fe); border: 1px solid #c7d7fb; }
.summary-card .sc-h { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.summary-card .sc-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #1d4ed8; color: #fff; }
.summary-card .sc-ic svg { width: 22px; height: 22px; }
.summary-card .sc-b { background: var(--surface); border-radius: 14px; padding: 12px 14px; border: 1px solid #c4b5fd; }
.summary-card .sc-b p { margin: 4px 0 0; line-height: 1.55; }
:root[data-theme="dark"] .summary-card { background: linear-gradient(160deg, #172554, #2e1065); border-color: #2b3b66; }

/* trang Thêm */
.row-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--border); cursor: pointer; color: var(--text); font: inherit; }
.row-card.static { cursor: default; }
.row-card .up, .up { text-transform: uppercase; letter-spacing: .2px; }
.sec-title { margin: 8px 2px -2px; font-size: 18px; }
.ic-blue { color: var(--primary); display: inline-grid; } .ic-red { color: var(--bad); display: inline-grid; }
.ic-blue svg, .ic-red svg { width: 22px; height: 22px; }
.list-menu { display: grid; }
.lm { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: var(--text); cursor: pointer; }
.lm:first-child { border-top: 0; }

.shift { display: flex; gap: 12px; align-items: center; }
.shift .bar { width: 6px; align-self: stretch; border-radius: 6px; background: var(--primary); }
.shift .t { font-size: 13px; color: var(--text-3); }
.shift .n { font-weight: 700; }
.inout { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.inout div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.inout b { display: block; font-size: 20px; }
.inout span { font-size: 12px; color: var(--text-3); }

.punch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.punch .btn { min-height: 60px; font-size: 16px; font-weight: 750; border-radius: 16px; letter-spacing: .3px; flex-direction: column; gap: 2px; }
.punch .btn small { font-weight: 600; font-size: 11.5px; opacity: .85; letter-spacing: 0; }
.punch .btn.in.primary { background: #047857; border-color: #047857; }
.punch .btn.out.primary { background: #c2410c; border-color: #c2410c; }
.qrbtn { margin-top: 10px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { padding: 12px 14px; }
.stat .k { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 750; margin-top: 2px; }

.list { display: grid; }
.li { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.li:first-child { border-top: 0; }
.li .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 13px; }
.li .ic.in { background: var(--ok-soft); color: var(--ok); } .li .ic.out { background: #fff1e8; color: #c2410c; }
:root[data-theme="dark"] .li .ic.out { background: #2d1a10; }
.li .main { flex: 1; min-width: 0; }
.li .title { font-weight: 650; } .li .sub { font-size: 12.5px; color: var(--text-3); }

.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.nav button { display: grid; place-items: center; gap: 2px; min-height: 60px; border: 0; background: none; color: var(--text-3);
  font-size: 11px; font-weight: 650; cursor: pointer; }
.nav button svg { width: 23px; height: 23px; }
.nav button[aria-current="page"] { color: var(--primary); }

.month { display: flex; align-items: center; justify-content: space-between; }
.month b { font-size: 16px; }
.day { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); }
.day .d { text-align: center; line-height: 1.1; }
.day .d b { display: block; font-size: 19px; } .day .d span { font-size: 11px; color: var(--text-3); font-weight: 650; }
.day.today { background: var(--primary-soft); }

.sheet-back { position: fixed; inset: 0; z-index: 200; background: rgba(2, 6, 23, .55); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-width: 640px; margin: 0 auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 6px; }
.sheet video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 1; object-fit: cover; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; font-weight: 600; text-align: right; }
