/* ================= Kobrossy v40 — design ported from Panorama HR v42 (Kobrossy colours) ================= */
:root{--kb-brand:#075fc8;--kb-brand-2:#0556b5;--kb-brand-3:#04428c;--kb-light:#2b86ea;--kb-ink:#15263b;--kb-muted:#637287;--kb-line:#dde6f1;--kb-bg:#eef3fa;--kb-soft:#f5f8fd;--kb-red:#e31e2d}
body{background:var(--kb-bg)}

/* ---------- side menu (3D buttons with icons) ---------- */
#dashboard .admin-tabs{background:linear-gradient(180deg,#ffffff,#f6f9fd);border:1px solid var(--kb-line);border-radius:20px;padding:10px;gap:8px;box-shadow:0 1px 0 #fff inset,0 10px 30px rgba(21,38,59,.08)}
#dashboard .admin-tab{position:relative;display:flex;align-items:center;gap:10px;min-height:48px;padding:9px 12px;border-radius:14px;font-size:13.5px;font-weight:700;color:#3a5470;text-align:right;
 background:linear-gradient(180deg,#ffffff 0%,#f0f5fb 100%);border:1px solid #dbe5f1;border-bottom:3px solid #c8d6e8;
 box-shadow:0 1px 0 #fff inset,0 2px 4px rgba(21,38,59,.06);transition:transform .15s ease,box-shadow .15s ease,background .15s ease;cursor:pointer}
#dashboard .admin-tab:hover{transform:translateY(-1px);background:linear-gradient(180deg,#ffffff 0%,#e9f1fc 100%);color:var(--kb-brand-2);box-shadow:0 1px 0 #fff inset,0 6px 14px rgba(21,38,59,.10)}
#dashboard .admin-tab:active{transform:translateY(2px);border-bottom-width:1px}
#dashboard .admin-tab.active{color:#fff;background:linear-gradient(180deg,var(--kb-light) 0%,var(--kb-brand) 55%,var(--kb-brand-2) 100%);border-color:var(--kb-brand-2);border-bottom:3px solid var(--kb-brand-3);box-shadow:0 1px 0 rgba(255,255,255,.35) inset,0 8px 18px rgba(7,95,200,.32);font-weight:800}
#dashboard .admin-tab .nav-icon{width:32px;height:32px;padding:7px;box-sizing:border-box;border-radius:10px;background:#e8f1fc;stroke:var(--kb-brand-2);fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;box-shadow:0 1px 0 #fff inset,0 1px 2px rgba(21,38,59,.08)}
#dashboard .admin-tab.active .nav-icon{background:rgba(255,255,255,.2);stroke:#fff}
@media(min-width:1120px){
 #dashboard:not(.hidden){display:grid;grid-template-columns:230px minmax(0,1fr);grid-template-areas:"head head" "stats stats" "pk pk" "side main" "side records";gap:0 22px;align-items:start}
 #dashboard>.dashboard-head{grid-area:head}#dashboard>.stats{grid-area:stats}#dashboard>.passkey-card{grid-area:pk;margin-bottom:14px}
 #dashboard>.admin-tabs{grid-area:side;display:flex;flex-direction:column;position:sticky;top:16px;margin:0}
 #dashboard>.admin-tabs:before{content:'مساحة العمل';display:block;font-size:11px;font-weight:700;color:#8494a7;padding:4px 8px 6px}
 #dashboard>.admin-grid{grid-area:main}#dashboard>.records-card{grid-area:records}
 #dashboard .admin-tab{width:100%}
}
@media(max-width:1119px){
 #dashboard .admin-tabs{display:flex;overflow-x:auto;scrollbar-width:none;position:sticky;top:0;z-index:15}
 #dashboard .admin-tabs::-webkit-scrollbar{display:none}
 #dashboard .admin-tab{flex:1 0 auto;white-space:nowrap;min-height:44px;font-size:12.5px;justify-content:center}
 #dashboard .admin-tab .nav-icon{width:28px;height:28px;padding:6px}
}

/* ---------- cards, buttons, inputs ---------- */
#dashboard .card,#attendanceCard .card{background:#fff;border:1px solid var(--kb-line);border-radius:18px;box-shadow:0 1px 2px rgba(21,38,59,.04),0 10px 28px rgba(21,38,59,.06)}
#dashboard .card .section-title h3,#attendanceCard .card .section-title h3{display:flex;align-items:center;gap:10px;color:var(--kb-ink);font-weight:800}
#dashboard .card .section-title h3::before,#attendanceCard .card .section-title h3::before{content:'';width:5px;height:20px;border-radius:4px;background:linear-gradient(180deg,var(--kb-light),var(--kb-brand-2));flex-shrink:0}
#dashboard button.primary,#attendanceCard button.primary,#loginCard button.primary,#adminLogin button.primary,.modal button.primary{background:linear-gradient(180deg,var(--kb-light) 0%,var(--kb-brand) 55%,var(--kb-brand-2) 100%);color:#fff;border:1px solid var(--kb-brand-2);border-bottom:3px solid var(--kb-brand-3);border-radius:12px;font-weight:800;box-shadow:0 1px 0 rgba(255,255,255,.3) inset,0 6px 14px rgba(7,95,200,.24);transition:transform .12s ease,box-shadow .12s ease}
#dashboard button.primary:hover,#attendanceCard button.primary:hover,#loginCard button.primary:hover{transform:translateY(-1px);box-shadow:0 1px 0 rgba(255,255,255,.3) inset,0 10px 20px rgba(7,95,200,.3)}
#dashboard button.primary:active,#attendanceCard button.primary:active,#loginCard button.primary:active{transform:translateY(2px);border-bottom-width:1px}
#dashboard button.secondary,#attendanceCard button.secondary{background:linear-gradient(180deg,#fff,#f1f6fc);color:var(--kb-ink);border:1px solid #d3dfee;border-bottom:3px solid #c3d2e5;border-radius:12px;font-weight:700;box-shadow:0 1px 0 #fff inset,0 2px 5px rgba(21,38,59,.06);transition:transform .12s ease}
#dashboard button.secondary:hover,#attendanceCard button.secondary:hover{transform:translateY(-1px);color:var(--kb-brand-2)}
#dashboard button.secondary:active,#attendanceCard button.secondary:active{transform:translateY(2px);border-bottom-width:1px}
#dashboard button:disabled,#attendanceCard button:disabled{opacity:.6;transform:none!important;cursor:not-allowed}
#dashboard input:not([type=checkbox]):not([type=radio]):not([type=file]),#dashboard select,#dashboard textarea{border:1px solid #d3dfee;border-radius:11px;background:#f9fbfe;transition:border-color .15s,box-shadow .15s,background .15s}
#dashboard input:not([type=checkbox]):not([type=radio]):not([type=file]):focus,#dashboard select:focus,#dashboard textarea:focus{outline:none;border-color:#7fb0ec;background:#fff;box-shadow:0 0 0 4px rgba(7,95,200,.12)}
#dashboard .empty{border:1px dashed #d3dfee;border-radius:14px;background:var(--kb-soft);color:var(--kb-muted);padding:18px;text-align:center}
.topbar{background:rgba(255,255,255,.93);backdrop-filter:blur(8px)}
.tabs .tab{border-radius:12px;font-weight:800}

/* ---------- a colour per employee ---------- */
#employeeManagement .employee-edit.emp-colored{border-inline-start:6px solid var(--accent);background:linear-gradient(90deg,#fff 70%,color-mix(in srgb,var(--accent) 5%,#fff))}
#employeeManagement .employee-edit.emp-colored .edit-name{color:var(--accent);font-weight:800}
#employeeManagement .employee-edit.emp-colored>img,#employeeManagement .employee-edit.emp-colored>.employee-photo-fallback{box-shadow:0 0 0 2px var(--accent);color:var(--accent)}

/* ---------- grouped record extras ---------- */
.records-note{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;color:var(--kb-muted);font-size:12.5px;margin:6px 0 12px}
#recordsFilter{border:1px solid #d3dfee;border-radius:10px;padding:8px 12px;min-width:220px}
.rec-score{font-style:normal;font-weight:800;font-size:10.5px;padding:0 6px;border-radius:999px;margin-inline-start:6px}
.rec-score.ok{background:#e6f6ee;color:#087d4d}.rec-score.bad{background:#fdeaea;color:#c0262f}
.rec-late{display:block;font-size:10.5px;font-weight:700;color:#b45309}
.rec-head-img{width:52px;height:52px}
@keyframes recShimmer{to{background-position:-200% 0}}
@keyframes pzIn{from{opacity:0}to{opacity:1}}
@keyframes pzPulse{0%,100%{box-shadow:0 0 0 10px rgba(59,143,240,.12),0 0 0 22px rgba(59,143,240,.06),0 14px 30px rgba(0,0,0,.35)}50%{box-shadow:0 0 0 14px rgba(59,143,240,.18),0 0 0 28px rgba(59,143,240,.08),0 14px 30px rgba(0,0,0,.35)}}
.kb-lock-logo{width:150px!important;background:#fff}
#employeeInitial{transition:box-shadow .2s}

/* ---------- components ported from Panorama v33-features.css ---------- */
.app-version{position:fixed;bottom:8px;left:10px;z-index:50;font-size:11px;color:#7a8d9b;background:rgba(255,255,255,.85);border:1px solid #e1e8ee;border-radius:8px;padding:2px 8px;pointer-events:none}
/* v37: سجل البصمات مجمّع */
#recordsList.records-grouped{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(440px,1fr))!important;gap:14px!important;align-items:start}
.rec-emp{background:#fff;border:1px solid #e3ebf1;border-inline-start:6px solid var(--accent,#075fc8);border-radius:14px;overflow:hidden;box-shadow:0 2px 10px rgba(23,53,76,.06);min-width:0}
.rec-emp header{display:flex;align-items:center;gap:12px;padding:10px 14px;background:color-mix(in srgb,var(--accent,#075fc8) 8%,#fff);border-bottom:1px solid color-mix(in srgb,var(--accent,#075fc8) 22%,#fff)}
.rec-emp header img,.rec-emp .rec-avatar{width:52px;height:52px;border-radius:12px;object-fit:cover;flex-shrink:0;background:#edf2f6;display:grid;place-items:center;font-weight:800;font-size:20px;color:var(--accent);box-shadow:0 0 0 2px var(--accent,#075fc8)}
.rec-emp header strong{display:block;color:var(--accent,#193d55);font-size:15px}
.rec-emp header small{display:block;color:#6b8191;font-size:12px}
.rec-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px}
.rec-table thead th{background:#f6f9fb;color:#5b7385;font-size:11px;font-weight:700;padding:6px 10px;text-align:right}
.rec-table thead th:first-child{width:86px}
.rec-table tbody tr+tr{border-top:1px solid #edf2f5}
.rec-table tbody th{font-weight:700;color:#244a63;padding:8px 10px;text-align:right;font-size:12px;white-space:nowrap}
.rec-table td{padding:6px 8px;vertical-align:middle;min-width:0}
.rec-cell{display:flex;align-items:center;gap:8px;min-width:0}
.rec-cell img,.rec-cell .rec-nophoto{width:46px;height:46px;border-radius:9px;object-fit:cover;flex-shrink:0;background:#edf2f6;display:grid;place-items:center;color:#9fb0bd}
.rec-cell b{display:block;font-size:14px;color:#087d4d;font-variant-numeric:tabular-nums}
.rec-table td:last-child .rec-cell b{color:#b42318}
.rec-cell small{display:block;font-size:11px;color:#6b8191;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rec-cell>div{min-width:0}
.rec-empty{color:#9fb0bd;text-align:center}
@media(max-width:560px){#recordsList.records-grouped{grid-template-columns:minmax(0,1fr)!important}.rec-table thead th:first-child{width:62px}.rec-table tbody th{padding:8px 6px;white-space:normal}.rec-cell{gap:6px}.rec-cell img,.rec-cell .rec-nophoto{width:40px;height:40px}.rec-table td{padding:6px 4px}#recordsFilter{flex:1 1 100%;font-size:16px}}
.records-grouped img,#recordsList img{font-size:0;color:transparent}
.records-grouped img[data-photo-key]{background:linear-gradient(110deg,#edf2f6 30%,#f6f9fb 50%,#edf2f6 70%);background-size:200% 100%;animation:recShimmer 1.2s linear infinite}
/* v46: الدخول بالبصمة */
.passkey-login{margin-top:12px;display:grid;gap:8px}
.login-or{display:flex;align-items:center;gap:10px;color:#8a9cab;font-size:12px}
.login-or::before,.login-or::after{content:'';flex:1;height:1px;background:#e1e9ef}
.passkey-btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;border-radius:14px;font:inherit;font-size:15px;font-weight:800;cursor:pointer;color:#0556b5;background:linear-gradient(180deg,#ffffff,#eef4fd);border:1px solid #bcd5f5;border-bottom:3px solid #9bbfee;box-shadow:0 1px 0 #fff inset,0 4px 12px rgba(7,95,200,.12);transition:transform .12s}
.passkey-btn:hover{transform:translateY(-1px)}
.passkey-btn:active{transform:translateY(2px);border-bottom-width:1px}
.passkey-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
.passkey-btn svg,.passkey-card-head svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.passkey-hint{color:#7a8d9b;font-size:11.5px;text-align:center;line-height:1.6}
.passkey-card{border-inline-start:5px solid #cc903b!important}
.passkey-card.on{border-inline-start-color:#087d4d!important}
.passkey-card-head{display:flex;gap:12px;align-items:flex-start;color:#0556b5}
.passkey-card-head strong{display:block;color:#15263b}
.passkey-card-head small{display:block;color:#637b8b;font-size:12.5px;line-height:1.7;margin-top:3px}
.passkey-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.passkey-actions button{min-height:42px;padding:8px 16px}
#employeeManagement .employee-actions .passkey-reset{color:#9a5b00}
/* v48: شاشة القفل بالبصمة */
.kb-lock{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:24px;background:radial-gradient(120% 80% at 50% 0%,#0d4fa3 0%,#0a2f66 55%,#061b3d 100%);color:#fff;animation:pzIn .25s ease;transition:opacity .25s}
.kb-lock.hide{opacity:0}
.kb-lock-box{width:min(360px,100%);display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px}
.kb-lock-logo{width:120px;height:auto;border-radius:16px;background:#fff;padding:10px 14px;box-shadow:0 10px 30px rgba(0,0,0,.25);margin-bottom:18px}
.kb-lock-hello{font-size:22px;font-weight:800;margin:0}
.kb-lock-sub{margin:0 0 26px;color:#a9c9f2;font-size:13px}
.kb-lock-fp{width:112px;height:112px;border-radius:50%;border:2px solid rgba(255,255,255,.25);background:radial-gradient(circle at 50% 35%,#3b8ff0,#075fc8 60%,#0556b5);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 0 0 10px rgba(59,143,240,.12),0 0 0 22px rgba(59,143,240,.06),0 14px 30px rgba(0,0,0,.35);animation:pzPulse 2s ease-in-out infinite}
.kb-lock-fp svg{width:58px;height:58px;fill:none;stroke:#fff;stroke-width:1.6;stroke-linecap:round}
.kb-lock-fp:active{transform:scale(.96)}
.kb-lock-msg{margin:22px 0 18px;min-height:22px;font-size:14px;color:#d9e7fa;line-height:1.7}
.kb-lock-pin,.kb-lock-switch{background:transparent;border:1px solid rgba(255,255,255,.3);color:#fff;border-radius:12px;padding:10px 18px;font:inherit;font-weight:700;cursor:pointer;min-width:200px}
.kb-lock-switch{margin-top:8px;border-color:rgba(255,255,255,.15);color:#a9c9f2}
@media (prefers-reduced-motion: reduce){.kb-lock-fp{animation:none}}
@media(min-width:1120px){#dashboard:not(.hidden){grid-template-rows:auto auto auto 1fr}#dashboard:has(>.passkey-card)>.admin-tabs{align-self:start}}
/* v66: الصور المرجعية */
.refphoto-box{border:1px solid #f1d9b5;background:#fffaf2;border-radius:14px;margin:0 0 12px;padding:0}
.refphoto-box.ok{border-color:#cdeedd;background:#f3fbf7}
.refphoto-box summary{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;list-style:none;flex-wrap:wrap}
.refphoto-box summary::-webkit-details-marker{display:none}
.refphoto-box summary b{color:#7a4a00}
.refphoto-box.ok summary b{color:#087d4d}
.refphoto-box summary em{font-style:normal;font-weight:800;padding:2px 10px;border-radius:999px;background:#fff;border:1px solid #f1d9b5;color:#a35a00}
.refphoto-box summary small{color:#8a7a62;font-size:12px;margin-inline-start:auto}
.rp-list{display:grid;gap:8px;padding:0 14px 14px;max-height:520px;overflow:auto}
.rp-item{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:12px;align-items:center;background:#fff;border:1px solid #efe3cf;border-radius:12px;padding:8px}
.rp-img{width:64px;height:64px;border-radius:10px;overflow:hidden;background:#f3f5f7;display:grid;place-items:center;font-size:10px;color:#8a9cab;text-align:center}
.rp-img img{width:100%;height:100%;object-fit:cover}
.rp-info b{display:block;color:#17384f}
.rp-info small{color:#7d909c;font-size:12px}
.rp-act{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.rp-act button,.rp-up{min-height:38px;border-radius:10px;font-size:13px;padding:6px 12px;cursor:pointer;display:inline-flex;align-items:center}
@media(max-width:600px){.rp-item{grid-template-columns:56px minmax(0,1fr)}.rp-act{grid-column:1/-1;justify-content:stretch}.rp-act>*{flex:1;justify-content:center}.refphoto-box summary small{display:none}}
/* v82 employee avatar */
#employeeInitial.has-photo{color:transparent;cursor:zoom-in;box-shadow:0 0 0 3px #fff,0 0 0 5px rgba(7,95,200,.55)}
.avatar-view{position:fixed;inset:0;z-index:9999;background:rgba(10,20,30,.82);display:grid;place-items:center;cursor:zoom-out}
.avatar-view img{max-width:86vw;max-height:76vh;border-radius:18px;box-shadow:0 10px 40px rgba(0,0,0,.4)}

/* ---------- employee card layout (Panorama v32): photo + name/phone, then selects, then actions ---------- */
#employeeManagement .employee-edit{display:grid;grid-template-columns:56px minmax(0,1fr);grid-template-areas:"photo head" "fields fields" "actions actions";gap:12px 14px;align-items:center;padding:14px 16px}
#employeeManagement .employee-edit>img,#employeeManagement .employee-edit>.employee-photo-fallback{grid-area:photo;width:56px;height:56px;border-radius:14px}
#employeeManagement .employee-edit>div:nth-of-type(1){grid-area:head;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0}
#employeeManagement .employee-edit>div:nth-of-type(1) input{width:100%;min-width:0;margin:0;padding:10px 12px;font-size:14px}
#employeeManagement .employee-edit .employee-selects{grid-area:fields;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding-top:12px;border-top:1px dashed #d8e2ee;min-width:0}
#employeeManagement .employee-edit .employee-selects select{width:100%;min-width:0;grid-column:auto}
#employeeManagement .employee-edit .employee-actions{grid-area:actions;display:flex;flex-wrap:wrap;gap:6px}
@media(max-width:700px){#employeeManagement .employee-edit>div:nth-of-type(1),#employeeManagement .employee-edit .employee-selects{grid-template-columns:minmax(0,1fr)}#employeeManagement .employee-edit .employee-selects,#employeeManagement .employee-edit .employee-actions{grid-column:1/-1}}
.admin-grid>.refphoto-box{grid-column:1/-1}
.records-grouped img:not([src]){visibility:hidden}
#employeeManagement .employee-edit .employee-actions>button{flex:0 0 auto;white-space:nowrap;writing-mode:horizontal-tb}
@media(max-width:700px){#employeeManagement .employee-edit .employee-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}#employeeManagement .employee-edit .employee-actions>button{white-space:normal;min-height:40px}}

/* ---------- several check-in locations per employee ---------- */
#employeeManagement .emp-locations{grid-column:1/-1;border:1px solid #d8e4f3;border-radius:12px;background:#f7faff}
#employeeManagement .emp-locations summary{cursor:pointer;padding:9px 12px;font-weight:700;color:var(--kb-brand-2);font-size:13px;list-style:none}
#employeeManagement .emp-locations summary::-webkit-details-marker{display:none}
#employeeManagement .emp-loc-list{display:flex;flex-wrap:wrap;gap:8px;padding:0 12px 6px}
#employeeManagement .emp-loc{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid #d3dfee;border-radius:999px;background:#fff;font-size:13px;cursor:pointer}
#employeeManagement .emp-loc.main{background:#e8f1fc;border-color:#b9d2f3;cursor:default}
#employeeManagement .emp-loc:has(input:checked){border-color:var(--kb-brand);box-shadow:0 0 0 2px rgba(7,95,200,.12)}
#employeeManagement .emp-loc-hint{display:block;padding:0 12px 10px;color:var(--kb-muted);font-size:11.5px}
#employeeManagement .emp-loc{display:inline-flex!important;flex-direction:row;white-space:nowrap;margin:0;width:auto}#employeeManagement .emp-loc input{width:16px!important;height:16px;margin:0;flex:0 0 auto}

/* ---------- branch location from a shared link ---------- */
.shared-location-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;align-items:end}
.shared-location-form label{display:grid;gap:5px;font-size:13px;font-weight:700;color:#4a6078}
.shared-location-form .sl-wide{grid-column:1/-1}
.shared-location-form .sl-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}
.shared-location-form .sl-actions button{min-height:44px;padding:8px 18px}
.sl-result{margin-top:10px;font-size:13px;color:#a33}
.sl-point{display:grid;gap:4px;padding:12px 14px;border:1px solid #cfe0f5;border-radius:12px;background:#f4f9ff;color:var(--kb-ink)}
.sl-point b{font-variant-numeric:tabular-nums;direction:ltr;text-align:right}
.sl-point small{color:var(--kb-muted)}
.sl-point a{color:var(--kb-brand);font-weight:800}
@media(max-width:700px){.shared-location-form{grid-template-columns:minmax(0,1fr)}}
.shared-location-form select,.shared-location-form input{min-height:44px;padding:8px 12px;width:100%}

/* ---------- selfie matching inside each employee card ---------- */
#employeeManagement .emp-face{grid-column:1/-1;border:1px solid #dfe7f2;border-radius:12px;background:#fbfcfe}
#employeeManagement .emp-face summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px;cursor:pointer;padding:9px 12px;list-style:none;font-size:13px}
#employeeManagement .emp-face summary::-webkit-details-marker{display:none}
#employeeManagement .emp-face summary b{color:var(--kb-ink)}
#employeeManagement .emp-face summary em{font-style:normal;font-weight:700;font-size:12px;padding:2px 10px;border-radius:999px;background:#eef3f9;color:#4a6078}
#employeeManagement .emp-face summary em.ef-ok{background:#e6f6ee;color:#087d4d}
#employeeManagement .emp-face summary em.ef-bad{background:#fdeaea;color:#c0262f}
#employeeManagement .emp-face summary em.ef-warn{background:#fff4e2;color:#a35a00}
.emp-face-body{display:grid;grid-template-columns:110px minmax(0,1fr);gap:12px;padding:0 12px 12px;align-items:start}
.ef-ref{display:grid;gap:4px;justify-items:center;position:sticky;top:0}
.ef-ref small{color:var(--kb-muted);font-size:11px}
.ef-ref .ef-img{width:104px;height:124px;box-shadow:0 0 0 3px var(--accent,#075fc8)}
.ef-img{border-radius:12px;overflow:hidden;background:#eef2f7;display:grid;place-items:center;color:#8a9cab;font-size:11px;text-align:center}
.ef-img img{width:100%;height:100%;object-fit:cover}
.ef-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:10px}
.ef-shot{margin:0;border:1px solid #e3eaf3;border-radius:12px;padding:6px;background:#fff;display:grid;gap:4px}
.ef-shot.ok{border-color:#bfe6d1}.ef-shot.bad{border-color:#f3c2c5;background:#fff8f8}
.ef-shot .ef-img{height:110px}
.ef-shot figcaption{display:grid;gap:2px;text-align:center}
.ef-shot b{font-size:15px}.ef-shot.ok b{color:#087d4d}.ef-shot.bad b{color:#c0262f}
.ef-shot small{color:var(--kb-muted);font-size:11px}
.ef-adopt{font-size:11px;padding:4px 6px;border-radius:8px;border:1px solid #d3dfee;background:#fff;color:var(--kb-brand-2);cursor:pointer}
.ef-note{grid-column:1/-1;margin:0;color:var(--kb-muted);font-size:11.5px}
@media(max-width:600px){.emp-face-body{grid-template-columns:minmax(0,1fr)}.ef-ref{position:static}.ef-list{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v47 — ZKTeco fingerprint machines */
#employeeManagement .emp-device{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:end;gap:8px;padding:9px 12px;border:1px solid #d8e4f3;border-radius:12px;background:#f7faff}
#employeeManagement .emp-device label{display:grid;gap:4px;font-size:13px;font-weight:700;color:var(--kb-brand-2)}
#employeeManagement .emp-device input{width:130px}
#employeeManagement .emp-device small{flex-basis:100%;color:var(--kb-muted);font-size:11.5px}
.zk-help{margin:10px 0;border:1px solid #d8e4f3;border-radius:12px;background:#f7faff;padding:8px 12px}
.zk-help summary{cursor:pointer;font-weight:700;color:var(--kb-brand-2)}
.zk-help ol{margin:8px 0 0;padding-inline-start:20px;display:grid;gap:5px;font-size:13.5px}
.zk-help code{direction:ltr;unicode-bidi:embed;background:#fff;border:1px solid #d3dfee;border-radius:6px;padding:1px 6px;font-size:12.5px}
.zk-copy{cursor:pointer}
.zk-list{display:grid;gap:10px;margin:10px 0}
.zk-dev{border:1px solid #d3dfee;border-radius:12px;padding:10px 12px;background:#fff}
.zk-dev.pending{border-color:#f0b35a;background:#fffaf1}
.zk-dev-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.zk-dev-head small{color:var(--kb-muted);font-size:12px}
.zk-dev-head em{margin-inline-start:auto;font-style:normal;font-size:12px;font-weight:700;color:#087d4d}
.zk-dev.pending .zk-dev-head em{color:#b45309}
.zk-dot{width:10px;height:10px;border-radius:50%;background:#c3ccd8}.zk-dot.live{background:#16a34a;box-shadow:0 0 0 3px #16a34a33}
.zk-dev-form{display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin-top:8px}
.zk-dev-form label{display:grid;gap:3px;font-size:12px;flex:1 1 140px}
.zk-unlinked{display:grid;gap:8px;margin:8px 0 12px;padding:10px 12px;border:1px dashed #f0b35a;border-radius:12px;background:#fffaf1}
.zk-unlinked small{color:var(--kb-muted);font-size:12px}
.zk-un{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px}
.zk-un span{flex:1 1 220px}
.rec-device{display:grid;place-items:center;width:44px;height:44px;border-radius:10px;background:#eef4ff;font-size:22px;flex:none}
.zk-devices select,.zk-devices .zk-name{min-height:44px;border:1px solid #d3dfee;border-radius:12px;padding:0 10px;background:#fff;font:inherit;width:100%}
.zk-un select{width:auto;flex:0 1 220px}
.zk-devices .zk-del{min-height:44px;padding:0 14px;border-radius:12px;border:1px solid #f1c4c8;background:#fff5f5;color:#c0262f;font:inherit;font-weight:700;cursor:pointer}

/* v48 — machines read by IP */
.zk-add{display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin:10px 0;padding:12px;border:1px solid #cfe0f7;border-radius:12px;background:#f3f8ff}
.zk-add>b{flex-basis:100%;color:var(--kb-brand-2)}
.zk-add label{display:grid;gap:3px;font-size:12px;flex:1 1 130px}
.zk-add input,.zk-add select,.zk-devices .zk-ip,.zk-devices .zk-port,.zk-devices .zk-key{min-height:44px;border:1px solid #d3dfee;border-radius:12px;padding:0 10px;background:#fff;font:inherit;width:100%}
.zk-add small{flex-basis:100%;color:var(--kb-muted);font-size:11.5px}
.zk-dev.err{border-color:#f1c4c8;background:#fff8f8}.zk-dev.err .zk-dev-head em{color:#c0262f}
.zk-err{margin-top:6px;color:#c0262f;font-size:12.5px}
