*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f4f6f9;color:#182235}.sam-app{max-width:1250px;margin:auto;padding:18px}.app-head{display:flex;justify-content:space-between;gap:20px;align-items:center;background:#fff;border:1px solid #e0e5ec;border-radius:18px;padding:20px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.08em;color:#667085}.app-head h1{margin:4px 0 3px}.app-head p{margin:0;color:#667085}.userbox{display:flex;gap:12px;align-items:center}.userbox a{color:#8b451d}.app-tabs{display:flex;gap:8px;overflow:auto;margin:14px 0}.app-tabs a{white-space:nowrap;text-decoration:none;color:#455160;background:#fff;border:1px solid #dce2ea;border-radius:999px;padding:9px 14px;font-weight:700}.app-tabs a.active{background:#704015;color:#fff;border-color:#704015}.toolbar{display:flex;justify-content:space-between;gap:16px;align-items:end;background:#fff;border:1px solid #dfe4eb;border-radius:14px;padding:13px;margin-bottom:14px}.toolbar form{display:flex;gap:9px;align-items:end;flex-wrap:wrap}.toolbar label{display:grid;gap:4px;font-size:12px;font-weight:700;color:#536070}.toolbar input,.toolbar select{min-height:38px;border:1px solid #cbd3dd;border-radius:8px;padding:6px 9px;background:#fff}.toolbar button,.mini,.btn{border:0;background:#704015;color:#fff;border-radius:8px;padding:10px 13px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-block}.toolbar small{display:block;color:#7c8695;margin-top:3px}.class-list{display:grid;gap:12px}.class-card{width:100%;display:grid;grid-template-columns:150px 1fr auto;gap:16px;align-items:center;text-align:left;background:#fff;border:1px solid #dce3eb;border-radius:16px;padding:16px;cursor:pointer}.class-card.now{border:2px solid #2f7d4b;background:#f5fff8;box-shadow:0 0 0 3px rgba(47,125,75,.12)}.class-card.disabled{cursor:default;opacity:.72}.class-card .time{font-weight:800}.class-card .time b{display:none;margin-left:8px;font-size:10px;background:#2f7d4b;color:#fff;padding:3px 6px;border-radius:999px}.class-card.now .time b{display:inline-block}.class-card.now .state{color:#21663d}.class-card .main{display:grid;gap:4px}.class-card small{color:#667085}.class-card .state{font-weight:700;color:#7a431c}.empty{background:#fff;border:1px dashed #c9d1dc;border-radius:14px;padding:22px;color:#667085;text-align:center}.hidden,.sam-hidden-during-edit{display:none!important}.attendance-view{margin-top:16px}.view-head{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;background:#fff;border:1px solid #e1e5eb;border-radius:16px;padding:14px}.view-head h2{margin:0 0 3px}.view-head p{margin:0;color:#667085}.counts{font-weight:800}.ghost{border:1px solid #c9d0da;background:#fff;padding:10px 13px;border-radius:9px;cursor:pointer}.roll-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(58px,1fr));gap:8px;margin:14px 0 90px}.roll-cell{min-height:58px;border:0;border-radius:11px;font-size:17px;cursor:pointer;display:grid;place-items:center}.roll-cell strong{line-height:1}.roll-cell small{font-size:10px}.roll-cell.p{background:#d9f2e1;color:#155b31}.roll-cell.a{background:#f8d7da;color:#8b1e27}.roll-cell.od{background:#dbeafe;color:#1d4ed8}.roll-cell.ml{background:#ede9fe;color:#6d28d9}.roll-cell.inactive{background:#e5e7eb;color:#8a8f98}.roll-cell.readonly{cursor:default}.sticky-submit{position:sticky;bottom:0;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff;border:1px solid #dfe4eb;border-radius:15px;padding:12px 14px;margin-top:-72px;z-index:4}.sticky-submit button,#confirmSubmit{background:#704015;color:#fff;border:0;border-radius:10px;padding:12px 16px;font-weight:800;cursor:pointer}.tap-toast{position:sticky;bottom:72px;background:#1f2937;color:#fff;padding:10px 13px;border-radius:10px;display:flex;justify-content:space-between;align-items:center;z-index:5}.tap-toast button{background:transparent;color:#fff;border:1px solid #fff;border-radius:7px;padding:5px 8px}.draft-banner{background:#fff3cd;border:1px solid #f1d17a;padding:10px 13px;border-radius:10px;margin-top:10px}.readonly-banner{background:#e7eef8;border:1px solid #bfd0e8;padding:10px 13px;border-radius:10px;margin-top:10px}.modal{position:fixed;inset:0;background:rgba(17,24,39,.55);display:grid;place-items:center;padding:18px;z-index:30}.modal-card{background:#fff;border-radius:18px;padding:20px;width:min(680px,100%);max-height:85vh;overflow:auto}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.review-row{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff7f7;border:1px solid #eed1d4;border-radius:10px;padding:10px;margin:7px 0}.review-row select,.review-row button{padding:7px 9px}.reason-wrap{display:grid;gap:6px;margin-top:14px;font-weight:700}.reason-wrap textarea{width:100%;border:1px solid #cbd3dd;border-radius:9px;padding:9px}.data-card{background:#fff;border:1px solid #dfe4eb;border-radius:15px;padding:16px;margin:14px 0}.data-card h2{margin-top:0}.section-head{display:flex;justify-content:space-between;gap:12px;align-items:start}.table-wrap{overflow:auto}.data-card table{border-collapse:collapse;width:100%;min-width:850px}.data-card th,.data-card td{border-bottom:1px solid #e7eaf0;padding:9px 8px;text-align:left;font-size:13px}.data-card th{background:#f8fafc;position:sticky;top:0}.data-card tr.shortage td{background:#fff1f2}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:14px 0}.kpis>div{background:#fff;border:1px solid #dfe4eb;border-radius:14px;padding:16px}.kpis strong{display:block;font-size:28px}.kpis span{color:#667085;font-size:12px}.sam-login{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(430px,100%);background:#fff;border:1px solid #dde3eb;border-radius:18px;padding:24px}.login-card input[type=text],.login-card input[type=password]{width:100%;padding:11px;margin-top:5px}.login-card .login-submit input{width:100%;padding:11px}
@media(max-width:800px){.sam-app{padding:10px}.app-head{align-items:flex-start}.userbox{display:grid;text-align:right}.toolbar{display:block}.toolbar form{margin-bottom:8px}.class-card{grid-template-columns:92px 1fr}.class-card .state{grid-column:2}.view-head{grid-template-columns:auto 1fr}.counts{grid-column:1/-1}.roll-grid{grid-template-columns:repeat(5,1fr)}.kpis{grid-template-columns:repeat(2,1fr)}.section-head{display:block}.section-head .btn{margin-top:8px}}


