/* ════════════════════════════════════════════════════════════════════════════
   HRM QR CHECK-IN — trang /checkin (mobile-first, dark, anonymous).
   Khung ~480px giữa màn hình; nút to, spacing thoáng, trạng thái rõ.
   Dùng bởi: CheckinLayout, CheckinPage, CheckinCameraStep, CheckinHistoryList.
   ════════════════════════════════════════════════════════════════════════════ */

*, *:before, *:after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ck-shell {
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 50% -10%, #16233d 0%, #0b1120 55%, #080d18 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px 12px 40px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

.ck-frame {
    width: 100%;
    max-width: 480px;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* ── Brand header ── */
.ck-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 18px;
    color: #e8eefc;
    font-weight: 700;
    font-size: 18px;
}
.ck-brand img { height: 30px; width: auto; }
.ck-brand-loc {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #93a4c8;
}

/* ── Panels (trạng thái / thông báo) ── */
.ck-center {
    text-align: center;
    color: #aab6d4;
    padding: 60px 16px;
}
.ck-center p { margin-top: 14px; }

.ck-panel {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    padding: 32px 22px;
    text-align: center;
    color: #dbe3f5;
}
.ck-panel h2 { margin: 8px 0 6px; font-size: 20px; color: #fff; }
.ck-panel p { margin: 0 0 8px; color: #aab6d4; line-height: 1.5; }
.ck-panel-icon { font-size: 56px !important; height: 56px; width: 56px; color: #5b9bff; }
.ck-icon-info { color: #5b9bff; }
.ck-panel-warn { border-color: rgba(255, 193, 7, .35); }
.ck-panel-warn .ck-panel-icon { color: #ffca3a; }
.ck-panel-error { border-color: rgba(244, 67, 54, .35); }
.ck-panel-error .ck-panel-icon { color: #ff6b6b; }
.ck-reg-input { max-width: 320px; margin: 12px auto 4px; }
.ck-reg-opt { display: flex; flex-direction: column; line-height: 1.25; }
.ck-reg-opt-name { font-weight: 600; }
.ck-reg-opt-meta { font-size: 12px; color: #93a4c8; }
.ck-reg-noitem { padding: 8px 4px; font-size: 13px; color: #93a4c8; text-align: left; }
.ck-reg-confirm { max-width: 320px; margin: 12px auto; justify-content: center; }
.ck-alert { margin: 12px 0; text-align: left; }

/* ── Buttons ── */
.ck-btn { border-radius: 14px !important; font-weight: 600 !important; }
.ck-btn-wide { width: 100%; max-width: 320px; margin: 16px auto 0; }

/* ── Đồng hồ ── */
.ck-clock { text-align: center; margin: 4px 0 20px; }
.ck-clock-time {
    display: block;
    font-size: 46px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.ck-clock-date { display: block; font-size: 14px; color: #93a4c8; text-transform: capitalize; }

/* ── Lời chào NV ── */
.ck-hello {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.ck-avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #22d3ee);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ck-hello-txt { display: flex; flex-direction: column; min-width: 0; }
.ck-hello-hi { font-size: 13px; color: #93a4c8; }
.ck-hello-name { font-size: 19px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-hello-meta { font-size: 12px; color: #7e8db0; }

/* ── Phiên hôm nay (1 dòng = 1 cặp Vào–Ra) — CheckinSessionLine ── */
.ck-today { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; }
.ck-today-none { font-size: 13px; color: #7e8db0; padding: 4px 0; }

.ck-sess {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    font-variant-numeric: tabular-nums;
}
.ck-sess-in { color: #4ade80; }
.ck-sess-out { color: #fb923c; }
.ck-sess-arrow { color: #5b6a8f; font-weight: 400; }
.ck-sess-dur { color: #93a4c8; font-weight: 500; font-size: 12.5px; }

/* Phiên đang mở (chưa Check-Out) — nhấn xanh + chấm "live" nhấp nháy. */
.ck-sess-open { border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .08); }
.ck-sess-live { color: #4ade80; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ck-sess-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80;
    animation: ck-live 1.4s ease-in-out infinite;
}
@keyframes ck-live { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ck-sess-dot { animation: none; } }

/* Phiên mồ côi (thiếu giờ vào) — cảnh báo cam. */
.ck-sess-orphan { border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .07); }
.ck-sess-missing { color: #fbbf24; font-weight: 800; min-width: 14px; text-align: center; }
.ck-sess-warn-ic { color: #fbbf24; font-size: 16px !important; width: 16px; height: 16px; }

/* ── Nút CHECK-IN/OUT lớn ── */
.ck-punch {
    width: 100%;
    border: none;
    border-radius: 22px;
    padding: 26px 16px;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: transform .08s ease, box-shadow .2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.ck-punch:active { transform: scale(.98); }
.ck-punch .mud-icon-root { font-size: 42px; height: 42px; width: 42px; }
.ck-punch span { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.ck-punch small { font-size: 12px; opacity: .9; font-weight: 500; }
.ck-punch-in { background: linear-gradient(135deg, #16a34a, #22c55e); }
.ck-punch-out { background: linear-gradient(135deg, #ea580c, #f97316); }

.ck-switch-dir {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    background: none;
    border: none;
    color: #93a4c8;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
}
.ck-switch-dir:hover { color: #cdd8f0; }

/* ── Tiện ích thiết bị (gỡ đăng ký / xóa cache) ── */
.ck-devtools {
    display: flex; flex-wrap: wrap; gap: 8px 18px;
    justify-content: center; align-items: center;
    margin: 26px auto 4px; padding-top: 14px;
    border-top: 1px solid rgba(147, 164, 200, .18);
}
.ck-devtools-link {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: none; cursor: pointer;
    color: #7f8fb3; font-size: 12.5px; padding: 4px 6px;
}
.ck-devtools-link:hover { color: #cdd8f0; text-decoration: underline; }

/* ── Lịch sử ── */
.ck-history-block { margin-top: 22px; }
.ck-history-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    color: #cdd8f0;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 14px;
    cursor: pointer;
}
.ck-history-chevron { margin-left: auto; }

.ck-hist-loading, .ck-hist-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #7e8db0;
    font-size: 13px;
    padding: 20px;
}
.ck-hist-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ck-hist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    padding: 10px 12px;
}
.ck-hist-date { text-align: center; flex-shrink: 0; width: 44px; }
.ck-hist-day { display: block; font-size: 16px; font-weight: 700; color: #fff; }
.ck-hist-dow { display: block; font-size: 11px; color: #7e8db0; text-transform: capitalize; }
.ck-hist-mid { flex: 1; min-width: 0; }
.ck-hist-times { font-size: 14px; }
.ck-hist-times .ck-in { color: #4ade80; font-weight: 600; }
.ck-hist-times .ck-out { color: #fb923c; font-weight: 600; }
.ck-hist-times .ck-sep { color: #556; margin: 0 6px; }
.ck-hist-loc { font-size: 12px; color: #7e8db0; margin-top: 2px; }

/* Phiên lồng trong dòng lịch sử / team — bỏ nền pill, hiển thị dạng dòng phẳng gọn. */
.ck-hist-sess, .ck-team-sess { display: flex; flex-direction: column; gap: 1px; }
.ck-team-sess { align-items: flex-end; }
.ck-hist-sess .ck-sess, .ck-team-sess .ck-sess {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 13.5px;
    gap: 5px;
}
.ck-hist-sess .ck-sess-dur, .ck-team-sess .ck-sess-dur { font-size: 12px; }
.ck-hist-thumbs { display: flex; gap: 6px; flex-shrink: 0; }
.ck-hist-thumbs img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(255, 255, 255, .12); }

/* ── Màn thành công ── */
.ck-success { padding-top: 40px; }
.ck-success-badge {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 8px 26px rgba(34, 197, 94, .45);
    animation: ck-pop .35s ease;
}
.ck-success-badge .mud-icon-root { font-size: 50px; height: 50px; width: 50px; color: #fff; }
@keyframes ck-pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.ck-success-time { font-size: 40px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.ck-success-name { font-size: 17px; color: #cdd8f0; margin: 2px 0 0; }
.ck-success-msg { font-size: 13px; color: #93a4c8; margin-top: 6px; }
.ck-success-actions { display: flex; gap: 10px; margin-top: 22px; justify-content: center; flex-wrap: wrap; }

/* ── Trùng (đã chấm rồi) — cảnh báo cam, phân biệt rõ với success xanh ── */
.ck-dup { padding-top: 40px; }
.ck-dup-badge {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 8px 26px rgba(245, 158, 11, .45);
    animation: ck-pop .35s ease;
}
.ck-dup-badge .mud-icon-root { font-size: 50px; height: 50px; width: 50px; color: #fff; }
.ck-dup-msg { font-size: 14px; color: #fcd9a6; margin-top: 8px; line-height: 1.4; }

/* ── Camera ── */
.ck-camera { display: flex; flex-direction: column; }
.ck-camera-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.ck-camera-head-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.ck-camera-back-btn {
    color: #94a3b8 !important;
    padding: 6px !important;
    margin-left: -6px;
}
.ck-camera-head-text {
    min-width: 0;
}
.ck-camera-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ck-camera-sub {
    font-size: 12px;
    color: #93a4c8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ck-camera-head-right {
    flex-shrink: 0;
}
.ck-camera-stage {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    background: #05080f;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .4);
}
.ck-video, .ck-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ck-video {
    transform: scaleX(-1); /* preview gương cho tự nhiên */
    pointer-events: none; /* ngăn chạm tay vào video kích hoạt PiP/gesture trên iOS */
}
.ck-video::-webkit-media-controls,
.ck-video::-webkit-media-controls-enclosure,
.ck-video::-webkit-media-controls-panel,
.ck-video::-webkit-media-controls-picture-in-picture-button {
    display: none !important;
    -webkit-appearance: none !important;
}
.ck-hidden { display: none !important; }
.ck-camera-msg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #93a4c8;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}
.ck-camera-msg .mud-icon-root { font-size: 40px; height: 40px; width: 40px; }
.ck-camera-actions { display: flex; flex-direction: column; gap: 10px; justify-content: center; align-items: center; margin-top: 14px; min-height: 60px; width: 100%; }

/* ── Camera Beauty Filter Dropdown (Top-Right) ── */
.ck-filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #f0f9ff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.ck-filter-dropdown-btn:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}
.ck-filter-dropdown-btn:active {
    transform: scale(0.97);
}
.ck-filter-btn-icon {
    color: #38bdf8 !important;
    font-size: 15px !important;
    width: 15px !important;
    height: 15px !important;
}
.ck-filter-btn-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1px;
}
.ck-filter-btn-arrow {
    color: #94a3b8 !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    margin-left: -2px;
}

/* ── Filter Dropdown Popover ── */
.ck-filter-popover {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(56, 189, 248, 0.15) !important;
    overflow: hidden !important;
    min-width: 175px !important;
    padding: 4px !important;
}
.ck-filter-menu-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 3px;
}
.ck-filter-menu-header-icon {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    color: #38bdf8 !important;
}
.ck-filter-menu-item {
    border-radius: 9px !important;
    margin-bottom: 2px !important;
    padding: 7px 10px !important;
    transition: all 0.15s ease !important;
}
.ck-filter-menu-item:hover {
    background: rgba(255, 255, 255, 0.07) !important;
}
.ck-filter-menu-item-active {
    border-radius: 9px !important;
    margin-bottom: 2px !important;
    padding: 7px 10px !important;
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
}
.ck-filter-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.ck-filter-item-icon {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    color: #38bdf8 !important;
    flex-shrink: 0;
}
.ck-filter-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    flex-grow: 1;
}
.ck-filter-menu-item-active .ck-filter-item-name {
    color: #38bdf8;
    font-weight: 700;
}
.ck-filter-item-check {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    color: #38bdf8 !important;
    margin-left: auto;
}


/* ── Camera Confirmation Action Buttons (Mobile-Optimized) ── */
.ck-confirm-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 4px;
}
.ck-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    outline: none;
    user-select: none;
}
.ck-action-btn .mud-icon-root {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}
.ck-action-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.ck-action-retake {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}
.ck-action-retake:not(:disabled):active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.97);
}
.ck-action-flip {
    flex: 1;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}
.ck-action-flip:not(:disabled):active {
    background: rgba(56, 189, 248, 0.22);
    transform: scale(0.97);
}
.ck-action-confirm {
    flex: 1.4;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}
.ck-action-confirm:not(:disabled):active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.ck-shutter {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    border: 5px solid rgba(255, 255, 255, .35);
    cursor: pointer;
    padding: 0;
    transition: transform .08s ease;
}
.ck-shutter:active { transform: scale(.92); }
.ck-shutter:disabled { opacity: .5; cursor: default; }
.ck-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px #05080f; }

.ck-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ════════════════════════════════════════════════════════════════════════════
   PHASE 2 — Chấm giúp NV (proxy) + NV tại điểm (QL). Đồng bộ tông tối .ck-*.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Nút "CHẤM GIÚP NV" (QL) — thứ cấp so với nút CHECK-IN/OUT ── */
.ck-mgr-btn {
    width: 100%;
    margin-top: 14px;
    border: 1px solid rgba(129, 140, 248, .4);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, .16), rgba(99, 102, 241, .06));
    color: #c7d2fe;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform .08s ease, border-color .2s ease;
}
.ck-mgr-btn:active { transform: scale(.98); }
.ck-mgr-btn:hover { border-color: rgba(129, 140, 248, .7); }
.ck-mgr-btn .mud-icon-root { font-size: 30px; height: 30px; width: 30px; color: #a5b4fc; }
.ck-mgr-btn span { font-size: 18px; font-weight: 700; letter-spacing: .3px; color: #e0e7ff; }
.ck-mgr-btn small { font-size: 12px; color: #9aa6d6; }

/* ── Picker "Chấm giúp NV" ── */
.ck-pick-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ck-pick-head .mud-icon-button-root {
    padding: 6px !important;
    margin-left: -6px;
    color: #94a3b8;
}
.ck-pick-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Đã chấm gần đây (Recent Proxy Members) ── */
.ck-recent-sec {
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ck-recent-lbl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #facc15;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ck-recent-lbl .mud-icon-root {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
}
.ck-recent-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.ck-recent-row::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.ck-recent-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.ck-recent-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(250, 204, 21, 0.4);
}

.ck-pick-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    color: #93a4c8;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ck-pick-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e8eefc;
    font-size: 15px;
    min-width: 0;
    box-sizing: border-box;
}
.ck-pick-search input::placeholder { color: #6b7a9e; }

/* ── Lọc Phòng Ban (Horizontal Scrollable Chips without overflow) ── */
.ck-dept-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 2px 2px 8px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.ck-dept-filters::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.ck-dept-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.ck-dept-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.ck-dept-chip.active {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border-color: #38bdf8;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.ck-pick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 96px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
.ck-pick-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.ck-pick-item:hover { background: rgba(99, 102, 241, .12); border-color: rgba(129, 140, 248, .45); }
.ck-pick-item:active { transform: scale(.99); }
.ck-pick-ava {
    flex-shrink: 0;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #22d3ee);
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ck-pick-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.ck-pick-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ck-pick-meta {
    font-size: 12px;
    color: #7e8db0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ck-pick-status {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.ck-pick-done { background: rgba(34, 197, 94, .14); color: #4ade80; border-color: rgba(34, 197, 94, .3); }
.ck-pick-none { background: rgba(148, 163, 184, .12); color: #94a3b8; border-color: rgba(148, 163, 184, .25); }

/* ── Banner "Đang chấm giúp" ── */
.ck-proxy-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(250, 204, 21, .1);
    border: 1px solid rgba(250, 204, 21, .38);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.ck-proxy-banner .mud-icon-root { font-size: 34px; height: 34px; width: 34px; color: #facc15; flex-shrink: 0; }
.ck-proxy-txt { display: flex; flex-direction: column; min-width: 0; }
.ck-proxy-lbl { font-size: 12px; color: #d6b64a; text-transform: uppercase; letter-spacing: .5px; }
.ck-proxy-name { font-size: 19px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-proxy-id { font-size: 12px; color: #b3a06a; }

/* ── Chọn chiều chấm (segmented) ── */
.ck-dir-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ck-dir-lbl { font-size: 14px; color: #93a4c8; }
.ck-dir-seg {
    display: inline-flex;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    padding: 3px;
}
.ck-dir-opt {
    border: none;
    background: none;
    color: #93a4c8;
    font-size: 14px;
    font-weight: 600;
    padding: 7px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.ck-dir-on { color: #fff; }
.ck-dir-in { background: linear-gradient(135deg, #16a34a, #22c55e); }
.ck-dir-out { background: linear-gradient(135deg, #ea580c, #f97316); }

/* ── NV tại điểm (hôm nay) — reuse tông ck-hist ── */
.ck-team-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-bottom: 96px; }
.ck-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    padding: 10px 12px;
}
.ck-team-emp { display: flex; flex-direction: column; min-width: 0; }
.ck-team-name { font-size: 15px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-team-id { font-size: 11px; color: #7e8db0; }
.ck-team-right { text-align: right; flex-shrink: 0; }
.ck-team-times { font-size: 14px; }
.ck-team-times .ck-in { color: #4ade80; font-weight: 600; }
.ck-team-times .ck-out { color: #fb923c; font-weight: 600; }
.ck-team-times .ck-sep { color: #556; margin: 0 6px; }
.ck-team-meta { display: flex; gap: 8px; justify-content: flex-end; align-items: center; font-size: 12px; color: #7e8db0; margin-top: 2px; }
.ck-proxy-flag {
    font-size: 11px;
    font-weight: 600;
    color: #facc15;
    background: rgba(250, 204, 21, .12);
    border: 1px solid rgba(250, 204, 21, .3);
    border-radius: 999px;
    padding: 1px 8px;
}

/* ── Overlay đang gửi ── */
.ck-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 15, .78);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #dbe3f5;
    z-index: 3000;
}

/* ── Face guide oval trên camera ── */
.ck-camera-guide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}
.ck-camera-oval {
    width: 65%;
    height: 68%;
    border: 2px dashed rgba(255, 255, 255, 0.45);
    border-radius: 50% / 48%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.22);
    animation: ck-pulse-oval 2.5s infinite ease-in-out;
}
@keyframes ck-pulse-oval {
    0%, 100% { border-color: rgba(255, 255, 255, 0.4); }
    50% { border-color: rgba(52, 211, 153, 0.75); }
}
.ck-camera-guide-text {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 999px;
}

/* ── POPUP CẢNH BÁO / LỖI CHẤM CÔNG (thay thế alert & ngăn thanh vàng #blazor-error-ui) ── */
.ck-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 15, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 4000;
    animation: ck-fade-in .2s ease;
}
.ck-modal-box {
    width: 100%;
    max-width: 380px;
    background: #0d1527;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    animation: ck-pop-modal .25s ease;
}
@keyframes ck-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ck-pop-modal { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ck-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.ck-modal-icon--gps {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.35);
}
.ck-modal-icon--warn {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 2px solid rgba(245, 158, 11, 0.35);
}
.ck-modal-icon--camera {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 2px solid rgba(59, 130, 246, 0.35);
}
.ck-modal-icon .mud-icon-root { font-size: 38px; width: 38px; height: 38px; }
.ck-modal-title { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.ck-modal-desc { font-size: 14px; color: #94a3b8; line-height: 1.55; margin-bottom: 20px; }
.ck-modal-desc b { color: #f1f5f9; }
.ck-modal-dist-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 14px;
}
.ck-modal-actions { display: flex; flex-direction: column; width: 100%; gap: 10px; }
.ck-modal-btn-primary {
    width: 100%;
    min-height: 48px;
    padding: 12px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .08s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ck-modal-btn-primary:active { transform: scale(0.98); }
.ck-modal-btn-sec {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Gần đây & Lọc phòng ban (Chấm giúp NV) ── */
.ck-recent-sec { margin-bottom: 14px; }
.ck-recent-lbl { font-size: 12px; font-weight: 700; color: #facc15; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.ck-recent-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.ck-recent-card {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.ck-recent-card:active { background: rgba(255, 255, 255, 0.1); border-color: rgba(250, 204, 21, 0.4); }

.ck-hist-thumb-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .15s ease;
}
.ck-hist-thumb-btn:active {
    transform: scale(0.95);
}

/* ── Lịch sử chấm công theo tháng (Mobile-style) ── */
.ck-hist-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.ck-hist-month-nav .ck-month-title {
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ck-hist-month-nav .ck-nav-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
}
.ck-hist-month-nav .ck-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.ck-hist-month-nav .ck-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.ck-month-today-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
    margin-left: 6px;
    transition: all .15s;
}
.ck-month-today-btn:active {
    transform: scale(0.96);
}
.ck-hist-kpi-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.ck-hist-kpi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 8px 6px;
    text-align: center;
}
.ck-hist-kpi-val {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}
.ck-hist-kpi-lbl {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}
.ck-hist-card-today {
    border-color: rgba(56, 189, 248, 0.45) !important;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(255, 255, 255, 0.02)) !important;
}
.ck-hist-today-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-radius: 4px;
    padding: 1px 4px;
    margin-top: 2px;
}
.ck-hist-warn-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border-radius: 6px;
    padding: 2px 6px;
    margin-top: 4px;
}
.ck-hist-thumb-wrap {
    position: relative;
    display: inline-flex;
}
.ck-hist-thumb-tag {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    line-height: 1;
}

/* ── Ẩn triệt để thanh lỗi vàng mặc định của Blazor trên trang chấm công ── */
.ck-shell ~ #blazor-error-ui,
#blazor-error-ui {
    display: none !important;
}

