@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
:root{font-family:'DM Sans',Arial,sans-serif;color:#1e3542;background:#e8f1f5;font-synthesis:none}
*{box-sizing:border-box}html,body{max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%}body{margin:0;min-width:320px}button,input,textarea,select{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}input,textarea,select{color:#203846}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.page-bg{position:fixed;inset:0;background:radial-gradient(circle at 14% 8%,#d3e7f1 0%,transparent 48%),radial-gradient(circle at 86% 18%,#dceee9 0%,transparent 42%),linear-gradient(180deg,#dfeef4 0%,#e8f1f5 62%);z-index:-1}
.app-shell{max-width:1480px;margin:auto;padding:max(22px,env(safe-area-inset-top)) max(28px,env(safe-area-inset-right)) max(56px,env(safe-area-inset-bottom)) max(28px,env(safe-area-inset-left))}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:9px 0 24px;gap:16px;flex-wrap:wrap}
.top-nav{display:inline-flex;align-items:center;gap:6px;background:#f4fafc;border:1px solid #d2e4eb;border-radius:11px;padding:4px}
.nav-link{display:inline-flex;align-items:center;gap:7px;text-decoration:none;color:#3d6272;font-size:12.5px;font-weight:700;padding:8px 14px;border-radius:8px;transition:background .15s,color .15s}
.nav-link:hover{background:#e5f2f7;color:#1d566d}
.nav-link.active{background:#236b88;color:white;box-shadow:0 2px 8px #17496826}
.nav-badge{display:inline-flex;align-items:center;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.02em;background:#f9e3bc;color:#8c4f0e;line-height:1.2}
.nav-link.active .nav-badge{background:#fff3d6;color:#7c4308}
.nav-badge[hidden]{display:none}
.brand{display:flex;align-items:center;gap:12px}.brand-logo{width:55px;height:55px;object-fit:cover;border-radius:13px;background:white;box-shadow:0 2px 10px #13476b16}.brand strong,.brand small{display:block}.brand strong{font:800 16px/1.2 Manrope,Arial,sans-serif;letter-spacing:-.02em}.brand small{font-size:12px;color:#58707c;margin-top:3px}.eyebrow{display:block;text-transform:uppercase;letter-spacing:.13em;font-size:10px;font-weight:800;color:#518096;margin-bottom:5px}.top-actions,.panel-actions,.export-controls>div{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.save-status{font-size:12px;color:#577483}
.user-menu{display:inline-flex;align-items:center;gap:8px;padding-left:10px;border-left:1px solid #cce0e8}
.user-chip{display:inline-flex;align-items:center;gap:8px;border:1px solid #cfe0e8;background:#f7fbfd;border-radius:10px;padding:5px 10px 5px 6px;color:#214658;text-align:left;transition:background .15s,border-color .15s}
.user-chip:hover{background:#ebf5f9;border-color:#9fc4d3}
.user-avatar{width:30px;height:30px;border-radius:8px;background:#236b88;color:white;display:grid;place-items:center;font:800 13px/1 Manrope,Arial,sans-serif;flex:none}
.user-meta{display:flex;flex-direction:column;line-height:1.2}
.user-meta strong{font-size:12px;font-weight:700;max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-meta small{font-size:10px;color:#5f7a87;max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.logout-form{margin:0}
.logout-btn{color:#8a3340;border-color:#e4c7cc}
.logout-btn:hover{background:#fdf0f2;border-color:#d99ea7}
.button{border:1px solid #bfd4de;background:#f8fcfe;color:#224d61;border-radius:9px;padding:11px 15px;font-size:13px;font-weight:700;transition:background .15s,transform .15s}.button:hover{background:#e9f4f8;transform:translateY(-1px)}.button:disabled{opacity:.6;cursor:not-allowed;transform:none}.button:focus-visible,.text-button:focus-visible,.icon-button:focus-visible,.user-chip:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #7cb3c6;outline-offset:2px}.button.secondary{background:#dceef3;border-color:#c4dce6}.button.primary{color:white;background:#236b88;border-color:#236b88}.button.primary:hover{background:#1b5d76}.button.ghost{background:white}.button.danger-ghost{background:white;color:#9d2d3c;border-color:#e4c4c9}.button.danger-ghost:hover{background:#fdf0f2;border-color:#d99ba4}.button.small{padding:9px 12px;font-size:12.5px}.full-width{width:100%}.icon-button{font-size:28px;line-height:1;background:transparent;border:0;color:#4e6c7c;padding:4px 8px}
.hero{min-height:215px;border-radius:17px;overflow:hidden;background:radial-gradient(circle at 85% 22%,rgba(145,212,224,.28),transparent 46%),linear-gradient(112deg,#0b4266 0%,#125277 54%,#1f6e8c 100%);display:flex;align-items:end;justify-content:space-between;gap:24px;color:white;padding:34px 42px;box-shadow:0 16px 45px #12507520}.hero .eyebrow{color:#b7dce7}.hero h1{font:800 clamp(26px,3vw,42px)/1.08 Manrope,Arial,sans-serif;letter-spacing:-.045em;margin:0 0 12px;max-width:640px}.hero h1 em{font-style:normal;color:#bce3df}.hero p:last-child{font-size:13px;line-height:1.6;margin:0;max-width:520px;color:#e4f0f3}.hero-count{display:flex;align-items:center;gap:13px;border-left:1px solid #ffffff6b;padding-left:20px;flex:none;font-variant-numeric:tabular-nums}.hero-count strong{font:800 43px/1 Manrope,Arial,sans-serif}.hero-count span{font-size:12px;line-height:1.4;color:#e4f0f3}
.workspace{display:grid;grid-template-columns:270px minmax(0,1fr);gap:18px;margin-top:18px;align-items:start}.sidebar,.main-panel{background:#fafdfe;border:1px solid #d5e5eb;border-radius:14px;box-shadow:0 9px 32px #17496812}.sidebar{padding:21px;position:sticky;top:18px}.sidebar-heading{display:flex;align-items:center;justify-content:space-between}.sidebar-student-actions{margin-top:14px}.sidebar h2,.panel-head h2{margin:0;font:800 21px/1.2 Manrope,Arial,sans-serif;letter-spacing:-.035em}.pill{background:#e7f2f0;border-radius:50px;padding:5px 8px;color:#547a76;font-size:11px;font-weight:700}.search-wrap input{width:100%;border:1px solid #d4e3e9;background:white;border-radius:8px;margin:12px 0 12px;padding:10px 12px;font-size:13px}.student-list{max-height:510px;overflow:auto;display:grid;gap:4px}.student-item{width:100%;border:0;background:transparent;border-radius:8px;display:flex;align-items:center;gap:10px;text-align:left;padding:10px 9px;color:#345464;font-size:12.5px;font-weight:600;line-height:1.35}.student-item:hover{background:#eff7f9}.student-item.active{background:#e2f0f5;color:#1f6078}.student-number{width:25px;height:25px;display:grid;place-items:center;border:1px solid #d1e2e8;background:white;border-radius:7px;flex:none;font-size:11px;color:#738995}.student-item.active .student-number{background:#286e88;color:white;border-color:#286e88}.student-item .mini-status{margin-left:auto;font-size:10px;color:#5d837b;flex:none}.side-note{font-size:11px;line-height:1.55;color:#647f89;background:#f1f7f8;border:1px solid #dfebef;border-radius:8px;padding:11px;margin-top:16px}.backup-actions{display:flex;flex-direction:column;align-items:start;gap:3px;margin-top:10px}.text-button{border:0;background:none;color:#236b88;font-weight:700;font-size:11px;padding:5px}
.main-panel{padding:28px;min-width:0}.panel-head{display:flex;justify-content:space-between;gap:15px;align-items:start}.panel-head p{font-size:12px;margin:7px 0 0;color:#6b8290}.progress-track{height:5px;background:#e4eef1;border-radius:20px;margin:17px 0 20px;overflow:hidden}.progress-track span{display:block;height:100%;width:0;background:#7db2a7;transition:width .2s}.notice{font-size:12px;line-height:1.5;background:#f1f7f3;color:#567665;border:1px solid #dcebe0;border-radius:8px;padding:11px 13px}.period-toolbar{display:flex;gap:10px;align-items:end;margin:23px 0 19px;flex-wrap:wrap}.period-toolbar label,.export-controls label{font-size:11px;color:#5d7581;font-weight:700}.period-toolbar select,.export-controls select{display:block;min-width:155px;margin-top:5px}.form-card{border:1px solid #dce9ed;border-radius:11px;padding:22px;margin:13px 0;background:white}.section-title{display:flex;gap:12px;align-items:start;margin-bottom:21px}.section-title>span{width:26px;height:26px;border-radius:7px;background:#dceff0;display:grid;place-items:center;color:#2e7180;font-weight:800;font:800 12px Manrope,Arial,sans-serif;flex:none}.section-title h3,.export-card h3{font:800 16px/1.3 Manrope,Arial,sans-serif;letter-spacing:-.02em;margin:0}.section-title p,.export-card p{font-size:11.5px;color:#718794;margin:5px 0 0;line-height:1.55}
.identity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.identity-grid label,.block-label{display:block;font-weight:700;font-size:11px;color:#526c7b}.identity-grid input,.block-label textarea,.period-toolbar select,.export-controls select,.editor-row input,.editor-row select{width:100%;background:#fbfdfe;border:1px solid #d3e2e8;border-radius:7px;padding:10px 11px;margin-top:6px;font-size:12px;outline:0}.block-label textarea{resize:vertical;min-height:94px;line-height:1.5}.table-wrap{overflow-x:auto}.report-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.report-table th{font-size:10.5px;color:#577684;background:#eaf3f6;text-align:left;padding:11px 9px;font-weight:800;border-bottom:1px solid #d9e8ee}.report-table td{vertical-align:top;border-bottom:1px solid #e3edef;padding:12px 9px;font-size:11.5px;line-height:1.45}.report-table tr:last-child td{border-bottom:0}.report-table th:nth-child(1){width:11%}.report-table th:nth-child(2){width:28%}.report-table th:nth-child(3){width:21%}.report-table th:nth-child(4){width:19%}.report-table th:nth-child(5){width:21%}.report-table td:first-child{font-weight:800;color:#2d6478}.report-table td:nth-child(3){color:#65808a}.report-table select,.report-table textarea{border:1px solid #d4e4e8;background:white;width:100%;border-radius:6px;padding:7px;font-size:11px}.report-table textarea{min-height:52px;resize:vertical;line-height:1.35}.report-table textarea.activity-field{min-height:55px;background:#f8fcfd;border-color:#c9dee6;color:#25495a}.report-table textarea.activity-field:hover{border-color:#8fb8c8}.report-table textarea.activity-field:focus{background:white}.report-table select.rated{color:#255e65;background:#f0f8f4;border-color:#cfe8da;font-weight:700}.scale-key{padding-top:15px;border-top:1px solid #e3ecef;color:#728893;font-size:10.5px;line-height:1.7}.scale-key b{color:#486a79}.day-group{font-weight:800;color:#366e83;background:#f4f9fb;padding:8px 10px;font-size:11px;display:none}.narrative{border:1px solid #cfe3dd;padding:13px 16px;background:#f4f9f7;color:#365b5f;font-size:12px;line-height:1.7;border-radius:8px;margin-bottom:16px;white-space:pre-wrap}.narrative strong{color:#225e6d}.export-card{background:#e8f3f5;border:1px solid #c9e2e8;border-radius:11px;display:flex;justify-content:space-between;gap:22px;padding:22px;margin:17px 0 4px}.export-card>div:first-child{max-width:530px}.export-controls{display:flex;align-items:end;gap:12px;flex-direction:column}.export-controls>div{white-space:nowrap}
dialog{border:1px solid #d5e4e9;border-radius:13px;box-shadow:0 25px 80px #15374850;color:#233f4c;max-height:90dvh;overflow-y:auto;overscroll-behavior:contain}dialog::backdrop{background:#102e40a8}.modal{width:min(850px,calc(100vw - 30px));max-height:88dvh;overflow:auto;padding:24px}.modal-head{display:flex;justify-content:space-between;align-items:start;gap:12px}.modal-head h2{font:800 20px Manrope;margin:0}.modal>p{font-size:12px;color:#647f8b;line-height:1.5}.editor-row{display:grid;grid-template-columns:100px 2fr 1.5fr 35px;gap:8px;align-items:end;border-top:1px solid #e4eef1;padding:12px 0}.editor-row label{font-size:10px;color:#617b87;font-weight:700}.editor-row input,.editor-row select{margin-top:4px}.editor-row .icon-button{font-size:20px}.modal-foot{display:flex;justify-content:space-between;gap:10px;margin-top:15px}.preview-modal{width:min(950px,calc(100vw - 20px));height:min(92dvh,1200px);max-height:92dvh;overflow:hidden;padding:0}.preview-head{display:flex;justify-content:space-between;align-items:center;padding:9px 17px;border-bottom:1px solid #dbe8ed;font-size:13px}.preview-modal iframe{border:0;width:100%;height:calc(100% - 49px);background:#e7eef1}
.period-modal{width:min(450px,calc(100vw - 30px));padding:24px}.period-modal p{font-size:12px;color:#647f8b;line-height:1.5;margin:14px 0}.period-modal label{display:block;font-size:11px;color:#526c7b;font-weight:700;margin-bottom:11px}.period-modal input{display:block;width:100%;background:#fbfdfe;border:1px solid #d3e2e8;border-radius:7px;padding:10px 11px;margin-top:6px;font-size:12px}.period-modal .modal-foot{justify-content:flex-end}
.inline-alert{font-size:12px;line-height:1.45;padding:10px 12px;border-radius:8px;margin-bottom:12px;border:1px solid transparent}
.inline-alert.success{background:#eaf7ef;border-color:#bce2ca;color:#1d6042}
.inline-alert.error{background:#fdeef0;border-color:#eabbc2;color:#952636}
.inline-alert[hidden]{display:none}
.absensi-panel{background:#fafdfe;border:1px solid #d5e5eb;border-radius:14px;box-shadow:0 9px 32px #17496812;padding:28px;margin-top:18px}
.recap-alert{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:15px 18px;border-radius:11px;border:1px solid #cde0e7;background:#eff7fa;color:#275263;margin:18px 0 20px;flex-wrap:wrap}
.recap-alert strong{display:block;font:800 14px/1.35 Manrope,Arial,sans-serif;margin-bottom:3px}
.recap-alert p{margin:0;font-size:12px;line-height:1.5;opacity:.92}
.recap-alert.warning{background:#fff7e8;border-color:#ebcb8b;color:#7b4810;box-shadow:0 6px 20px #b9751c16}
.recap-alert.warning .button.primary{background:#b86b14;border-color:#b86b14;color:white}
.recap-alert.warning .button.primary:hover{background:#9b570d}
.recap-alert.done{background:#eef8f2;border-color:#bfe2cd;color:#235c43}
.recap-alert-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.week-toolbar{display:flex;justify-content:space-between;align-items:end;gap:14px;flex-wrap:wrap;margin:16px 0}
.week-controls,.day-actions{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.week-controls label{font-size:11px;color:#5d7581;font-weight:700}
.week-controls select,.week-controls input[type="date"]{display:block;min-width:155px;margin-top:5px;background:#fbfdfe;border:1px solid #d3e2e8;border-radius:7px;padding:9px 11px;font-size:12px;outline:0}
.day-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:14px 0 18px}
.day-tab{border:1px solid #d2e4eb;background:white;border-radius:10px;padding:11px 12px;text-align:left;display:flex;flex-direction:column;gap:4px;color:#335463;transition:border-color .15s,background .15s,transform .15s}
.day-tab:hover{background:#f2f9fb;border-color:#9fc4d3;transform:translateY(-1px)}
.day-tab.active{background:#236b88;border-color:#236b88;color:white;box-shadow:0 6px 18px #18516a29}
.day-tab-top{display:flex;justify-content:space-between;align-items:center;gap:6px;font:800 13px/1.2 Manrope,Arial,sans-serif}
.day-tab-meta{font-size:11px;opacity:.82}
.day-tab-badge{font-size:10px;font-weight:800;padding:2px 6px;border-radius:999px;background:#e8f2f6;color:#4a7080}
.day-tab.complete .day-tab-badge{background:#dff3e7;color:#1f6848}
.day-tab.active .day-tab-badge{background:#ffffff2b;color:white}
.stats-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 18px}
.stat-card{background:white;border:1px solid #dce9ed;border-radius:11px;padding:14px 16px}
.stat-card span{display:block;font-size:11px;font-weight:700;color:#627c88}
.stat-card strong{display:block;font:800 26px/1.15 Manrope,Arial,sans-serif;color:#1d4d61;margin:5px 0 2px}
.stat-card small{display:block;font-size:11px;color:#728a95}
.stat-card.stat-h strong{color:#1f6f4f}
.stat-card.stat-i strong{color:#a16112}
.stat-card.stat-s strong{color:#a83c49}
.table-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.table-toolbar .search-wrap{margin:0;min-width:220px;flex:1;max-width:320px}
.table-toolbar .search-wrap input{margin:0}
.attendance-table{width:100%;border-collapse:separate;border-spacing:0}
.attendance-table th{font-size:11px;color:#577684;background:#eaf3f6;text-align:left;padding:11px 10px;font-weight:800;border-bottom:1px solid #d9e8ee}
.attendance-table th.col-center,.attendance-table td.col-center{text-align:center}
.attendance-table td{vertical-align:middle;border-bottom:1px solid #e3edef;padding:10px;font-size:12.5px}
.attendance-table tr:last-child td{border-bottom:0}
.attendance-table tbody tr:hover{background:#f7fbfd}
.att-num{width:42px;color:#6b8390;font-weight:700}
.att-student strong{display:block;font-size:13px;color:#1f3b49}
.att-student small{display:block;font-size:11px;color:#6c8490;margin-top:2px}
.attention-tag{display:inline-block;margin-top:4px;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:700;background:#fdecee;color:#9f2f3d}
.att-btn{min-width:86px;min-height:36px;border:1px solid #cfe0e7;background:#fbfdfe;color:#4a6977;border-radius:8px;padding:7px 12px;font-size:12px;font-weight:700;transition:all .14s}
.att-btn:hover{border-color:#93bac9;background:#f0f8fb}
.att-btn.selected.is-H{background:#e1f5ea;border-color:#6bc092;color:#165e3d;box-shadow:inset 0 0 0 1px #6bc092}
.att-btn.selected.is-I{background:#fff3da;border-color:#e2ad4e;color:#8a4f0a;box-shadow:inset 0 0 0 1px #e2ad4e}
.att-btn.selected.is-S{background:#fde9ec;border-color:#e38894;color:#982838;box-shadow:inset 0 0 0 1px #e38894}
.att-note{width:100%;min-width:150px;background:#fbfdfe;border:1px solid #d3e2e8;border-radius:7px;padding:8px 10px;font-size:12px;outline:0}
.att-note:focus{background:white;border-color:#7cb3c6}
.week-mini-pills{display:inline-flex;gap:4px;flex-wrap:wrap}
.mini-pill{font-size:10.5px;font-weight:800;padding:3px 7px;border-radius:6px;background:#eef4f6;color:#546f7b}
.mini-pill.p-h{background:#e4f5ec;color:#1b6241}
.mini-pill.p-i{background:#fff3da;color:#8a4f0a}
.mini-pill.p-s{background:#fde9ec;color:#982838}
.matrix-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}
.matrix-table th{font-size:10.5px;color:#577684;background:#eaf3f6;text-align:center;padding:10px 8px;font-weight:800;border-bottom:1px solid #d9e8ee}
.matrix-table th:nth-child(2),.matrix-table td:nth-child(2){text-align:left}
.matrix-table td{text-align:center;border-bottom:1px solid #e3edef;padding:9px 8px}
.matrix-table tr:last-child td{border-bottom:0}
.matrix-table tfoot td{background:#f3f9fb;font-weight:800;color:#204c5e;border-top:2px solid #d1e3ea}
.status-chip{display:inline-grid;place-items:center;min-width:26px;height:24px;border-radius:6px;font-size:11px;font-weight:800;background:#f0f5f7;color:#7a909b}
.status-chip.c-H{background:#e1f5ea;color:#165e3d}
.status-chip.c-I{background:#fff3da;color:#8a4f0a}
.status-chip.c-S{background:#fde9ec;color:#982838}
.absensi-backup{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid #ddebf0;font-size:11.5px;color:#627d89}
.absensi-backup>div{display:flex;gap:12px;flex-wrap:wrap}

/* Student Mini Avatars (Sidebar & Absensi) */
.student-mini-avatar{width:28px;height:28px;border-radius:8px;object-fit:cover;border:1px solid #cde0e8;background:#eef6f9;flex:none}
.att-student-wrap{display:flex;align-items:center;gap:10px}
.att-avatar{width:36px;height:36px;border-radius:10px}

/* Data Siswa Page */
.students-panel{background:#fafdfe;border:1px solid #d5e5eb;border-radius:14px;box-shadow:0 9px 32px #17496812;padding:28px;margin-top:18px}
.students-stats{margin-top:20px}
.students-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;margin:6px 0 20px}
.students-search{flex:1;min-width:240px;max-width:440px}
.students-search input{margin:0}
.students-filter-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.filter-select-label{display:inline-flex;align-items:center;gap:8px;font-size:11.5px;font-weight:700;color:#526c7b}
.filter-select-label select{background:white;border:1px solid #d3e2e8;border-radius:8px;padding:9px 12px;font-size:12.5px;outline:0}
.student-cards-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.student-card{background:white;border:1px solid #d8e7ed;border-radius:13px;padding:18px;display:flex;flex-direction:column;gap:14px;transition:border-color .15s,box-shadow .15s}
.student-card:hover{border-color:#a9cddc;box-shadow:0 10px 26px #144d6d14}
.student-card-head{display:flex;align-items:center;gap:14px}
.student-card-photo{width:76px;height:76px;border-radius:14px;border:1px dashed #b9d3de;background:#f0f7fa;color:#2e657a;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:0;overflow:hidden;flex:none;transition:border-color .15s,background .15s}
.student-card-photo:hover{border-color:#236b88;background:#e4f2f7}
.student-card-photo.has-image{border-style:solid;border-color:#cfe0e8;background:#eaf3f6}
.student-card-photo img{width:100%;height:100%;object-fit:cover;display:block}
.student-card-monogram{font:800 20px/1 Manrope,Arial,sans-serif;color:#236b88}
.student-photo-hint{font-size:9.5px;font-weight:700;color:#4f798c}
.student-card-title{min-width:0;flex:1}
.student-card-badges{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.student-order-pill{font-size:10px;font-weight:800;padding:2px 7px;border-radius:999px;background:#e8f2f6;color:#2d6478}
.gender-pill{font-size:10px;font-weight:700;padding:2px 8px;border-radius:999px;background:#f1f5f7;color:#627b87}
.gender-pill.is-L{background:#e4f1fb;color:#1e5b88}
.gender-pill.is-P{background:#fceef4;color:#8f325c}
.student-card-title h3{margin:0;font:800 15px/1.3 Manrope,Arial,sans-serif;color:#1b3847;word-break:break-word}
.student-card-sub{margin:4px 0 0;font-size:11.5px;color:#68808c;line-height:1.4}
.student-card-meta{margin:0;padding:12px 0;border-top:1px solid #edf4f7;border-bottom:1px solid #edf4f7;display:grid;gap:7px;font-size:11.5px;flex:1}
.student-card-meta>div{display:grid;grid-template-columns:112px minmax(0,1fr);gap:8px;align-items:baseline}
.student-card-meta dt{color:#6d8591;font-weight:700}
.student-card-meta dd{margin:0;color:#24414f;line-height:1.45;word-break:break-word}
.student-card-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.student-card-actions .button{flex:1;padding:8px 10px;font-size:12px;text-align:center}
.student-card-actions .button.danger-ghost{flex:0 0 auto}
.students-empty{grid-column:1/-1;background:white;border:1px solid #dce9ed;border-radius:12px;padding:34px 20px;text-align:center;color:#5a7481}
.students-empty strong{display:block;font:800 16px Manrope,Arial,sans-serif;color:#1f3f4f;margin-bottom:6px}
.students-empty p{margin:0;font-size:12.5px}

/* Student Profile Form Modal */
.student-form-modal{width:min(680px,calc(100vw - 28px))}
.photo-upload-row{display:flex;align-items:center;gap:16px;padding:14px;border:1px solid #dce9ed;border-radius:11px;background:#f5fafc;margin:14px 0 18px}
.photo-preview-box{width:88px;height:88px;border-radius:14px;border:1px solid #cde0e8;background:white;display:grid;place-items:center;overflow:hidden;flex:none}
.photo-preview-box img{width:100%;height:100%;object-fit:cover;display:block}
.photo-placeholder{font:800 16px Manrope,Arial,sans-serif;color:#588092}
.photo-upload-controls{display:flex;flex-direction:column;gap:5px;min-width:0}
.photo-upload-controls strong{font:800 13.5px Manrope,Arial,sans-serif;color:#1e4152}
.photo-upload-controls small{font-size:11px;color:#627c88;line-height:1.45}
.photo-btn-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:4px}
.photo-filename{font-size:11px;color:#2c667d;font-weight:600}
.student-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.student-form-grid label{display:block;font-size:11px;font-weight:700;color:#526c7b}
.student-form-grid label.span-2{grid-column:span 2}
.student-form-grid input,.student-form-grid select,.student-form-grid textarea{width:100%;background:#fbfdfe;border:1px solid #d3e2e8;border-radius:7px;padding:9px 11px;margin-top:5px;font-size:12.5px;outline:0}
.student-form-grid textarea{resize:vertical;line-height:1.45}
.photo-lightbox{width:min(540px,calc(100vw - 28px));padding:0;overflow:hidden}
.photo-lightbox-body{padding:18px;background:#f2f7f9;display:grid;place-items:center}
.photo-lightbox-body img{max-width:100%;max-height:70vh;border-radius:10px;object-fit:contain;box-shadow:0 12px 30px #123c5224}

/* Auth / LMS Login Portal */
.auth-body{min-height:100vh;display:grid;place-items:center;padding:24px}
.auth-shell{width:min(940px,100%)}
.auth-card{display:grid;grid-template-columns:1.05fr 1fr;background:#fafdfe;border:1px solid #d2e4eb;border-radius:18px;overflow:hidden;box-shadow:0 22px 60px #12486924}
.auth-banner{background:radial-gradient(circle at 86% 18%,rgba(145,212,224,.28),transparent 48%),linear-gradient(135deg,#0b4266 0%,#125277 56%,#1f6e8c 100%);color:white;padding:38px;display:flex;flex-direction:column;justify-content:space-between;gap:28px}
.auth-brand{display:flex;align-items:center;gap:14px}
.auth-logo{width:58px;height:58px;border-radius:14px;object-fit:cover;background:white;box-shadow:0 4px 14px #06253a30;flex:none}
.auth-brand .eyebrow{color:#b7dce7;margin-bottom:4px}
.auth-brand strong{display:block;font:800 17px/1.25 Manrope,Arial,sans-serif;letter-spacing:-.02em}
.auth-brand small{display:block;font-size:12px;color:#d6eaef;margin-top:4px}
.auth-intro h1{font:800 clamp(28px,3.2vw,38px)/1.1 Manrope,Arial,sans-serif;letter-spacing:-.04em;margin:0 0 12px}
.auth-intro h1 em{font-style:normal;color:#bce3df}
.auth-intro p{margin:0;font-size:13.5px;line-height:1.65;color:#e1eff3}
.auth-form-panel{padding:38px;background:white;display:flex;flex-direction:column;justify-content:center}
.auth-form-head h2{font:800 23px/1.2 Manrope,Arial,sans-serif;letter-spacing:-.03em;margin:0 0 6px;color:#1b3847}
.auth-form-head p{margin:0 0 22px;font-size:12.5px;color:#627c88;line-height:1.5}
.auth-alert{border-radius:9px;padding:11px 13px;font-size:12.5px;line-height:1.45;margin-bottom:16px;border:1px solid transparent}
.auth-alert.success{background:#eaf7ef;border-color:#bce2ca;color:#1d6042}
.auth-alert.error{background:#fdeef0;border-color:#eabbc2;color:#952636}
.auth-alert ul{margin:4px 0 0;padding-left:18px}
.auth-form{display:grid;gap:14px}
.auth-field{display:block}
.auth-field span{display:block;font-size:11.5px;font-weight:700;color:#4a6776;margin-bottom:6px}
.auth-field input{width:100%;background:#fbfdfe;border:1px solid #cde0e8;border-radius:9px;padding:11px 13px;font-size:13px;outline:0;transition:border-color .15s,background .15s}
.auth-field input:focus{background:white;border-color:#236b88}
.auth-remember{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:#55707d;cursor:pointer}
.auth-remember input{width:16px;height:16px;accent-color:#236b88}
.auth-submit{width:100%;padding:12px 16px;margin-top:4px}
.auth-footnote{margin-top:20px;padding-top:14px;border-top:1px solid #e7f0f3;font-size:11.5px;color:#6b838f;line-height:1.5}

.att-mobile-num{display:none}
.att-student-info{min-width:0;flex:1}
.scroll-hint{display:none;font-size:11px;color:#587886;margin:0 0 8px;font-weight:600}
.matrix-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.stat-card strong,.att-num,.student-number,.matrix-table td{font-variant-numeric:tabular-nums}
select{-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23436574' d='M2.2 4.2 6 8l3.8-3.8-.9-.9L6 6.2 3.1 3.3z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 11px center;background-size:12px 12px;padding-right:32px!important}

@media(hover:none){
  .button:hover,.day-tab:hover{transform:none}
}

@media(max-width:1120px){
  .student-cards-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:1024px){
  .workspace{grid-template-columns:236px minmax(0,1fr)}
  .main-panel,.absensi-panel,.students-panel{padding:20px}
  .identity-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .report-table{min-width:720px}
  .attendance-table{min-width:690px}
  .matrix-table{min-width:660px}
  .stats-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .export-card{flex-direction:column;align-items:stretch}
  .export-controls{align-items:stretch}
  .user-menu{border-left:0;padding-left:0}
}

@media(max-width:820px){
  .auth-card{grid-template-columns:1fr}
  .auth-banner,.auth-form-panel{padding:26px}
}

@media(max-width:768px){
  .app-shell{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}

  /* Prevent iOS Safari zoom on input focus */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,textarea{font-size:16px!important}

  /* Topbar: clean 3-row mobile stack */
  .topbar{flex-direction:column;align-items:stretch;gap:10px;padding:6px 0 16px}
  .brand{width:100%;min-width:0}
  .brand>div{min-width:0}
  .top-nav{order:2;width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px}
  .nav-link{justify-content:center;text-align:center;padding:8px 6px;min-height:44px;font-size:11.5px;line-height:1.2;flex-wrap:wrap;gap:4px}
  .top-actions{order:3;width:100%;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:#f4fafc;border:1px solid #d5e5eb;border-radius:11px}
  .top-actions .save-status{order:1;width:100%;text-align:left;font-size:11.5px;max-width:none}
  .top-actions>.button{order:2;flex:1 1 100%;min-height:42px;text-align:center}
  .user-menu{order:3;width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;border-left:0;padding-left:0;padding-top:8px;border-top:1px solid #d9e9ef}
  .user-chip{flex:1;min-width:0;min-height:42px}
  .user-meta{min-width:0;flex:1}
  .user-meta strong,.user-meta small{max-width:100%}
  .logout-btn{min-height:42px;padding:8px 14px;flex:none}

  /* Hero: auto height so text never clips */
  .hero{min-height:auto;padding:20px 18px;border-radius:14px;flex-direction:column;align-items:flex-start;gap:14px}
  .hero h1{font-size:clamp(24px,6.5vw,30px);margin-bottom:8px}
  .hero p:last-child{font-size:12.5px}
  .hero-count{display:flex;border-left:0;border-top:1px solid #ffffff38;padding:10px 0 0;width:100%;gap:10px;align-items:baseline}
  .hero-count strong{font-size:28px}
  .hero-count span{display:inline-flex;gap:5px;flex-wrap:wrap;font-size:12px}
  .hero-count span br{display:none}

  /* Sidebar & Student Picker */
  .workspace{display:block;margin-top:14px}
  .sidebar{position:static;margin-bottom:14px;padding:15px}
  .student-list{display:flex;overflow-x:auto;max-height:none;gap:8px;padding:2px 2px 8px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
  .student-item{flex:0 0 auto;width:auto;min-width:175px;max-width:235px;min-height:44px;border:1px solid #d5e5eb;background:white;scroll-snap-align:start;padding:8px 10px}
  .student-item.active{border-color:#286e88;background:#e2f0f5}
  .student-item .mini-status{display:inline-block;font-size:10.5px;font-weight:700}
  .side-note{margin-top:10px;padding:10px}
  .backup-actions{flex-direction:row;flex-wrap:wrap;gap:6px 14px;margin-top:8px}
  .text-button{min-height:36px;padding:6px 4px;font-size:12px}

  /* Panels, Headers & Toolbars */
  .main-panel,.absensi-panel,.students-panel{padding:15px;border-radius:12px}
  .panel-head{flex-direction:column;gap:12px}
  .panel-head h2{font-size:19px}
  .panel-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .panel-actions .button{min-height:42px;text-align:center}
  .panel-actions>:last-child:nth-child(odd){grid-column:1/-1}

  .period-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:end;margin:18px 0 16px}
  .period-toolbar label{grid-column:1/-1}
  .period-toolbar select{min-width:0;width:100%;min-height:44px}
  .period-toolbar .button{min-height:42px;text-align:center}

  .week-toolbar{flex-direction:column;align-items:stretch;gap:12px}
  .week-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%}
  .week-controls label:first-child{grid-column:1/-1}
  .week-controls select,.week-controls input[type="date"]{min-width:0;width:100%;min-height:44px}
  .week-controls .button{min-height:44px}
  .day-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
  .day-actions .button{min-height:42px;text-align:center}
  .day-tabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .day-tab{min-height:54px}
  .day-tab:last-child{grid-column:1/-1}

  .stats-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .stat-card{padding:12px 13px}
  .stat-card strong{font-size:22px}
  .form-card{padding:14px}
  .section-title{margin-bottom:14px;gap:10px}
  .identity-grid,.student-cards-grid,.student-form-grid{grid-template-columns:1fr}
  .student-form-grid label.span-2{grid-column:span 1}
  .photo-upload-row{flex-direction:column;align-items:start}

  /* Recap Alert & Export Card */
  .recap-alert{padding:14px;gap:12px}
  .recap-alert-actions,.recap-alert-actions .button{width:100%}
  .export-card{padding:16px;gap:14px}
  .export-controls{width:100%;align-items:stretch}
  .export-controls label{width:100%}
  .export-controls select{min-width:0;width:100%;min-height:44px}
  .export-controls>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;white-space:normal;width:100%}
  .export-controls>div .button{min-height:44px;text-align:center}
  .export-controls>div>:last-child:nth-child(odd){grid-column:1/-1}

  /* Assessment Table -> Mobile Stacked Cards (zero horizontal scroll) */
  #activitiesTable .table-wrap,#attendanceTable.table-wrap{overflow-x:visible}
  .report-table{min-width:0;width:100%;display:block;table-layout:auto}
  .report-table thead{display:none}
  .report-table tbody{display:grid;gap:12px}
  .report-table tr{display:block;background:#fbfdfe;border:1px solid #d5e5eb;border-radius:11px;padding:13px}
  .report-table td{display:block;width:100%!important;border:0;padding:0;margin-bottom:11px;font-size:13px}
  .report-table td:last-child{margin-bottom:0}
  .report-table td.col-day{margin-bottom:10px}
  .report-table td.col-day .col-day-text{display:none}
  .report-table td.col-day::before{content:attr(data-day);display:inline-block;padding:4px 10px;border-radius:999px;background:#e1eff5;color:#1e5970;font-size:11.5px;font-weight:800;letter-spacing:.02em}
  .report-table td[data-label]::before{content:attr(data-label);display:block;font-size:11.5px;font-weight:700;color:#526c7b;margin-bottom:5px}
  .report-table select,.report-table textarea{padding:10px;min-height:44px}
  .report-table textarea{min-height:68px}

  /* Absensi Daily Table -> Mobile 3-Column Card Grid (zero horizontal scroll) */
  .table-toolbar{flex-direction:column;align-items:stretch;gap:8px}
  .table-toolbar .search-wrap{max-width:none;min-width:0;width:100%}
  .table-toolbar .pill{align-self:flex-start}
  .attendance-table{min-width:0;width:100%;display:block}
  .attendance-table thead{display:none}
  .attendance-table tbody{display:grid;gap:10px}
  .attendance-table tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;background:#fbfdfe;border:1px solid #d5e5eb;border-radius:11px;padding:13px}
  .attendance-table tbody tr:hover{background:#fbfdfe}
  .attendance-table td{border:0;padding:0}
  .attendance-table td.att-num{display:none}
  .attendance-table td.att-student{grid-column:1/-1;margin-bottom:2px}
  .att-mobile-num{display:inline;color:#5a7b8a;font-weight:800}
  .attendance-table td.att-status-cell{grid-column:span 1}
  .attendance-table .att-btn{width:100%;min-width:0;min-height:44px;padding:8px 6px;font-size:12.5px}
  .attendance-table td.att-note-cell{grid-column:1/-1;margin-top:2px}
  .attendance-table .att-note{min-width:0;width:100%;min-height:42px}

  /* Weekly Matrix: sticky student name column + scroll hint */
  .scroll-hint{display:block}
  .matrix-scroll{border:1px solid #ddebf0;border-radius:9px}
  .matrix-table{min-width:620px}
  .matrix-table .sticky-col{position:sticky;left:0;background:white;z-index:1;box-shadow:2px 0 6px -2px #17496818;max-width:150px}
  .matrix-table thead .sticky-col{background:#eaf3f6;z-index:2}
  .matrix-table tfoot .sticky-col{background:#f3f9fb;z-index:2}

  /* Data Siswa Mobile */
  .students-toolbar{flex-direction:column;align-items:stretch;gap:10px}
  .students-search{max-width:none;min-width:0;width:100%}
  .students-filter-controls{width:100%;justify-content:space-between}
  .filter-select-label{flex:1}
  .filter-select-label select{flex:1;min-width:0;min-height:42px}
  .student-card{padding:15px}
  .student-card-photo{width:68px;height:68px;padding:4px}
  .student-card-monogram{font-size:18px}
  .student-photo-hint{font-size:8.5px;line-height:1.15;text-align:center}
  .student-card-meta>div{grid-template-columns:98px minmax(0,1fr)}
  .student-card-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .student-card-actions .button{min-height:42px}
  .student-card-actions .button.danger-ghost{grid-column:1/-1}

  /* Modals & Activity Editor */
  .modal,.period-modal{width:calc(100vw - 20px);max-height:90dvh;padding:18px}
  .preview-modal{width:calc(100vw - 12px);height:92dvh}
  .modal-head h2{font-size:18px}
  .modal-foot{flex-wrap:wrap}
  .modal-foot .button{flex:1 1 130px;min-height:44px;text-align:center}
  .editor-row{grid-template-columns:1fr auto;gap:10px}
  .editor-row label:nth-child(2),.editor-row label:nth-child(3){grid-column:1/-1}

  /* Auth / Login Mobile */
  .auth-body{min-height:100dvh;padding:max(14px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));align-content:start}
  .auth-card{border-radius:14px}
  .auth-banner{padding:20px 18px;gap:16px}
  .auth-logo{width:46px;height:46px}
  .auth-intro h1{font-size:24px;margin-bottom:8px}
  .auth-intro p{font-size:12.5px}
  .auth-form-panel{padding:22px 18px}
  .auth-form-head h2{font-size:20px}
  .auth-submit{min-height:46px}
}

@media(max-width:420px){
  .brand-logo{width:42px;height:42px;border-radius:10px}
  .brand strong{font-size:14px}
  .brand small{font-size:11px}
  .nav-link{font-size:11px;padding:8px 4px}
  .week-controls,.day-actions{grid-template-columns:1fr}
  .student-card-meta>div{grid-template-columns:1fr;gap:2px}
}

@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
