/* Installed PWA (display-mode: standalone) — hide non-dashboard chrome */
html.pwa-shell .pwa-hide {
  display: none !important;
}

html.pwa-shell .pwa-full-menu {
  display: none !important;
}

/* Default: hide the PWA-only dashboard duplicate in normal browser */
.pwa-only-menu {
  display: none !important;
}

html.pwa-shell .pwa-only-menu {
  display: list-item !important;
}

html.pwa-shell .page-content {
  padding-top: 12px;
}

/* —— Native app shell —— */
html.pwa-shell body.pwa-home,
html.pwa-shell body.pwa-inner {
  --pwa-primary: #f58220;
  --pwa-muted: #9aa3b2;
  --pwa-text: #2a3441;
  --pwa-nav-h: 64px;
  --pwa-topbar-h: 56px;
}

/* Hide left sidebar + desktop hamburger on mobile shell */
html.pwa-shell .vertical-menu,
html.pwa-shell #vertical-menu-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Overlay not used for mobile Issue/Cancel (Bootstrap modals); keep hidden on PWA */
html.pwa-shell .rightbar-overlay {
  display: none !important;
}

html.pwa-shell .main-content {
  margin-left: 0 !important;
  margin-top: calc(var(--pwa-topbar-h) + env(safe-area-inset-top, 0px)) !important;
  transition: margin-top 0.15s ease;
}

html.pwa-shell body.pwa-search-open .main-content {
  margin-top: calc(var(--pwa-topbar-h) + env(safe-area-inset-top, 0px) + 62px) !important;
}

html.pwa-shell #page-topbar {
  left: 0 !important;
  right: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  border-bottom: 1px solid #e8ecf4;
}

/* —— Mobile app bar —— */
html.pwa-shell #page-topbar.pwa-appbar {
  height: auto !important;
  min-height: var(--pwa-topbar-h);
  padding-top: env(safe-area-inset-top, 0px);
}

html.pwa-shell .pwa-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--pwa-topbar-h);
  padding: 0 10px 0 12px;
  gap: 8px;
}

html.pwa-shell .pwa-topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

html.pwa-shell .pwa-topbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Full AIRTICKET logo (same asset as desktop logo-lg) */
html.pwa-shell .pwa-brand-logo {
  display: inline-flex;
  align-items: center;
  max-width: 160px;
  line-height: 0;
}

html.pwa-shell .pwa-brand-logo img {
  display: block;
  height: 32px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

html.pwa-shell .pwa-search-toggle,
html.pwa-shell .pwa-back-btn {
  color: var(--pwa-text) !important;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  box-shadow: none !important;
}

html.pwa-shell .pwa-search-toggle i,
html.pwa-shell .pwa-back-btn i {
  font-size: 22px;
  line-height: 1;
}

html.pwa-shell .pwa-search-toggle.is-open {
  color: var(--pwa-primary) !important;
}

/* Toggle search panel under header */
html.pwa-shell .pwa-search-panel {
  border-top: 1px solid #e8ecf4;
  padding: 10px 12px 12px;
  background: #fff;
}

html.pwa-shell .pwa-search-panel[hidden] {
  display: none !important;
}

html.pwa-shell .pwa-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

html.pwa-shell .pwa-search-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d7dde8;
  border-radius: 8px;
  background: #fff;
}

html.pwa-shell .pwa-search-field i {
  color: var(--pwa-muted);
  font-size: 18px;
  flex-shrink: 0;
}

html.pwa-shell .pwa-search-field .form-control {
  border: 0;
  background: transparent;
  box-shadow: none;
  height: 38px;
  padding: 0;
  font-size: 14px;
  color: var(--pwa-text);
}

html.pwa-shell .pwa-search-field .form-control:focus {
  box-shadow: none;
  outline: none;
}

html.pwa-shell .pwa-search-field .form-control::placeholder {
  color: #b0b7c3;
}

html.pwa-shell .pwa-search-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--pwa-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

html.pwa-shell .pwa-search-btn:active {
  filter: brightness(0.95);
}

html.pwa-shell .pwa-pnr-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #dc2626;
  min-height: 0;
}

html.pwa-shell .pwa-pnr-error:empty {
  display: none;
}

/* Profile avatar sizing in mobile app bar */
html.pwa-shell .pwa-appbar .header-profile-user {
  height: 34px;
  width: 34px;
}

/* Detail page: app-bar back replaces in-content back link */
html.pwa-shell body.pwa-inner .mb-detail-shell .mb-back {
  display: none !important;
}

html.pwa-shell body.pwa-inner .mb-detail-shell .detail-body {
  margin-top: 25px;
}

/* Bottom tab bar — home only */
.pwa-bottom-nav {
  display: none;
}

html.pwa-shell body.pwa-home .pwa-bottom-nav {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1005;
  height: calc(var(--pwa-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e8ecf4;
  box-shadow: 0 -2px 12px rgba(26, 35, 50, 0.06);
  justify-content: space-around;
  align-items: flex-start;
}

html.pwa-shell body.pwa-home .pwa-tab {
  flex: 1;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--pwa-muted);
  padding: 4px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

html.pwa-shell body.pwa-home .pwa-tab i {
  font-size: 22px;
  line-height: 1;
}

html.pwa-shell body.pwa-home .pwa-tab span {
  font-size: 9px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.pwa-shell body.pwa-home .pwa-tab.is-active {
  color: var(--pwa-primary);
}

html.pwa-shell body.pwa-home .main-content,
html.pwa-shell body.pwa-home .page-content {
  padding-bottom: calc(var(--pwa-nav-h) + env(safe-area-inset-bottom, 0px) + 12px) !important;
}

/* Tab panels */
html.pwa-shell .mb-tab-panel[hidden] {
  display: none !important;
}

html.pwa-shell .mb-tab-card {
  border: 0;
  box-shadow: none;
  background: transparent;
}

html.pwa-shell .mb-tab-card > .card-body {
  padding: 0;
}

/* Mobile Issue/Cancel Bootstrap modals — top aligned like Remarks */
html.pwa-shell #mbIssueModal .modal-dialog,
html.pwa-shell #mbCancelModal .modal-dialog {
  margin: 0.75rem auto 1rem;
  max-width: 440px;
}

html.pwa-shell #mbIssueModal.modal,
html.pwa-shell #mbCancelModal.modal {
  padding-top: env(safe-area-inset-top, 0px);
}

html.pwa-shell #mbIssueModal .mb-issue-rules,
html.pwa-shell #mbCancelModal .mb-cancel-rules {
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 12px;
}

html.pwa-shell #mbIssueModal .modal-title,
html.pwa-shell #mbCancelModal .modal-title {
  font-size: 15px;
  font-weight: 600;
  padding-right: 12px;
}
