/* PWA support styles (Techniyos WorkSuite). Additive only - desktop layout unchanged. */

[data-pwa-install][hidden] { display: none !important; }

/* Online / offline status bar */
.pwa-status {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 24px); padding: 10px 16px; border-radius: 999px;
  font-size: .875rem; font-weight: 600; z-index: 2000; text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .25); transition: opacity .2s, transform .2s;
}
.pwa-status.pwa-visible { opacity: 1; transform: translate(-50%, 0); }
.pwa-status.pwa-offline { background: #92400e; color: #fff; }
.pwa-status.pwa-online  { background: #166534; color: #fff; }

/* iPhone / iPad install instructions */
.pwa-modal-backdrop {
  position: fixed; inset: 0; z-index: 2100; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.pwa-modal { background: #fff; border-radius: 16px; padding: 22px 20px; max-width: 400px; width: 100%; box-shadow: 0 16px 32px rgba(15, 23, 42, .25); }
.pwa-modal h5 { margin: 0 0 12px; font-weight: 700; }
.pwa-modal ol { padding-left: 1.2rem; margin: 0 0 16px; line-height: 1.6; }

/* Safe areas (notch / home indicator) - zero on devices without them */
.app-topbar { padding-top: calc(0.65rem + env(safe-area-inset-top, 0px)); padding-left: calc(1.25rem + env(safe-area-inset-left, 0px)); padding-right: calc(1.25rem + env(safe-area-inset-right, 0px)); }
.app-sidebar { padding-bottom: env(safe-area-inset-bottom, 0px); }
.app-content { padding-left: max(1.5rem, env(safe-area-inset-left, 0px)) !important; padding-right: max(1.5rem, env(safe-area-inset-right, 0px)) !important; }
footer.text-center { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important; }

/* Mobile / tablet usability */
@media (max-width: 991.98px) {
  .app-content { overflow-x: clip; }
  .app-content img { max-width: 100%; height: auto; }
  .app-sidebar .nav-link { min-height: 44px; display: flex; align-items: center; }
  .sidebar-toggle-btn, .sidebar-close-btn { min-width: 44px; min-height: 44px; }
  .app-content .btn:not(.btn-sm):not(.btn-close) { min-height: 42px; }
  .app-content .btn-sm { min-height: 36px; }
  .dropdown-menu .dropdown-item { padding-top: .6rem; padding-bottom: .6rem; }
  /* 16px inputs stop iOS Safari zooming in on focus */
  .form-control, .form-select { font-size: 16px; }
  .app-content .table-responsive, .app-content .card-body > table { max-width: 100%; }
}

/* Standalone window: keep text selection / overscroll calm, like an app */
.pwa-standalone body { overscroll-behavior-y: none; }
