.hsm-attendance{direction:rtl;color:#203049;font:inherit;min-width:0;--attendance-blue:#2860df;--attendance-green:#11754e;--attendance-red:#ba4051;--attendance-amber:#946211}
.hsm-attendance *{box-sizing:border-box}
.hsm-attendance-period-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:12px;margin-block:16px}
.hsm-attendance-period-form label{display:grid;gap:6px;min-width:0}
.hsm-attendance-period-form select,.hsm-attendance-period-form button{min-height:44px;width:100%;min-width:0}
.hsm-attendance-dialog{border:1px solid #e3eaf4;border-radius:20px;padding:0;width:min(960px,calc(100vw - 24px));max-width:calc(100vw - 16px);max-height:calc(100dvh - 32px);overflow:auto;color:#203049;background:#f7f9fd;box-shadow:0 20px 75px #182d4a55;z-index:100012;scroll-padding-block:95px}
.hsm-attendance-dialog::backdrop{background:#14233b80;backdrop-filter:blur(3px)}
.hsm-attendance-header,.hsm-attendance-actions,.hsm-attendance-pages{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.hsm-attendance-header{position:sticky;top:0;z-index:3;padding:16px 20px;background:#fff;border-bottom:1px solid #e3eaf4;box-shadow:0 3px 12px #23386006}
.hsm-attendance-header>div{flex:1;min-width:0}.hsm-attendance-header h3{font-size:18px;margin:3px 0 0;line-height:1.7;overflow-wrap:anywhere}.hsm-attendance-header small{color:#65758d;font-size:11px}
.hsm-attendance [data-attendance-body]{padding:0 20px 18px}.hsm-attendance h4{font-size:14px;margin:18px 0 8px}.hsm-attendance p{font-size:13px;line-height:1.8;margin:7px 0}.hsm-attendance small{font-size:12px;color:#67758c;line-height:1.7}
.hsm-attendance button,.hsm-attendance .hsm-attendance-file{font:inherit;font-size:12px;font-weight:600;border:1px solid #d7e1ee;border-radius:10px;padding:8px 12px;min-height:44px;min-width:0;background:#fff;color:#244a81;cursor:pointer;line-height:1.6;transition:background .15s,box-shadow .15s,border-color .15s;white-space:normal;overflow-wrap:anywhere}
.hsm-attendance button:hover:not(:disabled),.hsm-attendance .hsm-attendance-file:hover{background:#eef4ff;border-color:#a8bfe5;box-shadow:0 3px 9px #31517b10}
.hsm-attendance button.primary{background:linear-gradient(130deg,#2860df,#4e72e5);border-color:#2860df;color:#fff;box-shadow:0 4px 12px #2860df28;padding-inline:18px}
.hsm-attendance button.primary:hover:not(:disabled){background:linear-gradient(130deg,#1e50c5,#3d62d3);color:#fff}.hsm-attendance button:disabled{opacity:.5;cursor:default;box-shadow:none}
.hsm-attendance input,.hsm-attendance select,.hsm-attendance textarea{font:inherit;font-size:13px;box-sizing:border-box;border:1px solid #ccd8e8;border-radius:9px;background:#fff;color:#203049;padding:8px;min-height:44px;min-width:0;width:100%}.hsm-attendance textarea{resize:vertical;min-height:90px}.hsm-attendance label{display:grid;gap:5px;font-size:12px;min-width:0}
.hsm-attendance-grid,.hsm-attendance-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.hsm-attendance .full{grid-column:1/-1}
.hsm-attendance-context{display:flex;flex-wrap:wrap;gap:8px;margin-block:16px 12px;font-size:12px;color:#48617e}.hsm-attendance-context span{display:inline-flex;align-items:center;min-height:30px;padding:3px 10px;border-radius:8px;background:#edf2fb;border:1px solid #dfe7f3;max-width:100%;overflow-wrap:anywhere}
.hsm-attendance-page-summary{display:grid;gap:7px}.hsm-attendance-counts{display:flex;flex-wrap:wrap;gap:6px}.hsm-attendance-counts>span{display:inline-flex;align-items:center;gap:8px;padding:5px 9px;border-radius:8px;font-size:11px;background:#eaf0f8;color:#536980}.hsm-attendance-counts b{font-size:12px;font-weight:700}.hsm-attendance-counts .is-present{background:#e4f5ec;color:var(--attendance-green)}.hsm-attendance-counts .is-absent{background:#ffedf0;color:var(--attendance-red)}.hsm-attendance-counts .is-late{background:#fff3d8;color:var(--attendance-amber)}.hsm-attendance-counts .is-excused{background:#eeeafd;color:#7052a6}
.hsm-attendance-search{display:grid;grid-template-columns:minmax(0,1fr) minmax(80px,.23fr);gap:8px;margin-block:14px;align-items:end}.hsm-attendance-search button{background:#edf3ff;border-color:#d6e3fa;color:#2857a7}
.hsm-attendance-roster-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.hsm-attendance-roster-tools button{background:#e8f6ef;color:var(--attendance-green);border-color:#ccebdc}
.hsm-attendance-roster-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
.hsm-attendance-row{position:relative;padding:14px;border:1px solid #dfe6f0;border-inline-start:4px solid #b6c2d4;border-radius:14px;background:#fff;align-items:center;box-shadow:0 2px 8px #19334e05;row-gap:8px;min-width:0;transition:border-color .15s,box-shadow .15s}
.hsm-attendance-row[data-current-status=present]{border-inline-start-color:#36a67b}.hsm-attendance-row[data-current-status=absent]{border-inline-start-color:#e27080}.hsm-attendance-row[data-current-status=late]{border-inline-start-color:#dfae4e}.hsm-attendance-row[data-current-status=excused]{border-inline-start-color:#9a83d8}.hsm-attendance-row.is-changed{box-shadow:0 0 0 2px #3f73e41a;background:#fcfdff}
.hsm-attendance-pupil{display:flex;align-items:center;gap:9px;min-width:0}.hsm-attendance-pupil img,.hsm-attendance-avatar{width:38px;height:38px;border-radius:12px;object-fit:cover;flex-shrink:0}.hsm-attendance-avatar{display:grid;place-items:center;background:linear-gradient(135deg,#edf2fd,#e0ebf7);color:#526a8d;font-weight:700}.hsm-attendance-pupil strong{font-size:13px;line-height:1.8;overflow-wrap:anywhere}
.hsm-attendance-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.hsm-attendance-choices button{padding:7px 5px;font-size:12px}.hsm-attendance-choices button.is-present{background:#edf9f3;border-color:#d4ede0;color:var(--attendance-green)}.hsm-attendance-choices button.is-absent{background:#fff0f2;border-color:#f8dbe2;color:var(--attendance-red)}.hsm-attendance-choices button.is-late{background:#fff7e8;border-color:#f4e5c6;color:var(--attendance-amber)}.hsm-attendance-choices button[aria-pressed=true]{color:#fff;box-shadow:0 3px 9px #26374916}.hsm-attendance-choices button.is-present[aria-pressed=true]{background:#168259;border-color:#168259}.hsm-attendance-choices button.is-absent[aria-pressed=true]{background:#c7485c;border-color:#c7485c}.hsm-attendance-choices button.is-late[aria-pressed=true]{background:#946211;border-color:#946211}.hsm-attendance-choices button[aria-pressed=true]:hover{filter:brightness(.94);color:#fff}
.hsm-attendance details{min-width:0;border:1px solid #e1e7f0;border-radius:10px;padding:8px 10px;background:#fff}.hsm-attendance summary{cursor:pointer;font-size:12px;min-height:44px;line-height:1.8;padding-block:10px;overflow-wrap:anywhere}.hsm-attendance-row details:not([open]){justify-self:start;border:0;padding:0;background:transparent}.hsm-attendance-row details:not([open]) summary{display:inline-flex;align-items:center;min-height:44px;padding:0 2px;color:#54718a}.hsm-attendance-row details:not([open]) summary::before{content:'＋';margin-inline-end:4px}
.hsm-attendance-history{display:grid;gap:8px;margin-block:12px}.hsm-attendance-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border-radius:12px;border:1px solid #e0e7f2;background:#fff;margin-block:12px}.hsm-attendance-detail-heading strong{font-size:14px;overflow-wrap:anywhere}.hsm-attendance-explain-box{margin-top:16px}
.hsm-attendance-badge{display:inline-block;border-radius:7px;padding:4px 8px;background:#f1f5fb;color:#526a8d;font-size:11px;line-height:1.8;overflow-wrap:anywhere}.hsm-attendance-badge.is-absent,.hsm-attendance-badge.is-rejected{background:#ffedf0;color:#a53c4d}.hsm-attendance-badge.is-late,.hsm-attendance-badge.is-pending{background:#fff4df;color:#886323}.hsm-attendance-badge.is-present,.hsm-attendance-badge.is-accepted,.hsm-attendance-badge.is-excused{background:#eaf7f0;color:#286c4d}
.hsm-attendance-explanation-link{display:flex;flex-wrap:wrap;align-items:center;gap:7px;border-top:1px solid #edf0f5;padding-top:8px}.hsm-attendance-explanation-link button{margin-inline-start:auto;padding:7px 10px}
.hsm-attendance-actions{margin-top:12px;justify-content:flex-start}.hsm-attendance-savebar{position:sticky;bottom:8px;z-index:2;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:12px;margin:14px -4px 0;border:1px solid #dbe5f2;border-radius:12px;background:#fffffffa;box-shadow:0 -5px 18px #2741630c;backdrop-filter:blur(8px)}.hsm-attendance-savebar [data-attendance-dirty-count]{font-size:12px;color:#526a85;line-height:1.8;min-width:0}.hsm-attendance-savebar:has([data-attendance-save]:not(:disabled)) [data-attendance-dirty-count]{color:#275dbe;font-weight:600}
.hsm-attendance-pages{margin-top:14px;font-size:12px}.hsm-attendance-pages>span{text-align:center;color:#61748a;min-width:0;flex:1;line-height:1.8}.hsm-attendance-periods{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-block:14px}.hsm-attendance-periods button{display:grid;gap:3px;text-align:right;background:#edf4ff;border-color:#d8e5fa}.hsm-attendance-back{margin-top:12px}
.hsm-attendance-file{display:inline-flex;align-items:center;text-decoration:none;background:#eef4ff!important}.hsm-attendance .error{color:#af3838}.hsm-attendance [hidden]{display:none!important}.hsm-attendance :focus-visible{outline:3px solid #88a7ee;outline-offset:2px}.hsm-attendance .hsm-attendance-plain{white-space:pre-wrap;overflow-wrap:anywhere}.hsm-attendance .hsm-attendance-help{padding:9px 11px;border-radius:9px;background:#edf3fc;color:#526e92}
.hsm-attendance [data-attendance-message]{position:sticky;top:83px;z-index:3;padding:8px 20px;margin:0;border-bottom:1px solid #dfe8f5;background:#edf4ff;color:#365e99;overflow-wrap:anywhere}.hsm-attendance [data-attendance-message]:empty{display:none}.hsm-attendance [data-attendance-message].error{background:#fff0f0;color:#a53745;border-color:#f3d7dc}
.hsm-attendance.is-loading [data-attendance-roster],.hsm-attendance.is-loading [data-attendance-search],.hsm-attendance.is-loading .hsm-attendance-pages{opacity:.6;pointer-events:none}.hsm-attendance-skeleton{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding-block:18px}.hsm-attendance-skeleton i{display:block;height:145px;border-radius:14px;background:linear-gradient(100deg,#eaf0f8 20%,#f6f8fc 45%,#eaf0f8 70%);background-size:220% 100%;animation:hsm-attendance-loading 1.1s linear infinite}@keyframes hsm-attendance-loading{to{background-position:-220% 0}}
@media(max-width:650px){.hsm-attendance-roster-grid{grid-template-columns:minmax(0,1fr)}.hsm-attendance-periods{grid-template-columns:repeat(2,minmax(0,1fr))}.hsm-attendance-savebar{grid-template-columns:repeat(2,minmax(0,1fr));bottom:8px}.hsm-attendance-savebar [data-attendance-dirty-count]{grid-column:1/-1}.hsm-attendance-savebar button{width:100%}.hsm-attendance-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 20px);border-radius:16px}.hsm-attendance-header{padding:12px}.hsm-attendance-header h3{font-size:16px}.hsm-attendance [data-attendance-body]{padding:0 12px 14px}.hsm-attendance [data-attendance-message]{top:77px;padding-inline:12px}.hsm-attendance-pupil strong{font-size:12px}.hsm-attendance-skeleton{grid-template-columns:repeat(2,minmax(0,1fr))}.hsm-attendance-search{grid-template-columns:minmax(0,1fr) 80px}.hsm-attendance-roster-tools{display:grid;grid-template-columns:1fr}.hsm-attendance-row{padding:11px;gap:8px}.hsm-attendance-counts{gap:5px}.hsm-attendance-counts>span{padding:5px 7px}.hsm-attendance select{font-size:12px}.hsm-attendance-pupil{gap:6px}.hsm-attendance-pupil img,.hsm-attendance-avatar{width:32px;height:32px}}
@media(prefers-reduced-motion:reduce){.hsm-attendance-skeleton i{animation:none}.hsm-attendance button,.hsm-attendance-row{transition:none}}
.hsm-attendance-row-tools{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-width:0}.hsm-attendance-row-tools>details{flex:1;min-width:0}.hsm-attendance-row-tools [data-attendance-action=reset-row]{border:0;padding-inline:4px;background:transparent;color:#54718a;font-size:11px;flex-shrink:0}

.hsm-attendance-person-line{display:flex;justify-content:space-between;align-items:center;gap:8px;min-width:0}.hsm-attendance-person-line>.hsm-attendance-pupil{flex:1}.hsm-attendance-person-line>.hsm-attendance-badge{flex-shrink:0}.hsm-attendance-row.is-compact{border-radius:10px;padding:10px 12px;row-gap:6px;box-shadow:none}.hsm-attendance-row.is-compact .hsm-attendance-row-tools{align-items:center}.hsm-attendance-row-more[open]{width:100%}.hsm-attendance-choices.has-manager{grid-template-columns:repeat(4,minmax(0,1fr))}.hsm-attendance-choices button.is-excused{background:#f1ecff;border-color:#ddd2f5;color:#614699}.hsm-attendance-choices button.is-excused[aria-pressed=true]{background:#7052a6;border-color:#7052a6;color:#fff}.hsm-attendance-row-more .hsm-attendance-grid{align-items:start}.hsm-attendance-roster-grid{gap:8px}.hsm-attendance-row.is-compact .hsm-attendance-pupil img,.hsm-attendance-row.is-compact .hsm-attendance-avatar{width:28px;height:28px;border-radius:8px}.hsm-attendance-row.is-compact .hsm-attendance-row-tools summary{min-height:44px}.hsm-attendance-row.is-compact .hsm-attendance-choices button{min-height:44px}
@media(max-width:650px){.hsm-attendance-row.is-compact{padding:9px 10px}.hsm-attendance-choices button{font-size:11px}.hsm-attendance-row.is-compact .hsm-attendance-pupil strong{font-size:12px}.hsm-attendance-person-line>.hsm-attendance-badge{font-size:10px;padding:3px 6px}.hsm-attendance-savebar{margin-top:10px}.hsm-attendance-roster-tools>small{font-size:11px}}
