@media screen{
 #attendanceV3{--blue:#0755bb;--green:#15922b;--purple:#7b13c7;--orange:#ed8a0a;box-sizing:border-box;max-width:980px;width:calc(100% - 16px);margin:8px auto;color:#152333;font:15px/1.4 system-ui,sans-serif}
 #attendanceV3 *{box-sizing:border-box}#attendanceV3 [hidden]{display:none!important}
 #attendanceV3 h2,#attendanceV3 h3,#attendanceV3 p{margin:0}#attendanceV3 h3{font-size:17px}
 #attendanceV3 .av-title{padding:10px 12px;margin-bottom:8px;background:linear-gradient(#1176ee,#003f9f);border-radius:10px;color:white;text-align:center;font-size:24px;box-shadow:0 2px 4px #122d4e38}
 #attendanceV3 .av-card{background:#fff;border:1px solid #becfe2;border-radius:12px;margin:9px 0;padding:8px;box-shadow:0 2px 5px #173f7319;min-width:0}
 #attendanceV3 .av-bar{background:linear-gradient(#1384f8,#00449b);color:white;border-radius:8px;padding:8px;display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;margin-bottom:8px}
 #attendanceV3 .av-bar.purple{background:linear-gradient(#a332f4,#55059f)}
 #attendanceV3 button{font:700 14px/1.3 system-ui;min-height:38px;padding:8px;border:1px solid #bdcde0;border-radius:8px;cursor:pointer;background:#eef4fb;color:#163f75;white-space:normal;overflow-wrap:anywhere}
 #attendanceV3 button:disabled{opacity:.55;cursor:wait}#attendanceV3 button:focus-visible{outline:3px solid #e8b32f;outline-offset:2px}
 #attendanceV3 .av-blue,#attendanceV3 .av-green,#attendanceV3 .av-purple,#attendanceV3 .av-orange,#attendanceV3 .av-red{color:#fff;border-color:#fff5;box-shadow:0 2px 3px #173f7327}
 #attendanceV3 .av-blue{background:linear-gradient(#1497ff,#0354b5)}#attendanceV3 .av-green{background:linear-gradient(#29bf27,#087013)}#attendanceV3 .av-purple{background:linear-gradient(#bc35f2,#7605b5)}#attendanceV3 .av-orange{background:linear-gradient(#ffb119,#e77400)}#attendanceV3 .av-red{background:linear-gradient(#ff4858,#d80018)}
 #attendanceV3 .av-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap}#attendanceV3 .av-grow{flex:1;min-width:0}
 #attendanceV3 label{display:block;font-weight:650;margin:7px 0}#attendanceV3 select,#attendanceV3 input:not([type=checkbox]),#attendanceV3 textarea{font:inherit;padding:8px;border:1px solid #a7bbd4;border-radius:7px;max-width:100%;width:100%;background:white;color:#142437}
 #attendanceV3 input[type=checkbox]{width:23px;height:23px;accent-color:#0868db;flex:none}
 #attendanceV3 .av-assign-list{max-height:235px;overflow:auto;border:1px solid #c7d4e3;border-radius:8px}
 #attendanceV3 .av-check{display:flex;align-items:center;gap:8px;border-bottom:1px solid #dbe4ef;padding:6px;margin:0;font-weight:700}
 #attendanceV3 img.av-photo{width:40px;height:42px;object-fit:cover;border-radius:6px;flex:none;background:#e7edf5;border:1px solid #cbd5e1}#attendanceV3 .av-person{display:flex;align-items:center;gap:6px;min-width:0;text-align:start;background:none;border:0;box-shadow:none;padding:2px;color:#172332}
 #attendanceV3 .av-small{font-size:11px;font-weight:500;color:#52667c}#attendanceV3 .av-site{display:inline-block;background:#fff8a4;border:1px solid #efd86b;padding:3px 5px;border-radius:6px;font-size:11px;overflow-wrap:anywhere}
 #attendanceV3 .av-check .av-small,#attendanceV3 .av-history .av-small{display:block;margin-top:2px}
 #attendanceV3 .av-site-row>button{align-self:flex-end;margin-bottom:7px}
 #attendanceV3 .av-bar label{display:flex;align-items:center;gap:6px;margin:0;font-size:12px}
 #attendanceV3 .av-bar .av-date-field{width:142px;max-width:100%}
 #attendanceV3 .av-bar input{width:100%;min-width:0;font-size:12px;padding:6px}
 #attendanceV3 .av-selected{padding:8px;background:#fff1d0;border-radius:8px;font-weight:750}
 #attendanceV3 .av-save{display:block;width:100%;font-size:19px;padding:12px;margin-top:9px}
 #attendanceV3 .av-table-wrap{overflow:auto;max-width:100%;border:1px solid #b7c9df;border-radius:8px}
 #attendanceV3 table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:13px}#attendanceV3 th,#attendanceV3 td{border:1px solid #c4d1e1;padding:5px;overflow-wrap:anywhere;text-align:center;vertical-align:middle}#attendanceV3 th{background:linear-gradient(#dfedfb,#c0d7ef);font-weight:800}
 #attendanceV3 .av-attendance th:nth-child(1){width:6%}#attendanceV3 .av-attendance th:nth-child(2){width:37%}#attendanceV3 .av-attendance th:nth-child(3){width:23%}#attendanceV3 .av-attendance th:nth-child(4){width:34%}
 #attendanceV3 .av-pha{display:flex;justify-content:center;gap:4px}#attendanceV3 .av-pha button{padding:4px;min-height:30px;min-width:25px;width:30px;font-size:16px;color:#fff;opacity:1;border:2px solid transparent}
 #attendanceV3 .av-pha button[aria-pressed=true]{opacity:1;border-color:#12283e;box-shadow:0 0 0 2px #fff inset}
 #attendanceV3 .av-p{background:linear-gradient(#39ca22,#057212)}#attendanceV3 .av-h{background:linear-gradient(#ffc321,#ee8500)}#attendanceV3 .av-a{background:linear-gradient(#ff3a4f,#df0014)}
 #attendanceV3 .av-reports{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:9px 0}
 #attendanceV3 .av-profile{display:grid;grid-template-columns:95px minmax(0,1fr) auto;gap:10px;align-items:center}
 #attendanceV3 .av-profile img.av-photo{width:95px;height:122px}#attendanceV3 .av-profile h3{font-size:23px}#attendanceV3 .av-profile-actions{display:grid;gap:5px;max-width:130px}
 #attendanceV3 .av-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:8px 0}#attendanceV3 .av-tabs button[aria-pressed=true]{background:linear-gradient(#168fff,#0054af);color:white}
 #attendanceV3 .av-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid #a5b8cd;border-radius:8px;overflow:hidden}
 #attendanceV3 .av-day{display:flex;align-items:center;flex-direction:column;border-right:1px solid #b5c7da;padding:6px 1px;gap:4px;font-weight:750;font-size:13px}#attendanceV3 .av-day.today{background:#fffaa5}#attendanceV3 .av-circle{display:inline-flex;border-radius:50%;width:30px;height:30px;align-items:center;justify-content:center;color:white;font-size:18px}#attendanceV3 .av-circle.av-empty{background:#e2e8f0;color:#6b7785}
 #attendanceV3 .av-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin:9px 0}#attendanceV3 .av-stat{padding:6px 3px;border:1px solid #b8c8d9;border-radius:8px;text-align:center;font-size:11px;overflow-wrap:anywhere;min-width:0}#attendanceV3 .av-stat strong{display:block;font-size:17px;margin-top:5px}#attendanceV3 .av-stat:nth-child(1),#attendanceV3 .av-stat:nth-child(6){background:#d9f6d2}#attendanceV3 .av-stat:nth-child(2),#attendanceV3 .av-stat:nth-child(5){background:#dceffd}#attendanceV3 .av-stat:nth-child(3){background:#fff0c8}#attendanceV3 .av-stat:nth-child(4){background:#efdcff}
 #attendanceV3 .av-footer{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:9px 0}
 #attendanceV3 .av-history th:nth-child(1){width:17%}#attendanceV3 .av-history th:nth-child(2){width:15%}#attendanceV3 .av-history th:nth-child(3){width:19%}#attendanceV3 .av-history th:nth-child(4){width:27%}#attendanceV3 .av-history th:nth-child(5){width:22%}#attendanceV3 .av-history button{min-height:28px;padding:4px;font-size:12px;margin:2px}
 #attendanceV3 .av-status{padding:8px 10px;border-radius:8px;background:#fff4d8;white-space:pre-wrap;margin:8px 0}#attendanceV3 .av-status:empty{display:none}
 .av-dialog{font:15px/1.5 system-ui;max-width:560px;width:calc(100% - 22px);max-height:90dvh;overflow:auto;border:1px solid #a9bcd2;border-radius:12px;padding:16px;color:#142e4f}.av-dialog::backdrop{background:#112b4e99}.av-dialog label{display:block;font-weight:650;margin:10px 0}.av-dialog input:not([type=checkbox]),.av-dialog select,.av-dialog textarea{box-sizing:border-box;width:100%;font:inherit;padding:9px;margin-top:4px;border:1px solid #aabbd1;border-radius:7px}.av-dialog button{font:650 14px system-ui;border:0;border-radius:7px;background:#176b30;color:white;padding:10px;margin:5px 5px 5px 0}.av-dialog button:disabled{opacity:.5}.av-dialog img{max-width:140px;max-height:150px;object-fit:contain}.av-dialog [role=status]{white-space:pre-wrap;color:#943419}.av-dialog .av-dialog-close{float:right;background:#edf3fa;color:#14365c}
 #attendanceV3 .av-date-field,.av-dialog .av-date-field{display:inline-block;position:relative;width:100%;min-width:0}
 #attendanceV3 .av-date-field input,.av-dialog .av-date-field input{color:transparent!important;position:relative}
 #attendanceV3 .av-date-field input::-webkit-datetime-edit,.av-dialog .av-date-field input::-webkit-datetime-edit{color:transparent}
 #attendanceV3 .av-date-text,.av-dialog .av-date-text{position:absolute;inset-inline-start:10px;top:50%;transform:translateY(-50%);pointer-events:none;color:#142437;white-space:nowrap;font:inherit}
 @media(max-width:520px){#attendanceV3 .av-week-head h3,#attendanceV3 .av-history-head h3{width:100%}#attendanceV3 .av-week-head>span{flex:1;text-align:center;font-size:11px}#attendanceV3 .av-history-head>button{flex:1}}
 @media(max-width:520px){#attendanceV3{font-size:13px}#attendanceV3 .av-title{font-size:20px}#attendanceV3 .av-bar h3{font-size:15px}#attendanceV3 .av-bar button{font-size:11px;min-height:32px;padding:6px}#attendanceV3 table{font-size:11px}#attendanceV3 th,#attendanceV3 td{padding:4px 2px}#attendanceV3 .av-attendance img.av-photo{width:29px;height:33px}#attendanceV3 .av-person{font-size:12px;gap:4px}#attendanceV3 .av-site{font-size:10px;padding:2px}#attendanceV3 .av-pha{gap:2px}#attendanceV3 .av-pha button{font-size:14px;min-width:21px;width:23px;min-height:28px}#attendanceV3 .av-profile{grid-template-columns:65px minmax(0,1fr) 84px;gap:6px}#attendanceV3 .av-profile img.av-photo{width:65px;height:92px}#attendanceV3 .av-profile h3{font-size:18px}#attendanceV3 .av-profile-actions button{font-size:11px;min-height:30px;padding:5px}#attendanceV3 .av-stat{font-size:9px;padding:5px 2px}#attendanceV3 .av-stat strong{font-size:12px}#attendanceV3 .av-footer button{font-size:10px;padding:7px 2px}#attendanceV3 .av-tabs button{font-size:12px;padding:8px 3px}#attendanceV3 .av-history{font-size:10px}}
}

@media screen{#attendanceV3 .av-attendance-date input{height:48px}#attendanceV3 .av-attendance-date .av-date-text{display:flex;flex-direction:column;gap:1px;line-height:1.25}#attendanceV3 .av-day-name{font-size:12px;font-weight:750;color:#173f73}}

@media screen{#attendanceV3 .av-bar .av-attendance-date-label{flex-direction:column;align-items:stretch;gap:4px;text-align:center;font-size:15px;font-weight:750;min-width:180px}#attendanceV3 .av-bar .av-attendance-date{width:180px;height:68px;background:white;border:1px solid #9bb5d1;border-radius:8px}#attendanceV3 .av-attendance-date input{height:100%;opacity:0;cursor:pointer}#attendanceV3 .av-attendance-date:focus-within{outline:2px solid #77baff}#attendanceV3 .av-attendance-date .av-date-text{font-size:18px;font-weight:750;gap:4px;inset-inline-start:12px}#attendanceV3 .av-attendance-date .av-day-name{font-size:17px}#attendanceV3 .av-attendance-date::after{content:'📅';position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none;font-size:22px}@media(max-width:520px){#attendanceV3 .av-attendance-head{align-items:stretch}#attendanceV3 .av-attendance-head h3{width:100%;font-size:20px;text-align:center}#attendanceV3 .av-bar .av-attendance-date-label{width:100%;min-width:0}#attendanceV3 .av-bar .av-attendance-date{width:100%}}}
/* Combined payment uses the existing worker dialog and history styles. */
.av-payment-summary{margin:10px 0;padding:10px;background:#eef7ff;border:1px solid #c7ddf2;border-radius:8px}.av-payment-summary p,.av-payment-plan p{margin:6px 0}.av-payment-summary .av-history{min-width:0;width:100%;table-layout:fixed;border-collapse:collapse}.av-payment-summary .av-history th,.av-payment-summary .av-history td{border:1px solid #c7d8e6;padding:5px 3px;font-size:12px;text-align:right;overflow-wrap:anywhere}.av-payment-summary .av-history th:first-child,.av-payment-summary .av-history td:first-child{text-align:left}.av-dialog{box-sizing:border-box;max-width:calc(100vw - 16px)}.av-payment-plan{padding:9px;background:#f1faf1;border-radius:8px;margin:10px 0}.av-history td:last-child button{min-width:34px}

.av-payment-remaining{padding:8px 10px;background:#eef8ef;border-radius:7px;font-size:14px;font-weight:650}

/* Four compact attendance controls; saved OT stays on the blue button. */
#attendanceV3 .av-pha{display:flex;flex-wrap:nowrap;gap:3px}#attendanceV3 .av-pha .av-ot{background:#0863c6;color:white;min-width:38px;width:auto;max-width:65px;padding:3px;font-size:12px;overflow-wrap:anywhere}#attendanceV3 .av-attendance{width:100%;table-layout:fixed}#attendanceV3 .av-attendance th:nth-child(1){width:5%}#attendanceV3 .av-attendance th:nth-child(2){width:29%}#attendanceV3 .av-attendance th:nth-child(3){width:20%}#attendanceV3 .av-attendance th:nth-child(4){width:46%}.av-ot-hours{display:flex;gap:6px}.av-dialog button[aria-pressed=true]{outline:3px solid #186ac2;background:#084e9b}@media(max-width:380px){#attendanceV3 .av-pha{gap:2px}#attendanceV3 .av-pha button{min-width:20px;width:20px;font-size:12px}#attendanceV3 .av-pha .av-ot{min-width:33px;max-width:44px;width:auto;font-size:10px}#attendanceV3 .av-person{flex-wrap:wrap}#attendanceV3 .av-attendance .av-site{overflow-wrap:anywhere}}