/* v0.4.0 advanced reporting / spreadsheet workspace */
.report-filter{display:flex;justify-content:space-between;gap:14px;align-items:flex-end;flex-wrap:wrap;background:#fff;border:1px solid #dfe5ec;border-radius:16px;padding:14px;margin:16px 0 10px}
.report-filter form{display:flex;gap:9px;align-items:flex-end;flex-wrap:wrap;flex:1}.report-filter label{display:grid;gap:4px;font-size:11px;font-weight:800;color:#5c6678}.report-filter input,.report-filter select{min-height:38px;border:1px solid #cbd3dd;border-radius:8px;padding:6px 8px;background:#fff}.report-filter button{min-height:38px;background:#704015;color:#fff;border:0;border-radius:9px;padding:0 14px;font-weight:800}.report-period{display:grid;gap:3px;text-align:right}.report-period small{color:#667085}.check-filter{display:flex!important;align-items:center;gap:6px!important;padding-bottom:8px}.check-filter input{min-height:auto!important}
.report-note{background:#f7f8fa;border:1px solid #e1e5eb;border-radius:11px;padding:10px 13px;margin-bottom:12px;color:#4d5768;font-size:12px}.report-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;margin:10px 0}.report-actions input[type=search]{min-width:220px;min-height:36px;border:1px solid #ccd3dc;border-radius:8px;padding:7px 10px}.report-actions .btn{text-decoration:none;background:#704015;color:#fff;border-color:#704015;font-weight:800}.report-kpis{margin:12px 0}
.sheet-wrap{position:relative;overflow:auto;max-height:66vh;border:1px solid #d8dee7;border-radius:10px;background:#fff}.sheet-table{border-collapse:separate;border-spacing:0;min-width:100%;width:max-content;font-size:12px}.sheet-table th,.sheet-table td{border-right:1px solid #e1e5eb;border-bottom:1px solid #e1e5eb;padding:7px 8px;white-space:nowrap;vertical-align:middle;background:#fff}.sheet-table th{position:sticky;top:0;z-index:5;background:#eef2f6;color:#344054;font-size:11px;text-transform:none;letter-spacing:.01em}.sheet-table th small,.sheet-table td small{display:block;color:#667085;font-weight:500;margin-top:2px}.sheet-table tbody tr:nth-child(even) td{background:#fbfcfd}.sheet-table tbody tr:hover td{background:#f6f9fc}.sheet-table .mark{text-align:center;font-weight:800;min-width:38px}.mark-p{background:#e7f6ec!important;color:#166534}.mark-a{background:#fdebec!important;color:#9f2430}.mark-od{background:#e8f1ff!important;color:#245a9a}.mark-ml{background:#fff3d8!important;color:#886013}.mark-—{color:#98a2b3}.shortage-row td{background:#fff8f7}.shortage-cell{background:#ffe8e5!important;color:#a4312b;font-weight:800}.warn-cell{background:#fff5d8!important;color:#8b5e16;font-weight:800}.signature-cell{min-width:120px}.date-head{min-width:96px;text-align:center}.matrix-wrap{max-height:72vh}.attendance-matrix td,.attendance-matrix th{padding:6px 7px}.cumulative-table td,.month-table td{text-align:center}.cumulative-table td:nth-child(-n+5),.month-table td:nth-child(-n+5){text-align:left}
/* frozen spreadsheet columns */
.freeze-2 th:nth-child(1),.freeze-2 td:nth-child(1){position:sticky;left:0;z-index:3;min-width:112px}.freeze-2 th:nth-child(2),.freeze-2 td:nth-child(2){position:sticky;left:112px;z-index:3;min-width:190px}.freeze-2 thead th:nth-child(-n+2){z-index:8}.freeze-5 th:nth-child(1),.freeze-5 td:nth-child(1){position:sticky;left:0;z-index:3;min-width:55px}.freeze-5 th:nth-child(2),.freeze-5 td:nth-child(2){position:sticky;left:55px;z-index:3;min-width:105px}.freeze-5 th:nth-child(3),.freeze-5 td:nth-child(3){position:sticky;left:160px;z-index:3;min-width:185px}.freeze-5 th:nth-child(4),.freeze-5 td:nth-child(4){position:sticky;left:345px;z-index:3;min-width:175px}.freeze-5 th:nth-child(5),.freeze-5 td:nth-child(5){position:sticky;left:520px;z-index:3;min-width:75px}.freeze-5 thead th:nth-child(-n+5){z-index:8}.freeze-2 td:nth-child(-n+2),.freeze-5 td:nth-child(-n+5){box-shadow:1px 0 0 #e1e5eb}
@media(max-width:700px){.report-filter{align-items:stretch}.report-filter form{display:grid;grid-template-columns:1fr 1fr}.report-filter label,.report-filter select,.report-filter input,.report-filter button{width:100%}.report-period{text-align:left}.report-actions{justify-content:stretch}.report-actions input,.report-actions a,.report-actions button{width:100%}.sheet-wrap{max-height:70vh}.freeze-5 th:nth-child(4),.freeze-5 td:nth-child(4),.freeze-5 th:nth-child(5),.freeze-5 td:nth-child(5){position:static}.freeze-5 th:nth-child(3),.freeze-5 td:nth-child(3){left:120px;min-width:170px}.freeze-5 th:nth-child(2),.freeze-5 td:nth-child(2){left:55px;min-width:65px}}
@media print{body{background:#fff}.app-head,.app-tabs,.report-filter,.report-actions,.report-note,.userbox{display:none!important}.sam-app{max-width:none;padding:0}.data-card{border:0!important;box-shadow:none!important;padding:0!important}.sheet-wrap{max-height:none!important;overflow:visible!important;border:0}.sheet-table{font-size:9px;width:100%}.sheet-table th,.sheet-table td{position:static!important;white-space:normal;padding:4px}.section-head p{display:none}.kpis{break-inside:avoid}}

/* v0.5.0 Health Camp-style header + spreadsheet reporting */
.sam-app{max-width:1220px;margin:auto;padding:24px}.hero{display:grid;grid-template-columns:82px minmax(0,1fr) auto;gap:18px;align-items:center;padding:22px 26px;background:linear-gradient(135deg,#fff7eb,#fff);border:1px solid #ebddc8;border-radius:17px;box-shadow:0 10px 30px rgba(16,24,40,.07)}.hero-logo{grid-column:1;width:82px;height:82px;display:flex;align-items:center;justify-content:center;border:1px solid #eadfce;border-radius:14px;background:#fff;padding:8px;flex:0 0 82px}.hero-logo img{max-width:100%;max-height:100%;object-fit:contain}.hero-main{grid-column:2;min-width:0;display:grid;gap:4px}.hero .eyebrow{font-size:11px;letter-spacing:.09em;font-weight:700;color:#b8792c;line-height:1.35;word-break:break-word}.hero h1{font-size:30px;line-height:1.05;color:#6b3f19;margin:0}.hero p{margin:0;color:#667085;max-width:58ch}.app-user{grid-column:3;margin-left:auto;display:grid;justify-items:end;gap:10px;text-align:right}.app-user span{display:grid;gap:2px}.app-user b{font-size:16px;line-height:1.15}.app-user small{color:#667085;font-size:12px}.app-user a{border:1px solid #d9c2a7;color:#6b3f19;text-decoration:none;padding:10px 12px;border-radius:12px;font-weight:700;background:#fff}.test-mode-banner{margin-top:12px;background:#fff3cd;border:1px solid #e8cb76;color:#694d00;padding:10px 14px;border-radius:10px}.list-tools{display:flex;margin:12px 0}.list-tools input{max-width:440px}.report-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0}.report-actions input[type=search]{width:min(360px,100%)}.sheet-wrap{overflow:auto;border:1px solid #dde3eb;border-radius:12px;background:#fff;max-height:68vh}.sheet-table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:12px}.sheet-table th,.sheet-table td{border-right:1px solid #e5e9ef;border-bottom:1px solid #e5e9ef;padding:7px 8px;white-space:nowrap;vertical-align:middle}.sheet-table th{position:sticky;top:0;z-index:4;background:#f5f7fa;font-weight:800;text-align:center}.sheet-table tbody tr:nth-child(even){background:#fbfcfd}.sheet-table tbody tr:hover{background:#fff8ed}.monthly-subject-table th:nth-child(1),.monthly-subject-table td:nth-child(1){position:sticky;left:0;z-index:3;background:inherit}.monthly-subject-table th:nth-child(2),.monthly-subject-table td:nth-child(2){position:sticky;left:64px;z-index:3;background:inherit}.monthly-subject-table th:nth-child(3),.monthly-subject-table td:nth-child(3){position:sticky;left:175px;z-index:3;background:inherit;min-width:190px}.monthly-subject-table th:nth-child(4),.monthly-subject-table td:nth-child(4){position:sticky;left:365px;z-index:3;background:inherit;min-width:150px}.monthly-subject-table thead th:nth-child(-n+4){z-index:6;background:#f5f7fa}.monthly-subject-table th:nth-child(n+5):nth-child(-n+35){min-width:34px}.monthly-subject-table .mark{text-align:center;font-weight:700}.sortable-head{cursor:pointer;user-select:none}.sortable-head::after{content:" ↕";font-size:9px;color:#98a2b3}.sortable-head[data-sort=asc]::after{content:" ↑"}.sortable-head[data-sort=desc]::after{content:" ↓"}.sam-admin-filters{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.sam-admin-filters input,.sam-admin-filters select{min-width:150px}.sam-admin-wrap .sheet-wrap{max-height:70vh}@media(max-width:820px){.sam-app{padding:12px}.hero{grid-template-columns:64px 1fr;grid-template-areas:"logo user" "main main";gap:14px;align-items:start;padding:18px}.hero-logo{grid-area:logo;width:64px;height:64px;flex-basis:64px}.hero-main{grid-area:main}.hero h1{font-size:24px}.hero p{font-size:14px;max-width:none}.app-user{grid-area:user;justify-self:end;align-self:start;margin-left:0}.monthly-subject-table th:nth-child(3),.monthly-subject-table td:nth-child(3){left:150px}.monthly-subject-table th:nth-child(4),.monthly-subject-table td:nth-child(4){left:315px}}@media(max-width:520px){.hero{padding:16px 14px}.hero-logo{width:56px;height:56px;border-radius:12px}.hero .eyebrow{font-size:10px;letter-spacing:.06em}.hero h1{font-size:20px}.hero p{font-size:12px;line-height:1.45}.app-user b{font-size:13px}.app-user small{font-size:11px}.app-user a{padding:9px 12px;border-radius:10px}.app-tabs{padding-bottom:3px}.app-tabs a{padding:10px 16px}}@media print{.hero,.app-tabs,.report-filter,.report-actions,.test-mode-banner,.toolbar,.list-tools{display:none!important}.sam-app,.sam-admin-wrap{max-width:none;padding:0}.sheet-wrap{overflow:visible;max-height:none;border:0}.sheet-table{font-size:8px}}

/* v0.5.1 — practical coverage selector */
.practical-coverage{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:12px 0;padding:13px 14px;background:#fff;border:1px solid #dfe5ec;border-radius:13px}
.practical-coverage>div:first-child{display:grid;gap:3px}
.practical-coverage small{color:#667085;font-size:11px}
.coverage-choices{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.coverage-choice{display:grid;gap:2px;min-width:112px;padding:9px 12px;border:1px solid #d5dbe3;border-radius:10px;background:#fff;color:#344054;cursor:pointer;text-align:left}
.coverage-choice strong{font-size:13px}.coverage-choice small{font-size:10px}
.coverage-choice.active{border-color:#8a4d17;background:#fff5e8;color:#6b3f19;box-shadow:0 0 0 1px #8a4d17 inset}
.coverage-choice:disabled{cursor:default;opacity:.72}
@media(max-width:700px){.practical-coverage{align-items:stretch;flex-direction:column}.coverage-choices{justify-content:stretch}.coverage-choice{flex:1;min-width:90px;text-align:center}}

/* v0.5.3 — WhatsApp attendance sharing */
.attendance-actions{display:flex;align-items:center;gap:9px}
.share-whatsapp{background:#147a46!important;color:#fff!important;border:0!important;border-radius:10px!important;padding:12px 16px!important;font-weight:800!important;cursor:pointer}
.share-whatsapp:disabled{opacity:.65;cursor:wait}
@media(max-width:700px){.sticky-submit{align-items:stretch;flex-direction:column}.attendance-actions{width:100%}.attendance-actions button{flex:1}.share-whatsapp{padding:11px 10px!important}}


/* v0.5.4 — visible frontend P/A/OD/ML quick marking */
.status-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;background:#fff;border:1px solid #dfe4eb;border-radius:14px;padding:12px 14px;margin:12px 0 4px}.status-toolbar>div:first-child{display:grid;gap:2px}.status-toolbar small{color:#667085}.status-mode-buttons{display:flex;gap:7px;flex-wrap:wrap}.status-mode-btn{border:1px solid #cfd6df;background:#fff;color:#344054;border-radius:999px;padding:8px 13px;font-weight:800;cursor:pointer}.status-mode-btn.mode-p.active{background:#d9f2e1;color:#155b31;border-color:#8fd0a4}.status-mode-btn.mode-a.active{background:#f8d7da;color:#8b1e27;border-color:#e6a5aa}.status-mode-btn.mode-od.active{background:#dbeafe;color:#1d4ed8;border-color:#9fc1f4}.status-mode-btn.mode-ml.active{background:#ede9fe;color:#6d28d9;border-color:#c4b5fd}@media(max-width:700px){.status-toolbar{align-items:stretch;flex-direction:column}.status-mode-buttons{display:grid;grid-template-columns:repeat(4,1fr);width:100%}.status-mode-btn{padding:9px 5px}}


/* v0.5.6 — reliable desktop WhatsApp share preview + unclipped snapshot workflow */
.sam-share-card{width:min(980px,96vw);max-height:92vh}.sam-share-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.sam-share-head h3{font-size:24px;margin:4px 0 5px;color:#182235}.sam-share-head p{margin:0;color:#667085}.sam-share-preview-image{margin-top:16px;border:1px solid #dde3eb;border-radius:14px;background:#f6f8fb;padding:10px;overflow:auto;max-height:52vh;text-align:center}.sam-share-preview-image img{display:block;max-width:100%;height:auto;margin:auto;border-radius:8px;background:#fff}.sam-share-card pre{white-space:pre-wrap;background:#f7f8fa;border:1px solid #e1e5eb;border-radius:11px;padding:12px 14px;color:#344054;font:500 13px/1.5 Inter,system-ui,sans-serif}.sam-share-status{min-height:22px;color:#475467;font-size:13px;margin-top:8px}.sam-share-actions{align-items:center}.sam-share-actions .share-whatsapp{min-width:230px}@media(max-width:700px){.sam-share-card{width:100%;padding:15px}.sam-share-head{display:block}.sam-share-head .ghost{margin-top:10px}.sam-share-preview-image{max-height:44vh}.sam-share-actions{display:grid;grid-template-columns:1fr}.sam-share-actions button{width:100%}}

.draft-state-banner{background:#eef6ff;border:1px solid #bfd7f2;color:#244a73;padding:10px 13px;border-radius:10px;margin-top:10px;font-size:13px}.draft-state-banner strong{color:#173a60}

/* v0.5.22 — single Absent/Present strategy toggle */
.base-mode-toggle{display:inline-flex;align-items:center;gap:8px;min-width:142px;justify-content:center;transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease}.base-mode-toggle .base-mode-switch{font-size:14px;line-height:1;opacity:.55;transform:translateY(-.5px)}.base-mode-toggle.mode-a{background:#fff;color:#344054}.base-mode-toggle.mode-a.active{background:#f8d7da;color:#8b1e27;border-color:#e6a5aa}.base-mode-toggle.mode-p{background:#fff;color:#344054}.base-mode-toggle.mode-p.active{background:#d9f2e1;color:#155b31;border-color:#8fd0a4}.base-mode-toggle:hover{box-shadow:0 1px 3px rgba(16,24,40,.08)}@media(max-width:700px){.status-mode-buttons{grid-template-columns:minmax(0,1.7fr) repeat(2,minmax(0,1fr))}.base-mode-toggle{min-width:0;width:100%}}
