/* SEGaza V3.0.9 — compact operations UX + granular permissions */
.permission-groups-v309{display:grid;gap:12px;margin-top:14px}
.perm-group-v309{border:1px solid #dfe6ef;border-radius:14px;padding:12px;background:#fbfdff}
.perm-group-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
.perm-group-head b{font-size:14px;color:#173653}.perm-group-head .mini{min-height:32px!important;padding:5px 9px!important;font-size:11px!important}
.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px!important}
.permission-check{display:flex!important;align-items:center!important;gap:7px!important;padding:8px 9px!important;border:1px solid #e5ebf2!important;border-radius:10px!important;background:#fff!important;font-size:12.5px!important;font-weight:700!important}
.permission-check input{width:18px!important;height:18px!important;min-height:0!important;flex:0 0 18px!important}

/* Student list is intentionally a compact horizontally scrollable table on phones.
   Users can scan names, select all, and slide sideways to actions/details. */
@media(max-width:760px){
  #view-students .table-card{display:block!important;overflow:hidden!important;border:1px solid #dfe6ef!important;border-radius:14px!important;background:#fff!important;box-shadow:0 5px 16px rgba(21,52,84,.05)!important}
  #view-students .table-scroll{display:block!important;overflow-x:auto!important;overflow-y:auto!important;max-height:calc(100dvh - 265px)!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-inline:contain!important;background:#fff!important}
  #view-students .ux-responsive-table{display:table!important;min-width:1080px!important;width:1080px!important;border-collapse:separate!important;border-spacing:0!important;table-layout:auto!important}
  #view-students .ux-responsive-table thead{display:table-header-group!important;position:sticky!important;top:0!important;z-index:12!important}
  #view-students .ux-responsive-table tbody{display:table-row-group!important;padding:0!important}
  #view-students .ux-responsive-table tr{display:table-row!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important}
  #view-students .ux-responsive-table tr:nth-child(even) td{background:#fbfcfe!important}
  #view-students .ux-responsive-table td,#view-students .ux-responsive-table th{display:table-cell!important;position:relative!important;padding:8px 9px!important;border:0!important;border-bottom:1px solid #edf1f6!important;white-space:nowrap!important;font-size:13px!important;line-height:1.4!important;vertical-align:middle!important;min-height:0!important;text-align:right!important;background:#fff!important}
  #view-students .ux-responsive-table th{font-size:11px!important;background:#f4f7fb!important;color:#5d6e82!important;font-weight:900!important;z-index:13!important}
  #view-students .ux-responsive-table td:before{display:none!important;content:none!important}
  #view-students #studentsTable tr>td:nth-child(1){position:sticky!important;right:0!important;left:auto!important;top:auto!important;width:48px!important;min-width:48px!important;max-width:48px!important;padding:7px 10px!important;background:#fff!important;z-index:9!important;border-left:1px solid #e6ebf1!important}
  #view-students table thead th:nth-child(1){position:sticky!important;right:0!important;width:48px!important;min-width:48px!important;background:#eef3f8!important;z-index:20!important;border-left:1px solid #dfe6ef!important}
  #view-students #studentsTable tr>td:nth-child(4){position:sticky!important;right:48px!important;left:auto!important;top:auto!important;grid-column:auto!important;grid-row:auto!important;width:205px!important;min-width:205px!important;max-width:205px!important;padding:8px 10px!important;background:#fff!important;z-index:8!important;border-left:1px solid #e6ebf1!important}
  #view-students table thead th:nth-child(4){position:sticky!important;right:48px!important;width:205px!important;min-width:205px!important;background:#eef3f8!important;z-index:19!important;border-left:1px solid #dfe6ef!important}
  #view-students #studentsTable tr:nth-child(even)>td:nth-child(1),#view-students #studentsTable tr:nth-child(even)>td:nth-child(4){background:#f8fafc!important}
  #view-students #studentsTable tr>td:nth-child(4) b{display:block!important;font-size:13.5px!important;line-height:1.35!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:#173653!important}
  #view-students #studentsTable tr>td:nth-child(4) .small{display:block!important;font-size:10.5px!important;line-height:1.3!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;margin:2px 0 0!important;color:#7b899a!important}
  #view-students #studentsTable tr>td:nth-child(2),#view-students #studentsTable tr>td:nth-child(3),#view-students #studentsTable tr>td:nth-child(5),#view-students #studentsTable tr>td:nth-child(8),#view-students #studentsTable tr>td:nth-child(9),#view-students #studentsTable tr>td:nth-child(10){grid-column:auto!important;border-radius:0!important;margin:0!important;padding:8px 9px!important;background:inherit!important}
  #view-students #studentsTable input[type="checkbox"],#view-students #selectAllStudents{width:20px!important;height:20px!important;accent-color:#2563eb!important}
  #view-students .request-number,#view-students .academic-number,#view-students .initiative-pill{font-size:10.5px!important;padding:3px 6px!important}
  #view-students .status-note{font-size:9.5px!important;display:block!important;margin-top:2px!important}
  #view-students .wa-link,#view-students .mini{min-height:32px!important;padding:5px 8px!important;font-size:11px!important;border-radius:8px!important}
  #view-students .row-actions{display:flex!important;flex-wrap:nowrap!important;gap:5px!important;min-width:max-content!important}
  #view-students .section-head>.actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #view-students .filters{position:sticky!important;top:68px!important;z-index:15!important;margin-bottom:8px!important;box-shadow:0 6px 14px rgba(21,52,84,.07)!important}
  #view-students #studentBulkBar:not(.ux-no-selection){top:136px!important;border-radius:12px!important;margin-bottom:8px!important}
  #view-students:after{content:'اسحب الجدول يمينًا ويسارًا لعرض كل البيانات والإجراءات';display:block;color:#748398;font-size:10.5px;text-align:center;margin-top:7px}
  .permission-grid{grid-template-columns:1fr!important}.perm-group-v309{padding:10px!important}.permission-check{font-size:13px!important;min-height:42px!important}
}
.school-access-v309{border-color:#cfe0f3;background:#f6faff}
.school-access-v309 .small{font-size:11px;color:#6c7d91;font-weight:600}
@media(max-width:760px){
  #view-students .section-head{gap:8px!important}
  #view-students .section-head h3{font-size:19px!important;margin-bottom:2px!important}
  #view-students .section-head .section-note{font-size:12px!important;line-height:1.45!important}
  #view-students .filters{padding:8px!important;gap:6px!important}
  #view-students .filters input,#view-students .filters select,#view-students .filters button{min-height:38px!important;font-size:12.5px!important}
}
.scope-pill-v309,.permission-count-v309{display:inline-flex;align-items:center;min-height:27px;padding:4px 8px;border-radius:999px;background:#eef5fb;color:#315573;font-size:11px;font-weight:800;white-space:nowrap}
.permission-count-v309{background:#f2f6f2;color:#37634a}
