/* ============================================================
   ATTENDANCE — ADMIN WINDOW (see attendance-admin.js)
   ============================================================ */

#attAdminModal .aa-sheet{max-width:980px}
@media (min-width:900px){#attAdminModal .aa-sheet{height:90vh;max-height:90vh}}
@media (max-width:899px){
  #attAdminModal{padding:10px}
  #attAdminModal .aa-sheet{width:100%;max-width:none;height:calc(100% - 16px);max-height:none}
}
#attAdminModal .aa-sheet{display:flex;flex-direction:column;overflow:hidden}
#attAdminModal .aa-body{flex:1;min-height:0;overflow-y:auto;padding:14px 14px 30px;background:#f5f7fc}

/* tabs */
.aa-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0 12px 10px;background:#eef1f7;border-radius:14px;padding:5px;flex:0 0 auto}
.aa-tab{border:0;background:transparent;border-radius:10px;padding:10px 4px;font:inherit;font-size:13.5px;font-weight:800;color:#5f6b82;cursor:pointer;touch-action:manipulation}
.aa-tab.active{background:#fff;color:#05143F;box-shadow:0 2px 8px rgba(5,20,63,.1)}

/* filters */
.aa-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px}
.aa-bar select,.aa-limit input{border:1.5px solid #e6ebf5;border-radius:11px;padding:9px 10px;font:inherit;font-size:13.5px;font-weight:600;color:#0d1b3e;background:#fff}
.aa-seg{display:inline-flex;background:#fff;border:1.5px solid #e6ebf5;border-radius:12px;padding:3px;gap:3px}
.aa-seg button{border:0;background:transparent;border-radius:9px;padding:7px 11px;font:inherit;font-size:13px;font-weight:800;color:#5f6b82;cursor:pointer}
.aa-seg button.on{background:linear-gradient(145deg,#05143F,#0d2a72);color:#fff}
.aa-limit{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:#5f6b82}
.aa-limit input{width:64px}
.aa-btn-light{border:1.5px solid #bfeedd;background:#e6f8f1;color:#1f9c72;border-radius:11px;padding:9px 14px;font:inherit;font-size:13px;font-weight:800;cursor:pointer}
.aa-btn-light:disabled{opacity:.5;cursor:default}
.aa-note{margin:0 2px 12px;color:#5f6b82;font-size:13px;line-height:1.55}
.aa-note b{color:#05143F}
.aa-red,.aa-note .aa-red{color:#e5252a}
.aa-h{margin:18px 2px 8px;font:800 14.5px 'Plus Jakarta Sans',Inter,sans-serif;color:#05143F}

/* tables */
.aa-table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1.5px solid #e6ebf5;border-radius:16px;overflow:hidden;font-size:13.5px}
.aa-table th{background:#0a1d54;color:#34CC99;font-size:11px;font-weight:800;letter-spacing:1px;text-transform:uppercase;padding:10px 8px;text-align:left}
.aa-table td{padding:9px 8px;border-top:1px solid #eef1f7;color:#05143F;vertical-align:middle}
.aa-table th:first-child,.aa-table td:first-child{padding-left:14px}
.aa-table tr.is-over td{background:#fdecec}
.aa-table tr.is-over td:first-child{box-shadow:inset 4px 0 0 #e5252a}
.aa-st{border:1.5px solid #e6ebf5;border-radius:10px;padding:7px 8px;font:inherit;font-size:13px;font-weight:800}
.aa-st.is-open{background:#e6f8f1;color:#1f9c72;border-color:#bfeedd}
.aa-st.is-locked{background:#eceff4;color:#5f6b82}
.aa-st.is-excluded{background:#fff3e2;color:#b3640a;border-color:#f5c98a}

/* forms (teachers, weeks) */
.aa-form{background:#fff;border:1.5px solid #e6ebf5;border-radius:16px;padding:14px;margin-bottom:10px}
.aa-form.is-off{opacity:.6}
.aa-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.aa-grid label{display:flex;flex-direction:column;gap:5px;font-size:11.5px;font-weight:800;color:#7b89a8;letter-spacing:.3px}
.aa-grid input,.aa-grid select{border:1.5px solid #e6ebf5;border-radius:11px;padding:10px 11px;font:inherit;font-size:14px;font-weight:600;color:#0d1b3e;background:#fbfcfe;min-width:0}
.aa-grid input:focus{outline:none;border-color:#34CC99;background:#fff}
.aa-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
.aa-check{display:inline-flex;align-items:center;gap:7px;font-size:13.5px;font-weight:700;color:#05143F}
.aa-check input{width:18px;height:18px;accent-color:#1f9c72}

/* one sheet */
.aa-back{display:inline-flex;align-items:center;gap:6px;border:0;background:none;color:#05143F;font:inherit;font-size:13.5px;font-weight:800;cursor:pointer;padding:4px 2px 12px}
.aa-back .nbs-arrow{width:15px;height:15px}
.aa-actions .att-del{margin:0}
.aa-hist{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.aa-hist li{background:#fff;border:1.5px solid #e6ebf5;border-radius:12px;padding:9px 12px;font-size:13px;color:#5f6b82}
.aa-hist li b{color:#05143F}
.aa-hist small{display:block;color:#9aa6bd;font-size:11.5px;margin-top:2px}

/* Schedule Info and the Attendance panel share one row (admins only) */
.sched-split{display:flex;flex:1;gap:8px;min-width:0}
.sched-split > .btn-green{flex:1 1 0;min-width:0}
.att-panel-btn{display:none !important}
html.is-admin .att-panel-btn{display:inline-flex !important;background:linear-gradient(145deg,#c9d0dc 0%,#8e98ad 100%) !important;color:#05143F !important;box-shadow:0 1px 0 rgba(255,255,255,.6) inset,0 8px 20px rgba(90,100,121,.3) !important}
.att-panel-btn .icon-3d svg{width:16px;height:16px}
@media (max-width:420px){.sched-split > .btn-green{font-size:13.5px;padding-left:10px;padding-right:10px;gap:6px}}

#attAdminModal .aa-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
.aa-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.aa-top .aa-note{margin:0;flex:1 1 220px}
.aa-muted{color:#9aa6bd;font-size:12.5px;font-weight:600}

/* teachers */
.aa-tlist{display:grid;gap:10px}
.aa-tcard{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border:1.5px solid #e6ebf5;border-radius:16px;padding:14px 16px}
.aa-tcard.is-off{opacity:.6}
.aa-tmain{min-width:0;display:flex;flex-direction:column;gap:3px}
.aa-tmain b{font:800 16px 'Plus Jakarta Sans',Inter,sans-serif;color:#05143F}
.aa-tmain small{color:#7b89a8;font-size:12.5px;font-weight:600;word-break:break-all}
.aa-tside{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex:0 0 auto}
.aa-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.aa-chip{background:#eef2fa;color:#05143F;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:800}
.aa-chip.is-subject{background:#e6f8f1;color:#1f9c72}
.aa-class{display:flex;align-items:center;gap:10px;background:#fff;border:1.5px solid #e6ebf5;border-radius:14px;padding:10px;margin-bottom:8px}
.aa-class select{flex:0 0 auto;border:1.5px solid #e6ebf5;border-radius:10px;padding:9px 8px;font:inherit;font-size:13.5px;font-weight:800;color:#05143F;background:#fbfcfe}
.aa-kind{display:flex;gap:4px;background:#eef2f9;border-radius:12px;padding:3px}
.aa-kind button{border:0;background:transparent;color:#5f6b82;border-radius:9px;padding:7px 10px;font:inherit;font-size:12.5px;font-weight:800;cursor:pointer;white-space:nowrap}
.aa-kind button.on{background:#fff;color:#05143F;box-shadow:0 1px 4px rgba(5,20,63,.15)}
.aa-gpick{flex:1;display:flex;flex-wrap:wrap;gap:6px}
.aa-gpick button{border:1.5px solid #e6ebf5;background:#fbfcfe;color:#5f6b82;border-radius:10px;padding:8px 11px;font:inherit;font-size:13px;font-weight:800;cursor:pointer;touch-action:manipulation}
.aa-gpick button.on{background:linear-gradient(145deg,#05143F,#0d2a72);border-color:#05143F;color:#fff}
.aa-x{flex:0 0 32px;height:32px;border-radius:10px;border:0;background:#fdecec;color:#c0392b;font-size:20px;font-weight:700;cursor:pointer;line-height:1}

/* weeks */
.aa-weeks{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px}
.aa-week{display:flex;flex-direction:column;gap:4px;border:1.5px solid;border-radius:14px;padding:10px}
.aa-week b{font:800 14px 'Plus Jakarta Sans',Inter,sans-serif}
.aa-week small{font-size:11.5px;font-weight:600;opacity:.8}
.aa-week select{margin-top:4px;border:1.5px solid rgba(5,20,63,.12);border-radius:9px;padding:6px;font:inherit;font-size:12.5px;font-weight:800;background:#fff;color:#05143F}
.aa-week.is-open{background:#e6f8f1;border-color:#bfeedd;color:#1f9c72}
.aa-week.is-locked{background:#eceff4;border-color:#d5dbe6;color:#5f6b82}
.aa-week.is-excluded{background:#fff3e2;border-color:#f5c98a;color:#b3640a}
.aa-week.is-now{box-shadow:0 0 0 3px rgba(0,211,151,.3)}
.aa-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:16px}
.aa-stats th,.aa-stats td{text-align:center;white-space:nowrap}
.aa-stats th:first-child,.aa-stats td:first-child{text-align:left;position:sticky;left:0;background:inherit;z-index:1}
.aa-stats td:first-child{background:#fff}
.aa-n{min-width:34px;border:0;border-radius:9px;padding:6px 8px;font:inherit;font-size:13px;font-weight:800;background:#e6f8f1;color:#1f9c72;cursor:pointer}
.aa-n.is-out{background:#fff3e2;color:#b3640a}
.aa-n0{color:#c3cad8;font-weight:800}
.aa-n0.is-miss{color:#e5252a}

/* students */
.aa-frac{display:inline-block;min-width:52px;text-align:center;border-radius:999px;padding:4px 10px;font-weight:800;font-size:13px}
.aa-frac.is-zero{background:#e6f8f1;color:#1f9c72}
.aa-frac.is-some{background:#fff3e2;color:#b3640a}
.aa-frac.is-high{background:#e5252a;color:#fff}
.aa-key{display:inline-flex;align-items:center;gap:6px;margin-left:8px;font-size:12px;font-weight:700}
.aa-key i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-left:4px}
.aa-key i.is-zero{background:#1f9c72}.aa-key i.is-some{background:#f0a14a}.aa-key i.is-high{background:#e5252a}
.aa-xls{background:#e7f4ec;border-color:#9fd6b4;color:#1d6f42}

/* the title above a group of weeks: written by the admin, shown to the teachers */
.aa-term{display:flex;align-items:center;gap:8px;margin:18px 2px 8px}
.aa-term-in{flex:1;min-width:0;border:1.5px dashed transparent;border-radius:10px;background:transparent;padding:6px 8px;font:800 15px 'Plus Jakarta Sans',Inter,sans-serif;color:#05143F}
.aa-term-in:hover,.aa-term-in:focus{border-color:#bfeedd;background:#fff;outline:none}
.aa-term-pen{color:#9aa6bd;font-size:14px}
/* the annual calendar, to tick the attendance weeks */
.aa-note select{border:1.5px solid #e6ebf5;border-radius:9px;padding:5px 6px;font:inherit;font-size:12.5px;font-weight:700;color:#05143F;background:#fff;max-width:100%}
.aa-cal{display:grid;gap:6px}
.aa-calrow{display:grid;grid-template-columns:auto 72px 96px 1fr auto;align-items:center;gap:10px;background:#fff;border:1.5px solid #e6ebf5;border-radius:12px;padding:9px 12px;cursor:pointer;font-size:13px}
.aa-calrow input{width:18px;height:18px;accent-color:#1f9c72;margin:0}
.aa-calrow b{color:#05143F;font-weight:800}
.aa-calrow small{color:#7b89a8;font-weight:600}
.aa-calrow span{color:#5f6b82;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.aa-calrow em{font-style:normal;background:#e6f8f1;color:#1f9c72;border-radius:999px;padding:3px 9px;font-size:11px;font-weight:800;white-space:nowrap}
.aa-calrow.on{border-color:#bfeedd;background:#f4fcf8}
.aa-calrow.is-now{box-shadow:inset 4px 0 0 #e5252a}
@media (max-width:560px){.aa-calrow{grid-template-columns:auto 64px 1fr;row-gap:2px}.aa-calrow span{grid-column:2/-1}.aa-calrow em{grid-column:2/-1;justify-self:start}}

/* The panel as a page: the card takes the page's width and grows with its content (the page scrolls) */
#screen-attpanel{padding-top:calc(env(safe-area-inset-top,0px) + 14px);padding-bottom:130px}
#screen-attpanel.sheet-in{animation:booksPop .42s cubic-bezier(.2,.9,.3,1) both;transform-origin:50% 30vh}
#attPanelPage .aa-sheet{max-width:none !important;width:100%;height:auto !important;max-height:none !important;overflow:visible !important;margin:0;padding:0;
  border-radius:22px;box-shadow:0 10px 30px rgba(5,20,63,.08);animation:none !important;transform:none;opacity:1;background:#f5f7fc}
#attPanelPage .aa-sheet > .nbs-head{margin:0 0 12px}
#attPanelPage .aa-tabs{margin:0 0 12px}
#attPanelPage .aa-body{overflow:visible !important;padding:4px 16px 20px;min-height:0;background:transparent}
#attPanelPage .aa-tabs{margin:0 16px 12px}
@media (max-width:600px){#attPanelPage .aa-body{padding:4px 10px 16px}#attPanelPage .aa-tabs{margin:0 10px 10px}}
@media (prefers-reduced-motion:reduce){#screen-attpanel.sheet-in{animation:none}}
/* English group editor: the period of a row can be changed (P2 → P3), its classes move with it */
.ge-pmove{border:1.5px solid #d9e3f5;border-radius:9px;padding:5px 4px;font:inherit;font-size:13px;font-weight:800;color:#05143F;background:#fff;cursor:pointer}

.ge-ptime{display:block;margin-top:4px;font-size:10.5px;font-weight:700;color:#6b7891;white-space:nowrap}
.ge-slots button{display:inline-flex;flex-direction:column;align-items:center;gap:2px;line-height:1.1}
.ge-slots button small{font-size:10.5px;font-weight:600;opacity:.8}
/* Announcement: the e-mail of each year, and the ✉ button beside Publish */
.announce-mails{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin:12px 0 4px}
.announce-mail{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:800;color:#5f6b82}
.announce-mail input{border:1.5px solid #d9e1ef;border-radius:12px;padding:10px 12px;font:inherit;font-size:13.5px;font-weight:600;color:#05143F;background:#fff}
/* Publish with its Email / Download PDF / End buttons on one line */
.act-row{display:flex !important;flex-wrap:wrap;gap:10px;align-items:stretch}
.act-row > button{flex:1 1 0;width:auto !important;margin:0 !important;min-width:140px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.act-row > button:first-child{flex:3 1 0}
.act-row > button.hidden{display:none !important}
.announce-mail-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.announce-mail-btn svg{flex:0 0 auto}
.announce-mail input::placeholder{color:#b3bccb;font-weight:500}
/* Mandatory > One student: the e-mail and the students who already have their own */
.person-pick{margin-top:12px;display:grid;gap:10px}
.person-pick.hidden{display:none}
.person-pick input{width:100%;box-sizing:border-box;border:1.5px solid #d9e1ef;border-radius:12px;padding:11px 14px;font:inherit;font-size:14px;background:#fff;color:#05143F}
.person-list{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.person-list small{color:#7b89a8;font-weight:700;font-size:12px;margin-right:4px}
.person-chip{border:1.5px solid #d9e1ef;background:#fff;border-radius:999px;padding:5px 12px;font:inherit;font-size:12.5px;font-weight:700;color:#05143F;cursor:pointer}
.person-chip.on{background:#05143F;border-color:#05143F;color:#fff}
.forced-own-title{color:#e5554a}
.year-periods{grid-column:1/-1}
.yp-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.yp-head h4{margin:0}
.yp-add{width:auto !important;margin:0 !important;padding:10px 16px !important}
.year-periods .pe-list{display:grid !important;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.year-periods .pe-del{margin-left:auto}
#addRowBtn.yp-add{display:inline-flex !important;align-items:center}
#addRowBtn:disabled{opacity:.45;cursor:not-allowed}

/* Reset the absences (Attendance panel > Students) */
.aa-danger{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:22px;background:#fff;border:1.5px solid #f5c2c2;border-radius:16px;padding:14px 16px}
.aa-danger b{display:block;color:#c0392b;font-size:14.5px;font-weight:800}
.aa-danger small{display:block;color:#7b89a8;font-size:12.5px;font-weight:600;margin-top:3px;line-height:1.45}
.aa-danger-btn{flex:0 0 auto;border:0;border-radius:12px;padding:11px 16px;font:inherit;font-size:13.5px;font-weight:800;color:#fff;background:linear-gradient(145deg,#e5252a,#b3141a);cursor:pointer;box-shadow:0 8px 18px rgba(229,37,42,.25)}
.aa-danger-btn:disabled{opacity:.6}

/* Password asked by every reset */
.pw-sheet{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(5,20,63,.55);animation:pwIn .2s ease-out both}
@keyframes pwIn{from{opacity:0}to{opacity:1}}
.pw-box{width:100%;max-width:380px;background:#fff;border-radius:22px;padding:22px;box-shadow:0 24px 60px rgba(5,20,63,.35);text-align:center;animation:pwRise .28s cubic-bezier(.22,1,.36,1) both}
@keyframes pwRise{from{opacity:0;transform:translate3d(0,14px,0)}to{opacity:1;transform:none}}
.pw-ico{width:48px;height:48px;margin:0 auto 10px;border-radius:14px;background:#fdecec;color:#e5252a;display:flex;align-items:center;justify-content:center}
.pw-ico svg{width:24px;height:24px}
.pw-box h3{margin:0 0 6px;font:800 17px 'Plus Jakarta Sans',Inter,sans-serif;color:#05143F}
.pw-box p{margin:0 0 14px;color:#7b89a8;font-size:13px;font-weight:600;line-height:1.5}
.pw-box input{width:100%;box-sizing:border-box;border:1.5px solid #e6ebf5;border-radius:12px;padding:12px 14px;font:inherit;font-size:15px;letter-spacing:2px;background:#fbfcfe;color:#05143F}
.pw-box input:focus{outline:none;border-color:#e5252a;background:#fff}
.pw-actions{display:flex;gap:8px;margin-top:14px}
.pw-actions button{flex:1;border-radius:12px;padding:12px;font:inherit;font-size:14px;font-weight:800;cursor:pointer;border:0}
.pw-cancel{background:#eef1f7;color:#5f6b82}
.pw-ok{background:linear-gradient(145deg,#e5252a,#b3141a);color:#fff}
/* "+ Add P7" tile at the end of the year's periods */
.year-periods .pe-addtile{border:2px dashed #b9c4dc;background:#f7f9fd;color:#05143F;border-radius:16px;min-height:56px;font:inherit;font-weight:800;font-size:14px;cursor:pointer}
.year-periods .pe-addtile:hover{border-color:#E74C3C;color:#E74C3C}
/* Teacher editor: subject of each class; Students: one column per subject */
.aa-subj{border:1.5px solid #e6ebf5;background:#fbfcfe;color:#05143F;border-radius:10px;padding:8px 10px;font:inherit;font-size:13px;font-weight:700;max-width:220px}
.aa-subj-table th:nth-child(n+3){max-width:130px;white-space:normal;line-height:1.2;font-size:11.5px;text-align:center}
.aa-subj-table td:nth-child(n+3){text-align:center}
/* Attendance panel on a computer: the page uses the full width of the site, and ID / name / group stay on one line */
@media (min-width:900px){
  #section-student .container:has(#screen-attpanel.active){max-width:none;padding-left:clamp(22px,3vw,56px);padding-right:clamp(22px,3vw,56px)}
}
.aa-subj-table td:nth-child(-n+2),.aa-subj-table th:nth-child(-n+2){white-space:nowrap}
.aa-subj-table .att-id{font-variant-numeric:tabular-nums}
/* Remove-a-class ×: two equal bars, centred */
.aa-x{position:relative;font-size:0 !important;padding:0}
.aa-x::before,.aa-x::after{content:"";position:absolute;left:50%;top:50%;width:13px;height:2.4px;border-radius:2px;background:currentColor;transform:translate(-50%,-50%) rotate(45deg)}
.aa-x::after{transform:translate(-50%,-50%) rotate(-45deg)}
/* Teachers: Allowed books (beside Add a teacher) */
.aa-top-btns{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.aa-books-year{margin:10px 0 14px;padding:12px 14px;border-radius:14px;background:#f7f9fd;border:1px solid rgba(5,20,63,.08)}
.aa-books-year > b{display:block;margin-bottom:6px;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:rgba(5,20,63,.6)}
.aa-books-row{display:flex;align-items:center;gap:10px;padding:7px 0;border-top:1px solid rgba(5,20,63,.06)}
.aa-books-row:first-of-type{border-top:0}
.aa-books-row span{flex:1;font-weight:700}
.aa-term-sem{color:#5f6b82;font:800 15px 'Plus Jakarta Sans',Inter,sans-serif;white-space:nowrap}
.aa-term-in{flex:0 0 auto;width:11.5ch;padding-right:2px}
.aa-offcal{font-style:normal;font-size:10px;font-weight:800;color:#b4232a;background:#fde8e9;border-radius:999px;padding:2px 7px;justify-self:start}
.aa-calrow.is-other{opacity:.45;cursor:default}
.aa-calrow.is-other em{background:#eef2fa;color:#5f6b82}
.aa-semchip{display:inline-flex;align-items:center;padding:8px 13px;border-radius:12px;background:linear-gradient(145deg,#05143F,#0d2a72);color:#fff;font-size:13px;font-weight:800}
.aa-fadein{animation:aaFade .32s cubic-bezier(.22,1,.36,1) both;transition:opacity .18s,transform .18s}
.aa-fadein.is-out{opacity:0;transform:translateY(4px)}
@keyframes aaFade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.aa-fadein{animation:none;transition:none}}
