[data-pwa-install][hidden] { display: none !important; }
[data-pwa-login-install][hidden], [data-pwa-guide-platform][hidden] { display: none !important; }
.pwa-install-button { min-height: 44px; padding: 10px 20px; border: 1px solid #182d4d; border-radius: 8px; background: #fff; color: #182d4d; font: inherit; cursor: pointer; }
.pwa-install-button:hover { background: #f0f3f8; }
.pwa-install-button:focus-visible { outline: 3px solid #738db4; outline-offset: 3px; }
.pwa-login-install { margin: 20px 0 24px; text-align: center; }
.pwa-install-typed-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #d5e3e9; border-radius: 12px; background: linear-gradient(115deg, #eef4fc, #eff9f2); color: #202c4c; box-shadow: 0 3px 12px rgb(32 44 76 / 5%); font: 600 14px/1.5 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
.pwa-install-typed-button > svg { flex: 0 0 18px; }
.pwa-install-typed-button:hover { border-color: #a8c4b7; box-shadow: 0 5px 18px rgb(32 44 76 / 9%); }
.pwa-install-typed-button:focus-visible, .pwa-promo-install:focus-visible, .pwa-promo-close:focus-visible, .pwa-promo-later button:focus-visible { outline: 3px solid #738db4; outline-offset: 3px; }
.pwa-install-typed-label { display: inline-flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 .35em; }
.pwa-install-platform { display: inline-block; min-width: 7.8ch; color: #3b60ad; text-align: left; white-space: nowrap; font-weight: 750; }
.pwa-install-platform[data-platform="android"] { color: #267b53; }
.pwa-install-platform[data-platform="ios"] { color: #7756a6; }
.pwa-install-cursor { margin-left: 1px; font-weight: 400; animation: pwa-cursor-blink 1s steps(1) infinite; }
body.pwa-install-dialog-open { overflow: hidden; }
@keyframes pwa-cursor-blink { 50% { opacity: 0; } }
.pwa-install-promo { box-sizing: border-box; width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); margin: auto; padding: 32px 26px 22px; border: 1px solid rgb(255 255 255 / 75%); border-radius: 26px; background: radial-gradient(ellipse at 50% 0, #eaf4f0, transparent 62%), #fff; color: #202c4c; box-shadow: 0 24px 80px rgb(15 23 42 / 25%); text-align: center; font: 15px/1.6 system-ui, sans-serif; overflow-y: auto; overscroll-behavior: contain; }
.pwa-install-promo::backdrop { background: rgb(14 23 43 / 55%); backdrop-filter: blur(5px); }
.pwa-promo-dismiss { position: absolute; top: 10px; right: 10px; margin: 0; }
.pwa-promo-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(32 44 76 / 5%); color: #5b6680; cursor: pointer; }
.pwa-promo-art { position: relative; display: grid; place-items: center; width: 132px; height: 120px; margin: 0 auto 15px; }
.pwa-promo-orbit { position: absolute; width: 116px; height: 116px; border: 1px solid #cfdfd8; border-radius: 34px; background: rgb(255 255 255 / 50%); transform: rotate(-12deg); }
.pwa-promo-art img { position: relative; border-radius: 21px; box-shadow: 0 12px 24px rgb(32 44 76 / 20%); }
.pwa-promo-plus { position: absolute; right: 7px; bottom: 14px; display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50%; background: #71c381; color: #173f25; font: 600 23px/1 system-ui, sans-serif; }
.pwa-install-promo .pwa-promo-eyebrow { margin: 0 0 8px; color: #3a7956; font: 750 11px/1.4 system-ui, sans-serif; letter-spacing: .11em; text-transform: uppercase; }
.pwa-install-promo h2 { margin: 0 0 12px; color: #202c4c; font: 750 27px/1.18 system-ui, sans-serif; letter-spacing: -.7px; }
.pwa-install-promo #pwa-promo-description { margin: 0; color: #667085; font: inherit; }
.pwa-promo-benefits { display: flex; flex-direction: column; gap: 9px; margin: 22px 0; text-align: left; color: #42516a; font-size: 13px; }
.pwa-promo-benefits > span { display: flex; align-items: center; gap: 9px; }
.pwa-promo-benefits svg { flex: 0 0 17px; color: #42855d; }
.pwa-promo-install { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 49px; padding: 12px 18px; border: 0; border-radius: 12px; background: #202c4c; color: #fff; font: 650 15px/1.5 system-ui, sans-serif; box-shadow: 0 5px 14px rgb(32 44 76 / 16%); cursor: pointer; touch-action: manipulation; }
.pwa-promo-install:hover { background: #2e4069; }
.pwa-promo-install:disabled { opacity: .6; cursor: wait; }
.pwa-promo-install > span { font-size: 19px; }
.pwa-promo-later { margin: 8px 0 0; }
.pwa-promo-later button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #647084; font: 500 13px/1.5 system-ui, sans-serif; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .pwa-install-cursor { animation: none; opacity: 0; } }
.pwa-install-guide { width: calc(100% - 32px); max-width: 420px; max-height: calc(100% - 48px); padding: 28px; border: 0; border-radius: 16px; background: #fff; color: #182d4d; font: 16px/1.6 system-ui, sans-serif; overflow-y: auto; }
.pwa-install-guide::backdrop { background: rgb(18 30 50 / 55%); }
.pwa-install-guide h2 { margin: 0 0 12px; color: inherit; font: 700 22px/1.3 system-ui, sans-serif; }
.pwa-install-guide p { margin: 0 0 16px; }
.pwa-install-guide ol { padding-left: 24px; }
.pwa-install-guide li + li { margin-top: 12px; }
.pwa-install-guide form { margin: 24px 0 0; text-align: right; }

/* Installed ERP branding replaces the hidden hamburger in the header. */
.pwa-header-brand { display: none; }
html.pwa-standalone .pwa-erp .pwa-header-start { flex: 1 1 180px; min-width: 0; gap: 8px; margin-right: 12px; }
html.pwa-standalone .pwa-erp .pwa-header-brand { display: flex; align-items: center; flex: 0 1 180px; width: 180px; min-width: 0; max-width: 180px; min-height: 52px; }
html.pwa-standalone .pwa-erp .pwa-header-brand img { display: block; width: 100%; height: 40px; object-fit: contain; object-position: left center; }
html.pwa-standalone.dark .pwa-erp .pwa-header-brand img.is-default-logo { filter: brightness(0) invert(1); }
html.pwa-standalone .pwa-erp .pwa-header-brand:focus-visible { outline: 3px solid #738db4; outline-offset: 2px; border-radius: 4px; }
html.pwa-standalone .pwa-erp .header-actions { flex-shrink: 0; }
html.pwa-standalone .pwa-erp .header-actions .user-profile { margin-right: 0; padding: 12px 0 12px 8px; }
.pwa-profile-chevron { display: none; }
html.pwa-standalone .pwa-erp .pwa-profile-chevron { display: block; flex: 0 0 14px; margin-left: 4px; color: var(--text-color, #182d4d); pointer-events: none; }
html.pwa-standalone .pwa-erp .user-name > span > .fa-angle-down { display: none; }
html.pwa-standalone .pwa-erp #navbar-guide-desktop,
html.pwa-standalone .pwa-erp #navbar-guide-mobile { display: none !important; }

/* The ERP bottom bar is visible only in an installed app window. */
.pwa-bottom-nav { display: none; }
html.pwa-standalone { scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
html.pwa-standalone body.pwa-erp {
    --pwa-nav-height: 68px;
    --pwa-bottom-space: calc(var(--pwa-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--pwa-bottom-space);
}
html.pwa-standalone .pwa-erp .pwa-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    inset: auto 0 0;
    z-index: 1030;
    box-sizing: border-box;
    height: var(--pwa-bottom-space);
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #e4e7ec;
    background: var(--card-background, #fff);
    box-shadow: 0 -3px 16px rgb(24 45 77 / 4%);
}
.pwa-bottom-nav .pwa-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 44px;
    border-radius: 9px;
    color: #737b88;
    font: 500 11px/1.2 system-ui, sans-serif;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.pwa-bottom-nav .pwa-tab.is-active { color: var(--text-color, #182d4d); font-weight: 750; background: rgb(122 133 155 / 9%); }
.pwa-bottom-nav .pwa-tab[aria-expanded="true"] { color: var(--text-color, #182d4d); background: rgb(122 133 155 / 15%); }
.pwa-bottom-nav .pwa-tab.is-disabled { opacity: .4; cursor: default; }
.pwa-bottom-nav a.pwa-tab:hover { color: var(--text-color, #182d4d); }
.pwa-bottom-nav a.pwa-tab:active { background: rgb(122 133 155 / 15%); }
.pwa-bottom-nav a.pwa-tab:focus-visible, .pwa-module-card:focus-visible { outline: 3px solid #738db4; outline-offset: -3px; }
.pwa-icon { display: block; flex: 0 0 auto; }

.pwa-modules-title { margin: 20px 0 12px; font-size: 25px; font-weight: 700; }
.pwa-subscription.menu_badge_box { position: static; max-width: 1000px; margin: 0 0 22px; padding: 0; }
.pwa-subscription .menu_badge_box_child { padding: 16px; }
.pwa-subscription .menu_badge_current_package { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.pwa-subscription .menu_badge_link { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; }
.pwa-subscription .menu_badge_link:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.pwa-modules-intro { margin: 0 0 22px; color: var(--text-color, #667085); }
.pwa-modules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; max-width: 1000px; }
.pwa-module-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-width: 0; min-height: 150px; padding: 20px; border: 1px solid var(--header-area-border-bottom, #e4e7ec); border-radius: 16px; color: var(--text-color, #182d4d); background: var(--card-background, #fff); text-decoration: none; box-shadow: 0 2px 8px rgb(24 45 77 / 3%); touch-action: manipulation; }
.pwa-module-card:hover { color: var(--text-color, #182d4d); text-decoration: none; border-color: #a3adc0; }
.pwa-module-name { font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.pwa-module-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; color: #526389; background: #eef1f8; }
.pwa-module-icon--crm, .pwa-module-icon--workflow { color: #6c55a6; background: #f0ecfa; }
.pwa-module-icon--invoices, .pwa-module-icon--expenses { color: #367766; background: #eaf5ef; }
.pwa-module-icon--sales { color: #367766; background: #eaf5ef; }
.pwa-module-icon--inventory, .pwa-module-icon--tms { color: #9a682b; background: #fbf2e6; }
.pwa-module-icon--production, .pwa-module-icon--transport { color: #9a682b; background: #fbf2e6; }
.pwa-module-icon--hr, .pwa-module-icon--ai { color: #a05279; background: #faedf4; }
.pwa-module-arrow { position: absolute; top: 20px; right: 18px; color: #9aa1af; }
.pwa-modules-empty { grid-column: 1 / -1; padding: 24px; border-radius: 12px; background: var(--card-background, #fff); }

/* Existing fixed ERP controls must sit above the PWA navigation. */
html.pwa-standalone .pwa-erp .chat-footer { bottom: var(--pwa-bottom-space) !important; }
html.pwa-standalone .pwa-erp .fixed-bottom { bottom: var(--pwa-bottom-space); }
html.pwa-standalone .pwa-erp .scrollToBottom { bottom: calc(var(--pwa-bottom-space) + 15px) !important; }
/* Keep the legacy sidebar in the DOM, inaccessible throughout installed mode. */
html.pwa-standalone .pwa-erp .page-container { padding-left: 0 !important; padding-right: 0 !important; }
html.pwa-standalone .pwa-erp .sidebar-menu,
html.pwa-standalone .pwa-erp #mobile-menu-toggle { display: none !important; }
html.pwa-standalone .pwa-erp .header-area {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(16px, env(safe-area-inset-right, 0px)) !important;
}
html.pwa-standalone .pwa-erp .main-content-inner {
    padding-left: max(30px, env(safe-area-inset-left, 0px));
    padding-right: max(30px, env(safe-area-inset-right, 0px));
}
html.pwa-standalone .pwa-erp .chat-icon { bottom: calc(var(--pwa-bottom-space) + 16px) !important; }
html.pwa-standalone .pwa-erp .chat-window { bottom: calc(var(--pwa-bottom-space) + 12px) !important; max-height: calc(100dvh - var(--pwa-bottom-space) - 90px); }
html.pwa-standalone .pwa-erp .jq-toast-wrap.bottom-center,
html.pwa-standalone .pwa-erp .jq-toast-wrap.bottom-right,
html.pwa-standalone .pwa-erp .jq-toast-wrap.bottom-left,
html.pwa-standalone .pwa-erp #toast-container.toast-bottom-center,
html.pwa-standalone .pwa-erp #toast-container.toast-bottom-right,
html.pwa-standalone .pwa-erp #toast-container.toast-bottom-left { bottom: calc(var(--pwa-bottom-space) + 16px); }

.pwa-menu-popover[hidden], .pwa-menu-backdrop[hidden] { display: none !important; }
.pwa-menu-backdrop { position: fixed; inset: 0 0 var(--pwa-bottom-space, 68px); z-index: 1041; background: rgb(24 45 77 / 12%); }
.pwa-menu-popover {
    position: fixed;
    z-index: 1045;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--pwa-bottom-space, 68px) + 12px);
    width: auto;
    max-width: 440px;
    max-height: calc(100dvh - var(--pwa-bottom-space, 68px) - env(safe-area-inset-top, 0px) - 36px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--header-area-border-bottom, #e4e7ec);
    border-radius: 22px;
    background: var(--card-background, #fff);
    color: var(--text-color, #182d4d);
    box-shadow: 0 12px 48px rgb(24 45 77 / 24%);
    overflow: hidden;
}
.pwa-menu-heading { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--header-area-border-bottom, #e4e7ec); }
.pwa-menu-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pwa-menu-title h2 { margin: 0; color: inherit; font: 700 17px/1.4 system-ui, sans-serif; }
.pwa-menu-close { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; font: 26px/1 system-ui, sans-serif; cursor: pointer; }
.pwa-menu-popover > nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pwa-menu-links { list-style: none; padding: 6px 12px 12px; margin: 0; }
.pwa-menu-links li { list-style: none; margin: 0; padding: 0; }
.pwa-menu-links a, .pwa-menu-submenu > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px; border-radius: 10px; color: inherit; text-decoration: none; font: 500 15px/1.45 system-ui, sans-serif; touch-action: manipulation; }
.pwa-menu-links a:hover, .pwa-menu-links a[aria-current="page"], .pwa-menu-submenu > summary:hover, .pwa-menu-close:hover { color: inherit; background: rgb(122 133 155 / 10%); text-decoration: none; }
.pwa-menu-links a:focus-visible, .pwa-menu-submenu > summary:focus-visible, .pwa-menu-close:focus-visible { outline: 2px solid #738db4; outline-offset: -2px; }
.pwa-menu-submenu > summary { cursor: pointer; list-style: none; }
.pwa-menu-submenu > summary::-webkit-details-marker { display: none; }
.pwa-menu-submenu[open] > summary .pwa-menu-link-arrow { transform: rotate(90deg); }
.pwa-menu-submenu > ul { margin: 0 0 6px 12px; padding: 0 0 0 8px; border-left: 2px solid var(--header-area-border-bottom, #e4e7ec); }
.pwa-menu-link-arrow { color: #939ba8; font-size: 23px; font-weight: 400; }
.pwa-module-card[aria-expanded="true"] { border-color: #738db4; }

@media (max-width: 767px) {
    html.pwa-standalone .pwa-erp .pwa-profile-chevron { margin-left: 0; }
    .pwa-modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .pwa-module-card { padding: 16px; min-height: 140px; }
    html.pwa-standalone .pwa-erp .page-container { padding-left: 0; }
    html.pwa-standalone .pwa-erp .main-content-inner { padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); }
}
