.attendance-summary-card{direction:rtl;display:block;width:100%;margin:12px 0 16px;padding:16px;border:1px solid #d9c8e8;border-radius:20px;background:linear-gradient(135deg,#fff 0%,#fbf7ff 55%,#f0fbf6 100%);box-shadow:0 8px 22px rgba(59,31,85,.08);color:#352044;box-sizing:border-box}
.attendance-summary-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.attendance-summary-head h3{margin:0;color:#40245b;font-size:clamp(18px,2vw,23px);font-weight:900}
.attendance-summary-head p{margin:4px 0 0;color:#756780;font-size:14px}
.attendance-summary-date{flex:0 0 auto;padding:7px 12px;border-radius:999px;background:#efe5f6;color:#684188;font-size:13px;font-weight:800;white-space:nowrap}
.attendance-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.attendance-summary-metric{appearance:none;min-width:0;min-height:84px;padding:12px 14px;border:1px solid #e7ddec;border-radius:16px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#62546b;font:inherit;text-align:right;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.attendance-summary-metric:hover{transform:translateY(-2px);box-shadow:0 7px 18px rgba(59,31,85,.10);border-color:#b999cf}
.attendance-summary-metric:focus-visible{outline:3px solid #a975c5;outline-offset:2px}
.attendance-summary-metric span{font-size:clamp(13px,1.5vw,16px);font-weight:800;line-height:1.4}
.attendance-summary-metric strong{font-size:clamp(24px,3vw,34px);font-weight:900;line-height:1;color:#633282;flex:0 0 auto}
.attendance-in{background:#f2fbf6;border-color:#c4e7d6}
.attendance-in strong{color:#17845e}
.attendance-out{background:#fff7f7;border-color:#f0d2d5}
.attendance-out strong{color:#bd4c5c}
.attendance-none{background:#f7f8fc;border-color:#dce2ef}
.attendance-summary-note{display:block;margin-top:10px;color:#786f7e;font-size:12px;line-height:1.55}
.attendance-summary-card.is-loading .attendance-summary-grid{opacity:.58;pointer-events:none}
.attendance-summary-card.is-error .attendance-summary-note{color:#b33e4b}
.attendance-detail-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:14px;background:rgba(25,16,29,.52);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);direction:rtl;box-sizing:border-box}
.attendance-detail-sheet{width:min(980px,100%);max-height:min(90vh,920px);max-height:min(90dvh,920px);display:flex;flex-direction:column;overflow:hidden;border:1px solid #e8dcef;border-top:7px solid #f39228;border-radius:28px;background:#fff;box-shadow:0 24px 70px rgba(30,14,44,.32);color:#392248}
.attendance-detail-head{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 22px;background:linear-gradient(110deg,#622c87,#8138ad);color:#fff}
.attendance-detail-heading{min-width:0}
.attendance-detail-title{margin:0;font-size:clamp(19px,3vw,28px);font-weight:900;line-height:1.35}
.attendance-detail-subtitle{margin:5px 0 0;color:#f0e3f7;font-size:14px;font-weight:700}
.attendance-detail-actions{display:flex;align-items:center;gap:9px;flex:0 0 auto}
.attendance-detail-actions button{min-height:48px;padding:9px 16px;border-radius:16px;font:inherit;font-size:14px;font-weight:900;cursor:pointer;white-space:nowrap}
.attendance-detail-pdf{border:0;background:#f39228;color:#fff}
.attendance-detail-close-top{border:1px solid rgba(255,255,255,.42);background:rgba(255,255,255,.14);color:#fff}
.attendance-detail-counts{flex:0 0 auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:14px 18px;border-bottom:1px solid #eee7f0}
.attendance-detail-tab{min-width:0;min-height:72px;display:flex;align-items:center;justify-content:center;gap:12px;padding:10px 12px;border:1px solid #e2d5e8;border-radius:20px;background:#fff;color:#5e317e;font:inherit;cursor:pointer}
.attendance-detail-tab b{min-width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:#f2eaf6;font-size:20px;font-weight:900}
.attendance-detail-tab span{font-size:16px;font-weight:900;line-height:1.35}
.attendance-detail-tab.active{border-color:#662d8c;background:#662d8c;color:#fff}
.attendance-detail-tab.active b{background:rgba(255,255,255,.2);color:#fff}
.attendance-detail-matchbar{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 18px 0;padding:12px 16px;border:1px solid #e8dcf0;border-radius:18px;background:#f8f2fb;color:#623282}
.attendance-detail-matchbar b{font-size:15px}
.attendance-detail-matchbar span{font-size:12px;color:#766580}
.attendance-detail-list{flex:1 1 auto;min-height:120px;overflow:auto;overscroll-behavior:contain;display:grid;align-content:start;gap:9px;padding:12px 18px 16px;scrollbar-width:thin}
.attendance-detail-person{display:grid;grid-template-columns:44px minmax(0,1fr) auto;grid-template-areas:'avatar main state';align-items:center;gap:10px;padding:13px 14px;border:1px solid #e9e1ed;border-radius:19px;background:#fff;box-shadow:0 5px 16px rgba(55,34,66,.035)}
.attendance-detail-avatar{grid-area:avatar;width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:#f3edf7;font-size:23px}
.attendance-detail-main{grid-area:main;min-width:0;display:grid;gap:4px}
.attendance-detail-main>b{font-size:16px;line-height:1.4;color:#34263b}
.attendance-detail-main>small{font-size:12px;line-height:1.45;color:#807488}
.attendance-detail-times{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.attendance-detail-times span{padding:5px 9px;border-radius:999px;background:#f7f4f8;color:#655b6c;font-size:12px;font-weight:800}
.attendance-detail-state{grid-area:state;justify-self:end;padding:8px 11px;border-radius:999px;background:#f3edf5;color:#65546c;font-size:12px;font-weight:900;white-space:nowrap}
.attendance-detail-state.good{background:#eaf7f0;color:#247a58}
.attendance-detail-state.info{background:#eef4ff;color:#3865a8}
.attendance-detail-state.bad{background:#fff0ef;color:#b7464d}
.attendance-detail-empty{padding:26px 14px;text-align:center;color:#776b7c;font-size:15px}
.attendance-detail-footer{flex:0 0 auto;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 18px calc(12px + env(safe-area-inset-bottom));border-top:1px solid #eee7f0;background:#fff}
.attendance-detail-footer button{min-height:58px;border-radius:18px;font:inherit;font-size:16px;font-weight:900;cursor:pointer}
.attendance-detail-close-bottom{border:1px solid #e1d4e9;background:#fff;color:#673487}
.attendance-detail-all{border:1px solid #662d8c;background:#662d8c;color:#fff}
@media(max-width:700px){
 .attendance-summary-card{padding:12px;border-radius:17px}
 .attendance-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
 .attendance-summary-metric{min-height:72px;padding:8px 5px;border-radius:12px}
 .attendance-summary-metric span{font-size:10px;line-height:1.25}
 .attendance-summary-metric strong{font-size:22px}
 .attendance-summary-head h3{font-size:18px}
 .attendance-summary-head p{font-size:12px}
 .attendance-summary-date{font-size:11px;padding:6px 9px}
 .attendance-summary-note{font-size:10px}
 .attendance-detail-overlay{padding:9px}
 .attendance-detail-sheet{width:100%;max-height:91vh;max-height:91dvh;border-radius:23px}
 .attendance-detail-head{align-items:flex-start;gap:8px;padding:13px 14px}
 .attendance-detail-title{font-size:18px}
 .attendance-detail-subtitle{font-size:11px}
 .attendance-detail-actions{gap:5px}
 .attendance-detail-actions button{min-height:38px;padding:7px 9px;border-radius:12px;font-size:10px}
 .attendance-detail-counts{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:9px}
 .attendance-detail-tab{min-height:54px;gap:7px;padding:7px;border-radius:15px}
 .attendance-detail-tab b{min-width:32px;height:32px;font-size:15px}
 .attendance-detail-tab span{font-size:11px}
 .attendance-detail-matchbar{margin:8px 9px 0;padding:9px 10px;border-radius:14px}
 .attendance-detail-matchbar b{font-size:11px}
 .attendance-detail-matchbar span{font-size:9px}
 .attendance-detail-list{gap:7px;padding:8px 9px 10px}
 .attendance-detail-person{grid-template-columns:34px minmax(0,1fr);grid-template-areas:'avatar main' 'state state';gap:6px 8px;padding:9px 10px;border-radius:15px}
 .attendance-detail-avatar{width:34px;height:34px;border-radius:11px;font-size:18px}
 .attendance-detail-main>b{font-size:13px}
 .attendance-detail-main>small{font-size:10px}
 .attendance-detail-times span{padding:4px 7px;font-size:10px}
 .attendance-detail-state{grid-column:2;grid-row:1;justify-self:start;align-self:start;padding:5px 7px;font-size:9px}
 .attendance-detail-footer{gap:7px;padding:9px 9px calc(9px + env(safe-area-inset-bottom))}
 .attendance-detail-footer button{min-height:46px;border-radius:14px;font-size:12px}
}
@media print{
 body>*{visibility:hidden!important}
 .attendance-detail-overlay,.attendance-detail-overlay *{visibility:visible!important}
 .attendance-detail-overlay{position:absolute!important;inset:0!important;display:block!important;padding:0!important;background:#fff!important;backdrop-filter:none!important}
 .attendance-detail-sheet{width:100%!important;max-height:none!important;height:auto!important;overflow:visible!important;border:0!important;border-radius:0!important;box-shadow:none!important}
 .attendance-detail-head{background:#662d8c!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .attendance-detail-actions,.attendance-detail-counts,.attendance-detail-footer{display:none!important}
 .attendance-detail-list{display:block!important;overflow:visible!important}
 .attendance-detail-person{break-inside:avoid;box-shadow:none!important;margin:0 0 7px!important}
}
/* 2026-11-02: match the approved attendance reference; keep four existing metrics in one row */
.attendance-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.attendance-summary-metric{min-height:142px;padding:14px 10px;border-radius:26px;flex-direction:column;justify-content:center;align-items:center;gap:8px;text-align:center}
.attendance-summary-metric span{display:block;min-height:2.6em;align-content:center;font-size:clamp(12px,1.15vw,16px);line-height:1.3;text-align:center}
.attendance-summary-metric strong{font-size:clamp(34px,3.8vw,52px);line-height:1;color:#633282}
.attendance-summary-total{border-color:#d9c8e8;background:#fff}
.attendance-in strong{color:#258366}
.attendance-out strong{color:#b84d63}
.attendance-none strong{color:#633282}
@media(max-width:700px){
 .attendance-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
 .attendance-summary-metric{min-height:100px;padding:8px 4px;border-radius:20px;gap:6px}
 .attendance-summary-metric span{min-height:2.8em;font-size:10px;line-height:1.25;overflow-wrap:anywhere}
 .attendance-summary-metric strong{font-size:clamp(22px,6vw,30px)}
}
@media(max-width:360px){
 .attendance-summary-grid{gap:4px}
 .attendance-summary-metric{min-height:92px;padding:6px 2px;border-radius:16px}
 .attendance-summary-metric span{font-size:9px}
 .attendance-summary-metric strong{font-size:21px}
}
.attendance-away{background:#fff5f5;border-color:#efcbd0}.attendance-away strong{color:#bd4c5c}
.attendance-rest{background:#fffaf0;border-color:#efe1bf}.attendance-rest strong{color:#9a7620}
.attendance-leave{background:#f8f4fc;border-color:#e4d8ef}.attendance-leave strong{color:#754298}
.attendance-permission{background:#f2f7fc;border-color:#d4e2f1}.attendance-permission strong{color:#426c9c}
.attendance-summary-placeholder{cursor:default}.attendance-summary-placeholder:hover{transform:none;box-shadow:none;border-color:#e7ddec}

/* Compact attendance box; emoji labels remain easy to scan */
.attendance-summary-card{margin:7px 0 9px;padding:10px}.attendance-summary-head{margin-bottom:7px}
.attendance-summary-metric{min-height:108px;padding:7px 6px;border-radius:20px;gap:4px}.attendance-summary-metric span{min-height:2.1em}.attendance-summary-metric strong{font-size:clamp(29px,3vw,40px)}
.attendance-summary-note{display:none!important}
@media(max-width:700px){.attendance-summary-card{margin:5px 0 7px;padding:8px}.attendance-summary-head{margin-bottom:5px}.attendance-summary-grid{gap:5px}.attendance-summary-metric{min-height:76px;padding:5px 3px;border-radius:15px;gap:3px}.attendance-summary-metric span{min-height:2em;font-size:9px;line-height:1.18}.attendance-summary-metric strong{font-size:22px}}
@media(max-width:360px){.attendance-summary-metric{min-height:70px;padding:4px 2px;border-radius:13px}.attendance-summary-metric span{font-size:8px}.attendance-summary-metric strong{font-size:20px}}

.attendance-detail-times{display:grid;grid-template-columns:1fr;gap:6px;margin-top:8px} .attendance-detail-times span{display:block;white-space:normal;padding:8px 10px;border-radius:12px;background:#f7f4f8;border-inline-start:3px solid #c6a5d9;font-size:13px;line-height:1.5} @media(max-width:700px){.attendance-detail-times{gap:5px;margin-top:6px}.attendance-detail-times span{padding:6px 8px;font-size:11px}}
