/* IPMA HR: progressive mobile presentation; desktop and printed reports retain their tables. */
.ipma-mobile-brand, .ipma-mobile-nav, .ipma-mobile-menu-toggle, .ipma-attendance-cards { display: none; }
@media screen and (max-width: 991.98px) {
  .ipma-mobile-menu-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid #cfe2d7; border-radius: 12px; background: #f1f7f3; color: #123e2e; font: inherit; font-weight: 750; }
  .ipma-mobile-menu-toggle svg { width: 20px; height: 20px; transition: transform .15s; }
  .ipma-mobile-menu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .hr-sidebar.ipma-mobile-menu-closed { display: none !important; }
  .app-main .hr-sidebar { position: static !important; float: none; width: 100%; max-height: none !important; margin: 8px 0 0; overflow: visible; }
  .app-main .hr-sidebar .dropdown-item { min-height: 44px; font-size: 14px; }
}
@media screen and (max-width: 767.98px) {
  html { scroll-padding-top: 80px; }
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  body, body :is(h1,h2,h3,h4,h5,h6,p,a,button,input,select,textarea,label,dt,dd,th,td,summary,small,strong,span,div,li,ul,nav,section,article):not([class*="fa-"]):not([class*="mdi"]):not([class*="bi-"]) { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; }
  body.ipma-has-mobile-nav { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .app-header { position: sticky; top: 0; z-index: 1020; min-height: 64px; padding: 8px 4px; border-radius: 0 !important; margin-bottom: 0 !important; }
  .app-header .navbar-brand { min-width: 0; gap: 10px !important; padding: 0; }
  .app-header .navbar-brand img { width: 38px; height: 38px; object-fit: contain; }
  .app-header .ipma-mobile-brand { display: block; color: #fff; font-size: 17px; font-weight: 750; letter-spacing: .02em; }
  .app-header .navbar-toggler { width: 44px; height: 44px; padding: 7px; border-radius: 10px; }
  .app-header .navbar-collapse { padding-top: 10px; }
  .app-header .dropdown { width: 100%; }
  .app-header .dropdown > .dropdown-toggle { display: block; width: 100%; padding: 12px; overflow-wrap: anywhere; white-space: normal; text-align: left; }
  .app-header .dropdown-menu { width: 100%; max-height: min(65vh, 480px); overflow-y: auto; }
  .app-header .dropdown-item { min-height: 46px; padding: 12px 14px; white-space: normal; }
  .app-departments { width: calc(100% - 24px); margin: 12px auto 0; padding: 4px; border-radius: 12px; }
  .app-departments:has(.nav:empty) { display: none; }
  .app-departments .nav { flex-wrap: nowrap; justify-content: flex-start !important; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; gap: 4px; }
  .app-departments .nav-link { flex: 0 0 auto; min-height: 42px; display: flex; align-items: center; padding: 9px 12px; font-size: 13px; white-space: nowrap; border-radius: 9px; }
  .app-main { width: calc(100% - 16px) !important; max-width: none; min-width: 0; margin: 12px auto 18px; padding: 12px !important; border-radius: 16px; box-shadow: 0 5px 20px #123e2e0a; }
  .app-main main, .app-main main > *, .app-main .row > [class*="col-"] { min-width: 0; }
  .app-main main > .row { --bs-gutter-x: 1rem; }
  .app-main h1 { font-size: clamp(23px, 6vw, 29px); line-height: 1.2; }
  .app-main h2 { font-size: 20px; line-height: 1.3; }
  .app-main h3 { font-size: 18px; }
  .app-main .form-control:not([type="checkbox"]):not([type="radio"]), .app-main .form-select { min-height: 46px; max-width: 100%; font-size: 16px; border-radius: 10px; }
  .app-main textarea.form-control { min-height: 110px; }
  .app-main .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; white-space: normal; }
  .app-main .select2-container { max-width: 100%; }
  .app-main .select2-container .select2-selection--single { min-height: 46px; }
  .app-main .table-responsive { max-width: 100%; overscroll-behavior-x: contain; }
  .app-main .pagination { flex-wrap: wrap; gap: 3px; }
  .app-main .page-link { min-width: 40px; min-height: 40px; text-align: center; }
  .staff-profile-page.container { width: 100%; max-width: none; padding: 0 !important; }
  .staff-profile-card { border-radius: 16px !important; box-shadow: none !important; }
  .staff-profile-cover { height: 84px !important; }
  .staff-profile-page .staff-profile-header { padding: 0 16px 20px; }
  .staff-profile-page .staff-profile-heading h1 { font-size: 25px; overflow-wrap: anywhere; }
  .staff-profile-page .staff-profile-meta { font-size: 13px; line-height: 1.6; }
  .staff-profile-page .staff-profile-details { padding: 0 16px 20px; }
  .staff-profile-page .staff-detail-grid { grid-template-columns: 1fr; gap: 6px; }
  .staff-profile-page .staff-profile-actions { width: 100%; gap: 8px; }
  .staff-profile-page .staff-profile-actions .btn { flex: 1 1 130px; }
  .staff-profile-page .staff-family-grid { grid-template-columns: 1fr; gap: 12px; }
  .staff-profile-page .staff-family-card { padding: 16px; box-shadow: none; }
  .staff-profile-page .staff-monthly-chart, .staff-profile-page .staff-attendance-panel { margin-top: 18px; padding: 14px; border-radius: 14px; box-shadow: none; }
  .staff-profile-page .staff-attendance-heading p { font-size: 13px; line-height: 1.5; }
  .staff-profile-page .staff-attendance-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; padding: 12px; }
  .staff-profile-page .staff-attendance-filter > div { width: auto; min-width: 0; }
  .staff-profile-page .staff-attendance-filter .form-select { width: 100%; min-width: 0; }
  .staff-profile-page .staff-attendance-filter > .btn { grid-column: 1 / -1; width: 100%; margin-top: 2px; }
  .staff-profile-page .staff-monthly-chart-head { display: block; }
  .staff-profile-page .staff-monthly-chart-filter { margin-top: 12px; }
  .leave-application-page, .leave-application { width: 100%; min-width: 0; }
  .leave-form-body { padding: 12px !important; }
  .leave-form-body .form-group.row { margin: 0 0 16px !important; }
  .leave-form-body .col-form-label { padding-bottom: 7px; }
  .leave-guidance-grid { grid-template-columns: 1fr !important; }
  .leave-guidance-item { padding: 14px !important; }
  .leave-submit-row .btn { width: 100%; }
  .ipma-mobile-nav { display: flex; position: fixed; z-index: 1025; bottom: 0; left: 0; right: 0; min-height: 66px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid #dce8e1; box-shadow: 0 -4px 20px #123e2e0a; }
  .ipma-mobile-nav a { flex: 1 1 0; min-width: 0; min-height: 52px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border-radius: 12px; color: #60776a; font-size: 11px; font-weight: 650; text-decoration: none; }
  .ipma-mobile-nav a[aria-current="page"] { color: #115c3b; background: #eaf5ed; }
  .ipma-mobile-nav svg { width: 22px; height: 22px; }
  .ipma-attendance-ready { overflow-x: visible !important; border: 0 !important; }
  .ipma-attendance-ready table.ipma-card-source { display: none !important; }
  .ipma-attendance-cards { display: grid; gap: 12px; margin-top: 2px; }
  .ipma-attendance-card { min-width: 0; border: 1px solid #d9e7df; border-radius: 14px; background: #fff; overflow: hidden; }
  .ipma-attendance-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px 11px; border-bottom: 1px solid #edf3ef; }
  .ipma-attendance-date { font-size: 15px; font-weight: 750; color: #143d2b; }
  .ipma-attendance-day { flex: 0 1 auto; max-width: 55%; padding: 4px 8px; border-radius: 6px; background: #eaf5ed; color: #185b3b; font-size: 10px; font-weight: 750; letter-spacing: .035em; overflow-wrap: anywhere; }
  .ipma-attendance-day[data-type="restday"], .ipma-attendance-day[data-type="holiday"] { background: #f1f2f3; color: #5a6570; }
  .ipma-attendance-times { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; padding: 15px 14px; margin: 0; }
  .ipma-attendance-times > div { min-width: 0; }
  .ipma-attendance-times dt, .ipma-attendance-meta dt, .ipma-attendance-extra dt { color: #667e70; font-size: 11px; font-weight: 600; margin-bottom: 4px; }
  .ipma-attendance-times dd { color: #153e2c; font-size: 19px; font-weight: 750; margin: 0; }
  .ipma-attendance-times dd *, .ipma-attendance-extra dd * { max-width: 100% !important; overflow-wrap: anywhere; white-space: normal !important; }
  .ipma-attendance-times dd .ipma-empty { color: #8b9a91; font-size: 18px; }
  .ipma-attendance-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 10px 14px; margin: 0; background: #f6faf7; }
  .ipma-attendance-meta dd { margin: 0; color: #385c49; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
  .ipma-attendance-card details { border-top: 1px solid #edf3ef; }
  .ipma-attendance-card summary { padding: 13px 14px; min-height: 44px; color: #236042; font-size: 12px; font-weight: 700; cursor: pointer; }
  .ipma-attendance-extra { display: grid; gap: 12px; padding: 0 14px 14px; margin: 0; }
  .ipma-attendance-extra dd { color: #294f3a; font-size: 13px; margin: 0; overflow-wrap: anywhere; }
  .ipma-mobile-nav a:focus-visible, .ipma-mobile-menu-toggle:focus-visible, .ipma-attendance-card summary:focus-visible { outline: 3px solid #23734d; outline-offset: 3px; }
}
@media (prefers-reduced-motion: reduce) { .ipma-mobile-menu-toggle svg { transition: none; } }
@media print { .ipma-mobile-nav, .ipma-mobile-menu-toggle, .ipma-attendance-cards, .ipma-mobile-brand { display: none !important; } table.ipma-card-source { display: table !important; } }
