﻿:root {
    --shell-header-height: 82px;
    --shell-sidebar-width: 280px;
    --shell-sidebar-collapsed-width: 80px;
    --shell-footer-height: 36px;
    --z-content: 1;
    --z-sidebar: 80;
    --z-header: 90;
    --z-dropdown: 120;
    --z-toast: 800;
    --z-modal-overlay: 1000;
    --z-modal-dialog: 1010;
    --shell-bg: #eef4fa;
    --shell-surface: #ffffff;
    --shell-border: #dbe3ef;
    --shell-text: #0f172a;
    --shell-muted: #64748b;
    --shell-primary: #0f2747;
    --bjas-z-content: var(--z-content);
    --bjas-z-sidebar: var(--z-sidebar);
    --bjas-z-header: var(--z-header);
    --bjas-z-dropdown: var(--z-dropdown);
    --bjas-z-toast: var(--z-toast);
    --bjas-z-modal-overlay: var(--z-modal-overlay);
    --bjas-z-modal-dialog: var(--z-modal-dialog);
    --bjas-shell-header-height: var(--shell-header-height);
    --wms-z-sidebar: var(--z-sidebar);
    --wms-z-topbar: var(--z-header);
    --wms-z-dropdown: var(--z-dropdown);
    --wms-z-modal-backdrop: var(--z-modal-overlay);
    --wms-z-modal: var(--z-modal-dialog);
}

html,
body {
    max-width: 100%;
}

body:is(
    .internal-portal-shell,
    .internal-module-shell,
    .internal-clean-page-shell,
    .wms-module-shell,
    .wms-stock-reference-shell,
    .hris-module-shell,
    .report-module-shell
):not(.pos-shell) {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--shell-bg);
    color: var(--shell-text);
    overflow-x: hidden;
}

body:is(
    .internal-portal-shell,
    .internal-module-shell,
    .internal-clean-page-shell,
    .wms-module-shell,
    .wms-stock-reference-shell,
    .hris-module-shell,
    .report-module-shell
):not(.pos-shell) > .layout {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

body:is(
    .internal-portal-shell,
    .internal-module-shell,
    .internal-clean-page-shell,
    .wms-module-shell,
    .wms-stock-reference-shell,
    .hris-module-shell,
    .report-module-shell
):not(.pos-shell) :is(.main, .shell-main, .internal-main, .page-content, main[data-shell-main]) {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
}

body:is(
    .internal-module-shell,
    .internal-clean-page-shell,
    .wms-module-shell,
    .wms-stock-reference-shell,
    .hris-module-shell,
    .report-module-shell
):not(.pos-shell) :is(.module-shell, .shell-with-sidebar, .internal-module-layout, .module-layout, .clean-module-layout):not(.clean-module-layout--no-sidebar):not(.internal-module-layout--hub) {
    display: grid;
    grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
    max-width: 100%;
}

body:is(
    .internal-portal-shell,
    .internal-module-shell,
    .internal-clean-page-shell,
    .wms-module-shell,
    .wms-stock-reference-shell,
    .hris-module-shell,
    .report-module-shell
):not(.pos-shell) :is(.shell-content, .module-main, .clean-content-panel, .content-panel, .internal-module-panel, .information-panel) {
    min-width: 0;
    max-width: 100%;
    position: relative;
    z-index: var(--z-content);
}

body:is(
    .internal-portal-shell,
    .internal-module-shell,
    .internal-clean-page-shell,
    .wms-module-shell,
    .wms-stock-reference-shell,
    .hris-module-shell,
    .report-module-shell
):not(.pos-shell) :is(.table-scroll, .table-responsive, .table-box) {
    max-width: 100%;
}

body:not(.pos-shell) :is(.shell-modal-backdrop, .modal-backdrop, .app-modal-backdrop) {
    z-index: var(--z-modal-overlay) !important;
}

body:not(.pos-shell) :is(.shell-modal, .modal-dialog, .app-modal-dialog) {
    z-index: var(--z-modal-dialog) !important;
}

body > :is(.biometric-photo-modal, .biometric-edit-modal) {
    z-index: var(--z-modal-overlay) !important;
}

body > :is(.biometric-photo-modal, .biometric-edit-modal) :is(.biometric-photo-modal-dialog, .biometric-edit-modal-dialog) {
    z-index: var(--z-modal-dialog) !important;
}

html[data-theme] body.hris-modal-open,
body.hris-modal-open {
    overflow: hidden !important;
}

.app-update-prompt {
    position: fixed;
    top: 18px;
    right: 18px;
    width: min(380px, calc(100vw - 24px));
    max-height: none;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--shell-border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    color: var(--shell-text);
    z-index: var(--z-toast);
}

.app-update-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--shell-primary);
}

.app-update-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.app-update-copy {
    min-width: 0;
}

.app-update-copy strong {
    display: block;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.app-update-copy span {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #475569;
}

.app-update-notes {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.app-update-details summary {
    cursor: pointer;
    font-weight: 850;
    color: var(--shell-primary);
}

.app-update-details ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.app-update-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.app-update-primary,
.app-update-secondary,
.app-update-close {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.app-update-primary,
.app-update-secondary {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.app-update-primary {
    background: var(--shell-primary);
    color: #ffffff;
}

.app-update-secondary {
    border: 1px solid var(--shell-border);
    background: #ffffff;
    color: var(--shell-primary);
}

.app-update-close {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    line-height: 1;
}

body.pos-shell {
    min-width: 0;
    max-width: 100%;
}

body.pos-shell :is(.internal-app-topbar, .internal-shell-header, .module-header.internal-shell-header, .internal-sidebar, .app-sidebar, .shell-sidebar, .module-sidebar, .internal-base-footer, .internal-module-footer) {
    display: none !important;
}

body.pos-shell :is(.layout, .main, .page-content, .page-content-bleed) {
    min-width: 0;
    max-width: none;
}

@media (max-width: 768px) {
    body:is(
        .internal-module-shell,
        .internal-clean-page-shell,
        .wms-module-shell,
        .wms-stock-reference-shell,
        .hris-module-shell,
        .report-module-shell
    ):not(.pos-shell) :is(.module-shell, .shell-with-sidebar, .internal-module-layout, .module-layout, .clean-module-layout):not(.clean-module-layout--no-sidebar):not(.internal-module-layout--hub) {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .app-update-prompt {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        padding: 14px;
    }
}

