/* EDUHUNT R266 | Staff Attendance mobile layout only
 * Targets attendance tab layouts, attendance summary cards and TWO read-only
 * attendance detail tables. No payroll/leave/punch business rules affected.
 */
@media screen and (max-width:760px) {
  body.eh-oa-active #content {box-sizing:border-box!important;width:100%!important;max-width:100%!important;padding:4px 8px 18px!important;}
  #content #ehOfficeAttendanceNativePage {margin:0!important;padding:0!important;min-width:0!important;max-width:100%!important;}
  #content #ehOfficeAttendanceNativePage #ehOaAdmin {
    margin-top:2px!important;margin-bottom:9px!important;padding:10px!important;
  }
  /* 4 tabs on first row; 3 tabs on the second row. */
  #content #ehOfficeAttendanceNativePage #ehOaAdminTabs {
    display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr))!important;
    gap:5px!important;margin:0 0 12px!important;padding:0!important;
    width:100%!important;max-width:100%!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaAdminTabs>button {
    grid-column:span 3!important;min-height:43px!important;height:auto!important;
    padding:6px 2px!important;font-size:12px!important;line-height:1.12!important;
    font-weight:800!important;white-space:normal!important;overflow-wrap:normal!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    text-align:center!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaAdminTabs>button:nth-child(n+5) {grid-column:span 4!important;}
  /* Date-wise: all three interactive totals on one row, centre their labels. */
  #content #ehOfficeAttendanceNativePage #ehOaDateSummary.eh-oa-date-summary-grid {
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;margin:0 0 10px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaDateSummary>.eh-oa-date-summary-card {
    min-width:0!important;min-height:79px!important;display:flex!important;
    flex-direction:column!important;align-items:center!important;justify-content:center!important;
    text-align:center!important;gap:4px!important;padding:6px 2px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaDateSummary .eh-oa-date-summary-icon {
    display:grid!important;place-items:center!important;flex:0 0 22px!important;
    width:22px!important;height:22px!important;font-size:11px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaDateSummary .eh-oa-date-summary-copy {
    display:grid!important;gap:2px!important;justify-items:center!important;text-align:center!important;
    min-width:0!important;width:100%!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaDateSummary .eh-oa-date-summary-copy strong {
    font-size:21px!important;line-height:1.05!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaDateSummary .eh-oa-date-summary-copy small {
    font-size:9px!important;line-height:1.1!important;letter-spacing:0!important;
    white-space:normal!important;overflow-wrap:break-word!important;
  }
  /* Staff-wise: six summaries in two rows of three, slightly larger text. */
  #content #ehOfficeAttendanceNativePage #ehOaStaffSummary.eh-oa-summary-grid.eh-oa-summary-grid-six {
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;margin:10px 0 12px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaStaffSummary .eh-oa-summary-card {
    min-width:0!important;min-height:86px!important;padding:7px 4px!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    text-align:center!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaStaffSummary .eh-oa-summary-card small {
    font-size:10px!important;line-height:1.17!important;letter-spacing:0!important;
    overflow-wrap:break-word!important;margin-bottom:4px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaStaffSummary .eh-oa-summary-card strong {
    font-size:25px!important;line-height:1.1!important;margin-top:2px!important;
  }
  /* R268: TRUE Excel-like mobile attendance GRID, not the R266 per-row cards.
   * Keep every original column and the original attendance action buttons.
   * Horizontal scrolling is contained INSIDE the sheet only. The page itself
   * does not scroll sideways. Two frozen identifier columns make it usable.
   * 7 or 8 original columns cannot fit a 320px screen legibly at once.
   */
  #content #ehOfficeAttendanceNativePage #ehOaReport,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory {
    box-sizing:border-box!important;
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
    overflow-x:auto!important;overflow-y:auto!important;
    max-height:64vh!important;
    margin:7px 0 14px!important;
    padding:0!important;border:1px solid #47718c!important;border-radius:9px!important;
    background:#0b2337!important;
    overscroll-behavior-inline:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:thin!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table {
    display:table!important;position:static!important;
    width:736px!important;min-width:736px!important;max-width:none!important;
    table-layout:fixed!important;border-collapse:separate!important;border-spacing:0!important;
    background:#0d2a42!important;margin:0!important;
    font-size:11px!important;line-height:1.25!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table {
    width:787px!important;min-width:787px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table thead,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table thead {
    display:table-header-group!important;position:static!important;
    width:auto!important;height:auto!important;overflow:visible!important;
    clip-path:none!important;white-space:normal!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table tbody,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table tbody {
    display:table-row-group!important;width:auto!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table tr,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table tr {
    display:table-row!important;position:static!important;
    background:#0c2a43!important;border:0!important;border-radius:0!important;
    box-shadow:none!important;padding:0!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table th,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table th {
    display:table-cell!important;position:sticky!important;top:0!important;z-index:4!important;
    box-sizing:border-box!important;
    padding:7px 5px!important;margin:0!important;
    background:#1c557e!important;color:#fff!important;
    border:0!important;border-right:1px solid #416e8a!important;border-bottom:1px solid #65849e!important;
    min-width:0!important;max-width:none!important;height:auto!important;
    white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;
    text-align:center!important;font-size:10.5px!important;font-weight:850!important;line-height:1.23!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table td,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table td {
    display:table-cell!important;position:static!important;z-index:auto!important;
    box-sizing:border-box!important;width:auto!important;min-width:0!important;max-width:none!important;
    height:auto!important;margin:0!important;padding:7px 5px!important;
    border:0!important;border-right:1px solid #30516b!important;
    border-bottom:1px solid #30516b!important;
    border-radius:0!important;box-shadow:none!important;
    background:#0e2c45!important;color:#ecf5ff!important;
    font-size:11px!important;line-height:1.3!important;
    white-space:normal!important;overflow-wrap:break-word!important;word-break:normal!important;
    text-align:center!important;vertical-align:middle!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table tbody tr:nth-child(even) td,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table tbody tr:nth-child(even) td {
    background:#123550!important;
  }
  /* The spreadsheet headings are visible: remove R266 mobile card labels. */
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table td::before,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table td::before {
    display:none!important;content:none!important;
  }
  /* S.No fixed at 38 px, not the old 98 px sticky column or R266 badge. */
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table :is(th,td):first-child,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table :is(th,td):first-child {
    width:38px!important;min-width:38px!important;max-width:38px!important;
    position:sticky!important;left:0!important;right:auto!important;
    box-shadow:1px 0 0 #527e99!important;
    padding:6px 2px!important;text-align:center!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table th:first-child,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table th:first-child {
    z-index:8!important;background:#1b527a!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table td:first-child,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table td:first-child {
    z-index:6!important;background:#0e2c45!important;
  }
  /* Freeze Staff (Date-wise) and Date (Staff-wise) alongside S.No. */
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table :is(th,td):nth-child(2),
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table :is(th,td):nth-child(2) {
    position:sticky!important;left:38px!important;right:auto!important;
    padding:6px 5px!important;box-shadow:2px 0 0 #527e99!important;
    text-align:left!important;vertical-align:middle!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table :is(th,td):nth-child(2) {
    width:146px!important;min-width:146px!important;max-width:146px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table :is(th,td):nth-child(2) {
    width:86px!important;min-width:86px!important;max-width:86px!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table th:nth-child(2),
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table th:nth-child(2) {
    z-index:7!important;background:#1b527a!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table td:nth-child(2),
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table td:nth-child(2) {
    z-index:5!important;background:#10314d!important;font-weight:700!important;
  }
  /* Allow genuine attendance statuses, sources and approval/modify actions.
     None are deleted; the status column simply gets sufficient width. */
  #content #ehOfficeAttendanceNativePage #ehOaReport table.eh-oa-mark-table :is(th,td):last-child,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory table.eh-oa-mark-table :is(th,td):last-child {
    width:215px!important;min-width:215px!important;max-width:215px!important;
    text-align:left!important;white-space:normal!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport .eh-oa-status-action-row,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory .eh-oa-status-action-row {
    display:flex!important;flex-wrap:wrap!important;gap:4px!important;
    min-width:0!important;max-width:100%!important;white-space:normal!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport .eh-oa-mark-badge,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory .eh-oa-mark-badge {
    min-height:25px!important;padding:3px 5px!important;min-width:32px!important;
    font-size:10px!important;line-height:1.15!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport .eh-oa-status-action-row button,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory .eh-oa-status-action-row button {
    min-height:28px!important;padding:4px 7px!important;font-size:10px!important;
    white-space:normal!important;
  }
  #content #ehOfficeAttendanceNativePage #ehOaReport .eh-oa-status-source,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory .eh-oa-status-source,
  #content #ehOfficeAttendanceNativePage #ehOaReport .eh-oa-status-detail,
  #content #ehOfficeAttendanceNativePage #ehOaStaffHistory .eh-oa-status-detail {
    font-size:9px!important;line-height:1.18!important;white-space:normal!important;
  }
  /* Preserve the mobile portal frame; only the table viewport scrolls. */
  body.eh-oa-active #content,#content #ehOfficeAttendanceNativePage,
  #content #ehOfficeAttendanceNativePage .eh-oa-admin-page {
    max-width:100%!important;min-width:0!important;
  }
}
@media screen and (max-width:359px) {
  #content #ehOfficeAttendanceNativePage #ehOaAdminTabs>button {font-size:11px!important;padding:5px 1px!important;}
  #content #ehOfficeAttendanceNativePage #ehOaStaffSummary .eh-oa-summary-card small {font-size:9px!important;}
  #content #ehOfficeAttendanceNativePage #ehOaDateSummary .eh-oa-date-summary-copy small {font-size:8px!important;}
}
