.ahs-attendance-form,.ahs-report-wrap{max-width:1100px;margin:20px auto;padding:22px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,.06);font-family:Arial,sans-serif}.ahs-form-grid,.ahs-report-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.ahs-form-grid label,.ahs-report-grid label{display:block;font-weight:700;margin-bottom:6px}.ahs-form-grid select,.ahs-form-grid input,.ahs-report-grid select,.ahs-report-grid input{width:100%;box-sizing:border-box;padding:10px;border:1px solid #cbd5e1;border-radius:7px;background:#fff}.ahs-logged-teacher{margin:14px 0;padding:10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:7px}.ahs-form-buttons{display:flex;gap:10px;margin:14px 0}.ahs-form-buttons button,#ahs-generate-report{border:0;border-radius:7px;padding:11px 18px;cursor:pointer;font-weight:700}.ahs-load-btn{background:#0b63ce;color:#fff}.ahs-save-btn,#ahs-generate-report{background:#087f5b;color:#fff}.ahs-form-buttons button:disabled{opacity:.6;cursor:not-allowed}.ahs-att-select-bar{display:flex;justify-content:space-between;gap:10px;padding:10px 12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:7px;margin-bottom:8px}.ahs-att-student-item{padding:8px 10px;margin:5px 0;border:1px solid #e5e7eb;border-radius:7px;background:#fafafa}.ahs-att-student-item label{display:flex;align-items:center;gap:7px;font-weight:400;margin:0}.ahs-roll{font-weight:700}.ahs-escape-tag{display:inline-block;margin-left:7px;padding:2px 7px;border-radius:999px;background:#fff3cd;color:#8a5a00;font-size:12px;font-weight:700}.ahs-report-heading{display:flex;justify-content:space-between;align-items:center;gap:15px}.ahs-report-heading h3{margin:0 0 5px}.ahs-print-btn{border:0;border-radius:7px;padding:10px 15px;cursor:pointer}.ahs-report-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:15px 0}.ahs-report-cards>div{padding:14px;border:1px solid #e5e7eb;border-radius:8px;text-align:center}.ahs-report-cards b{display:block;font-size:24px}.ahs-report-cards span{font-size:13px;color:#64748b}.ahs-report-table{width:100%;border-collapse:collapse;font-size:13px}.ahs-report-table th,.ahs-report-table td{border:1px solid #dbe2ea;padding:7px;vertical-align:top}.ahs-report-table th{background:#f1f5f9}.ahs-range-fields{grid-column:span 2;display:grid;grid-template-columns:1fr 1fr;gap:10px}.ahs-loading,.ahs-att-message{padding:12px}.ahs-login-needed{padding:15px;background:#fff3cd;border:1px solid #f1d48a;border-radius:7px}.ahs-print-page{font-family:Arial,sans-serif}.ahs-print-foot{margin-top:15px;font-size:11px}@media(max-width:800px){.ahs-form-grid,.ahs-report-grid{grid-template-columns:1fr 1fr}.ahs-report-cards{grid-template-columns:1fr 1fr}.ahs-att-select-bar{display:block}.ahs-report-table{font-size:11px}}@media print{.ahs-print-page{padding:10mm}.ahs-report-table{font-size:9px}.ahs-report-table th,.ahs-report-table td{padding:4px}.ahs-report-cards b{font-size:16px}}

/* v2.0.7 report spacing and print layout */
.ahs-report-button-row{padding:10px 0 20px}.ahs-report-button-row #ahs-generate-report{display:inline-block;margin:0}.ahs-print-page h1,.ahs-print-page h2{text-align:center;margin-left:auto;margin-right:auto}.ahs-print-page h1{margin-top:0;margin-bottom:8px}.ahs-print-page h2{margin-top:0;margin-bottom:18px}.ahs-print-page .ahs-report-cards{margin-top:10px}

/* v2.0.8 Bengali report layout */
.ahs-report-main-title{text-align:center!important;margin:0 0 24px!important;padding-bottom:14px;border-bottom:1px solid #e5e7eb}
.ahs-report-heading>div{flex:1;text-align:center}
.ahs-report-heading h3,.ahs-report-heading p{text-align:center}
.ahs-status-present{color:#198754;font-weight:700}
.ahs-status-absent{color:#dc3545;font-weight:700}
.ahs-status-escape{color:#dc3545;font-weight:800}
.ahs-report-table .ahs-status-present,.ahs-report-table .ahs-status-absent,.ahs-report-table .ahs-status-escape{text-align:center}
@media print{.ahs-print-page h1{text-align:center!important;margin:0 0 8px!important;padding-bottom:10px}.ahs-print-page h2{text-align:center!important;margin:0 0 18px!important;padding-bottom:10px;border-bottom:1px solid #ddd}.ahs-report-table .ahs-status-present{color:#198754!important}.ahs-report-table .ahs-status-absent,.ahs-report-table .ahs-status-escape{color:#dc3545!important}}

/* v2.0.9 class-teacher permanent delete */
.ahs-delete-btn{background:#c92a2a!important;color:#fff!important;border:0;border-radius:7px;padding:11px 18px;cursor:pointer;font-weight:700}.ahs-delete-btn:disabled{opacity:.6;cursor:not-allowed}

/* v3.0.0: guaranteed visible save/update feedback directly below the save button. */
.ahs-attendance-form .ahs-att-feedback{display:none!important;box-sizing:border-box;width:100%;min-height:0;margin:14px 0 0!important;padding:0!important;font-weight:700;line-height:1.5;position:relative;z-index:9999;clear:both;text-align:center;}
.ahs-attendance-form .ahs-att-feedback.ahs-feedback-success,.ahs-attendance-form .ahs-att-feedback.ahs-feedback-error{display:block!important;visibility:visible!important;opacity:1!important;min-height:24px;padding:12px 14px!important;margin:14px 0 8px!important;border-radius:7px;font-size:16px;}
.ahs-attendance-form .ahs-att-feedback.ahs-feedback-success{border:1px solid #b7e4c7;background:#ecfdf3;color:#198754!important;}
.ahs-attendance-form .ahs-att-feedback.ahs-feedback-error{border:1px solid #f1b0b7;background:#fff5f5;color:#c92a2a!important;}
/* v3.0.1: reliable visible delete feedback */
.ahs-attendance-form .ahs-delete-feedback{display:none!important;box-sizing:border-box;width:100%;min-height:0;margin:12px 0!important;padding:0!important;font-weight:700;line-height:1.5;position:relative;z-index:10000;clear:both;text-align:center}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-success,.ahs-attendance-form .ahs-delete-feedback.ahs-delete-error{display:block!important;visibility:visible!important;opacity:1!important;min-height:24px;padding:12px 14px!important;border-radius:7px;font-size:16px}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-success{border:1px solid #b7e4c7;background:#ecfdf3;color:#198754!important}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-error{border:1px solid #f1b0b7;background:#fff5f5;color:#c92a2a!important}
.ahs-attendance-form .ahs-delete-feedback{display:none!important;box-sizing:border-box;width:100%;margin:12px 0!important;padding:0!important;font-weight:700;line-height:1.5;position:relative;z-index:10000;clear:both;text-align:center}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-success,.ahs-attendance-form .ahs-delete-feedback.ahs-delete-error{display:block!important;visibility:visible!important;opacity:1!important;min-height:24px;padding:12px 14px!important;border-radius:7px;font-size:16px}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-success{border:1px solid #b7e4c7;background:#ecfdf3;color:#198754!important}.ahs-attendance-form .ahs-delete-feedback.ahs-delete-error{border:1px solid #f1b0b7;background:#fff5f5;color:#c92a2a!important}

/* v3.0.2: delete button is directly bound by JS; feedback remains theme-resistant. */
.ahs-attendance-form .ahs-delete-feedback{box-sizing:border-box!important;width:100%!important;clear:both!important;position:relative!important;z-index:10000!important;text-align:center!important;font-weight:700!important;line-height:1.5!important;margin:12px 0!important;}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-success,.ahs-attendance-form .ahs-delete-feedback.ahs-delete-error{display:block!important;visibility:visible!important;opacity:1!important;min-height:24px!important;padding:12px 14px!important;border-radius:7px!important;font-size:16px!important;}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-success{border:1px solid #b7e4c7!important;background:#ecfdf3!important;color:#198754!important;}
.ahs-attendance-form .ahs-delete-feedback.ahs-delete-error{border:1px solid #f1b0b7!important;background:#fff5f5!important;color:#c92a2a!important;}


/* v3.0.3: current attendance + previous 7-day read-only history */
.ahs-attendance-form .ahs-att-student-item{padding:8px 10px 9px;margin:5px 0;border:1px solid #e5e7eb;border-radius:7px;background:#fafafa}
.ahs-attendance-form .ahs-current-attendance{display:flex;align-items:center;gap:7px;font-weight:400;margin:0;min-height:26px;cursor:pointer}
.ahs-attendance-form .ahs-current-attendance input[type="checkbox"]{margin:0;flex:0 0 auto}
.ahs-att-history{display:flex;gap:5px;margin:6px 0 0 0px;padding:0;align-items:center}
.ahs-history-box{display:inline-flex;align-items:center;justify-content:center;width:25px;height:20px;min-width:25px;border:1px solid #d7dde5;border-radius:4px;background:#fff;font-size:12px;line-height:1;font-weight:800;box-sizing:border-box;user-select:none;pointer-events:none}
.ahs-history-present{color:#198754;background:#f3fff7}
.ahs-history-absent{color:transparent;background:#fff}
.ahs-history-escape{color:#fff;background:#dc3545;border-color:#dc3545}
/* v4.0.0: Friday / Saturday holiday markers in 7-day history strip */
.ahs-history-friday{color:red;background:#f3f4f6;border-color:#d1d5db;font-size:11px;letter-spacing:0}
.ahs-history-saturday{color:red;background:#f3f4f6;border-color:#d1d5db;font-size:11px;letter-spacing:0}
@media(max-width:800px){
  .ahs-attendance-form .ahs-form-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0}
  .ahs-attendance-form .ahs-form-buttons .ahs-load-btn,.ahs-attendance-form .ahs-form-buttons .ahs-save-btn{width:100%;padding:10px 8px;font-size:14px;line-height:1.25}
  .ahs-attendance-form .ahs-form-buttons .ahs-delete-btn{grid-column:1 / -1;width:100%;padding:10px 8px}
  .ahs-history-box{width:24px;height:20px;min-width:24px}
  .ahs-att-history{margin-left:0px;gap:4px}
}
@media(max-width:380px){
  .ahs-history-box{width:22px;height:19px;min-width:22px;font-size:11px}
  .ahs-att-history{margin-left:26px;gap:3px}
}

/* v3.0.4: whole-row tap/click toggles the checkbox; history strip stays non-interactive */
.ahs-attendance-form .ahs-att-student-item{position:relative;cursor:pointer}
.ahs-attendance-form .ahs-current-attendance{position:relative;z-index:0}
.ahs-attendance-form .ahs-current-attendance::after{content:'';position:absolute;top:-8px;left:-10px;right:-10px;bottom:0;z-index:1;cursor:pointer}
.ahs-attendance-form .ahs-current-attendance input[type="checkbox"]{position:relative;z-index:2}
.ahs-att-history{position:relative;z-index:2}

/* v3.0.5: sticky action bar — buttons stay visible at top while scrolling */
.ahs-attendance-form .ahs-form-buttons{position:sticky;top:0;z-index:999;background:#fff;margin-left:-22px;margin-right:-22px;padding:10px 22px;border-bottom:1px solid #e5e7eb;box-shadow:0 2px 8px rgba(0,0,0,.08)}
@media(max-width:800px){
  .ahs-attendance-form .ahs-form-buttons{margin-left:-16px;margin-right:-16px;padding:8px 16px}
}

/* v3.0.8: totals sync widget (year field removed — always current year) */
.ahs-sync-wrap{max-width:680px;margin:20px auto;padding:22px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,.06);font-family:Arial,sans-serif}
.ahs-sync-title{margin:0 0 18px;font-size:18px;font-weight:700;color:#1e293b}
.ahs-sync-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:16px}
.ahs-sync-grid label{display:block;font-weight:700;margin-bottom:6px;font-size:14px}
.ahs-sync-grid select{width:100%;box-sizing:border-box;padding:10px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;font-size:14px}
.ahs-sync-button-row{padding:4px 0 6px}
.ahs-sync-btn{background:#0b63ce;color:#fff;border:0;border-radius:7px;padding:11px 22px;cursor:pointer;font-weight:700;font-size:15px}
.ahs-sync-btn:disabled{opacity:.6;cursor:not-allowed}
.ahs-sync-feedback{display:none;margin-top:14px;padding:12px 16px;border-radius:7px;font-weight:700;font-size:15px;line-height:1.5}
.ahs-sync-success{display:block!important;background:#ecfdf3;border:1px solid #b7e4c7;color:#198754}
.ahs-sync-error{display:block!important;background:#fff5f5;border:1px solid #f1b0b7;color:#c92a2a}
@media(max-width:600px){
  .ahs-sync-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:360px){
  .ahs-sync-grid{grid-template-columns:1fr}
}

@media screen and (max-width: 782px) {
  .ahs-attendance-form {
    padding: 22px 5px!important;
  }
}