/* SEGaza V3.5 — Student Focus Mode (mobile-first) */
@media(max-width:760px){
  /* The page header already says الطلبة. Keep only compact controls here. */
  #view-students .section-head{
    position:sticky!important;top:62px!important;z-index:58!important;
    min-height:42px!important;height:42px!important;padding:3px 6px!important;margin:0 0 4px!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    background:rgba(247,250,253,.96)!important;backdrop-filter:blur(10px)!important;
    display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;
  }
  #view-students .section-head>div:first-child{display:none!important}
  #view-students .student-mobile-more,#view-students .student-filter-toggle{
    min-height:34px!important;height:34px!important;padding:4px 10px!important;border-radius:10px!important;
    font-size:11.5px!important;line-height:1!important;margin:0!important;box-shadow:none!important
  }
  #view-students .section-head>.actions{
    top:44px!important;left:6px!important;right:6px!important;padding:7px!important;border-radius:12px!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important
  }

  /* Compact pending-completion notice. Tap to expand details. */
  #view-students #completionPendingBanner:not([hidden]){
    display:block!important;margin:0 0 4px!important;padding:7px 11px!important;min-height:36px!important;
    max-height:36px!important;overflow:hidden!important;border-radius:11px!important;cursor:pointer!important;
    transition:max-height .18s ease,padding .18s ease!important
  }
  #view-students #completionPendingBanner.ux-focus-expanded{
    max-height:180px!important;padding:11px!important
  }
  #view-students #completionPendingBanner:not(.ux-focus-expanded)::after{
    content:'  • اضغط للتفاصيل';font-size:10px;color:#8b6f32;font-weight:700
  }

  /* Filters remain completely optional. */
  #view-students .student-filters{margin:0 0 4px!important;padding:7px!important}

  /* Selection becomes a tiny fixed command bar. It never steals list height. */
  #view-students #studentBulkBar{
    position:fixed!important;left:8px!important;right:8px!important;bottom:76px!important;top:auto!important;z-index:110!important;
    min-height:48px!important;margin:0!important;padding:6px 8px!important;border-radius:14px!important;
    background:rgba(255,255,255,.98)!important;border:1px solid #d9e4ee!important;
    box-shadow:0 14px 40px rgba(15,45,73,.24)!important;backdrop-filter:blur(14px)!important;
    display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:7px!important
  }
  #view-students #studentBulkBar.ux-no-selection{display:none!important}
  #view-students #studentBulkBar>div:first-child{font-size:12px!important;white-space:nowrap!important;display:flex!important;align-items:center!important;gap:4px!important}
  #view-students #studentBulkBar .ux-student-selection-actions{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:34px!important;
    padding:5px 11px!important;border:0!important;border-radius:10px!important;background:#0e5d83!important;color:#fff!important;
    font-size:11.5px!important;font-weight:900!important
  }
  #view-students #studentBulkBar .bulk-actions-wrap{
    display:none!important;position:fixed!important;left:8px!important;right:8px!important;bottom:130px!important;z-index:111!important;
    padding:9px!important;border-radius:16px!important;background:#fff!important;border:1px solid #dbe5ee!important;
    box-shadow:0 18px 48px rgba(15,45,73,.28)!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;
    max-height:46dvh!important;overflow:auto!important
  }
  #view-students #studentBulkBar.ux-bulk-actions-open .bulk-actions-wrap{display:grid!important}
  #view-students #studentBulkBar .bulk-actions-wrap .btn{width:100%!important;min-height:40px!important;font-size:11.5px!important;padding:7px!important;margin:0!important}

  /* The student list gets almost the whole usable screen. */
  #view-students .table-card{margin-top:2px!important;border-radius:12px!important}
  #view-students .table-scroll{
    max-height:calc(100dvh - 164px)!important;min-height:56dvh!important;
    overflow:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important
  }
  #view-students .ux-responsive-table{min-width:900px!important;width:900px!important}
  #view-students .ux-responsive-table td,#view-students .ux-responsive-table th{padding:6px 7px!important;font-size:12px!important}

  /* Only checkbox + student name are frozen. Everything else moves horizontally. */
  #view-students #studentsTable tr>td:nth-child(1),#view-students table thead th:nth-child(1){
    position:sticky!important;right:0!important;left:auto!important;width:42px!important;min-width:42px!important;max-width:42px!important;
    background:#fff!important;z-index:41!important;border-left:1px solid #e2e8f0!important;text-align:center!important
  }
  #view-students table thead th:nth-child(1){top:0!important;background:#edf3f8!important;z-index:64!important}
  #view-students #studentsTable tr>td:nth-child(2),#view-students table thead th:nth-child(2){
    position:sticky!important;right:42px!important;left:auto!important;width:198px!important;min-width:198px!important;max-width:198px!important;
    background:#fff!important;z-index:40!important;border-left:1px solid #e2e8f0!important
  }
  #view-students table thead th:nth-child(2){top:0!important;background:#edf3f8!important;z-index:63!important}
  #view-students #studentsTable tr:nth-child(even)>td:nth-child(1),#view-students #studentsTable tr:nth-child(even)>td:nth-child(2){background:#f8fafc!important}
  #view-students #studentsTable tr>td:nth-child(n+3){position:relative!important;right:auto!important;left:auto!important;max-width:none!important;background:inherit!important}
  #view-students table thead th:nth-child(n+3){position:sticky!important;right:auto!important;left:auto!important;top:0!important;background:#f4f7fb!important;z-index:20!important}

  #view-students .student-primary-cell{padding-top:6px!important;padding-bottom:6px!important;white-space:normal!important}
  #view-students .student-primary-cell .student-name-with-signals{display:flex!important;align-items:flex-start!important;gap:4px!important;white-space:normal!important}
  #view-students .student-primary-cell b{
    display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;
    white-space:normal!important;max-width:162px!important;font-size:13.5px!important;line-height:1.32!important;color:#153b58!important
  }
  #view-students .student-row-meta{margin-top:3px!important;min-height:17px!important;white-space:normal!important}
  #view-students .student-primary-cell .initiative-pill{max-width:162px!important;font-size:9px!important;padding:2px 6px!important}
  #view-students #studentsTable tr>td:nth-child(3){min-width:78px!important;text-align:center!important}
  #view-students #studentsTable tr>td:nth-child(4){min-width:108px!important}
  #view-students #studentsTable tr>td:nth-child(5){min-width:116px!important}
  #view-students #studentsTable tr>td:nth-child(6){min-width:102px!important}
  #view-students #studentsTable tr>td:nth-child(7){min-width:100px!important}
  #view-students #studentsTable tr>td:nth-child(8){min-width:84px!important}
  #view-students #studentsTable tr>td:nth-child(9){min-width:122px!important}
  #view-students:after{content:'اسم الطالب ثابت — اسحب لباقي التفاصيل'!important;font-size:10px!important;color:#7c8996!important;padding:3px 2px 0!important}
}
