/* Marken Trading ERP — single-source application theme.
   Bootstrap provides the component framework; this file owns the application shell/theme.
   Do not add page-wide resets or a second sidebar/theme stylesheet. */

:root {
    --font-family-primary: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 14px;

    --sidebar-width: 17.5rem;
    --sidebar-collapsed-width: 5.5rem;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #334155;
    --sidebar-text-muted: #64748b;
    --sidebar-text-hover: #0f172a;
    --sidebar-text-active: #1B8C81;
    --sidebar-item-active-bg: #e8f7f5;

    --header-bg: #ffffff;
    --header-text: #0f172a;

    --border-radius-base: .5rem;
    --border-radius-card: .75rem;

    --color-primary: #1B8C81;
    --color-primary-hover: #147269;
    --color-primary-light: rgba(27, 140, 129, .10);
    --color-secondary: #f97316;
    --color-secondary-hover: #ea580c;

    --color-bg-app: #f8fafc;
    --color-card-bg: #ffffff;
    --color-text-base: #334155;
    --color-text-muted: #64748b;
    --color-text-heading: #0f172a;

    --table-header-bg: #f1f5f9;
    --table-header-text: #1e293b;
    --table-row-even-bg: #f8fafc;
    --table-row-hover-bg: #e8f7f5;

    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --page-title-text-color: #0f172a;
    --input-focus-ring: rgba(27, 140, 129, .20);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden;
    zoom: var(--app-ui-zoom, 1);
}

@media print {
    html { zoom: 1 !important; }
}

.app-zoom-widget .app-zoom-trigger {
    min-height: 34px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.app-zoom-trigger-value { font-size: 0.75rem; }
.app-zoom-menu { width: min(260px, calc(100vw - 1rem)); z-index: 1300; }
.app-zoom-menu .form-range { accent-color: var(--color-primary); }

.auth-utility-controls {
    max-width: calc(100% - 2rem);
}

@media (max-width: 400px) {
    .topbar .app-zoom-trigger-value { display: none; }
    .auth-utility-controls { top: 12px; right: 12px; gap: 0.35rem; }
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    background: var(--color-bg-app);
    color: var(--color-text-base);
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: stretch;
    background: var(--color-bg-app);
    overflow-x: hidden;
}

.content-area {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    transition: width .28s ease, padding .28s ease;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2.5rem);
}

main.content-area > .container-fluid {
    min-width: 0;
    padding-bottom: 2.5rem;
}

@media (max-width: 991.98px) {
    .content-area {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem) !important;
    }
    main.content-area > .container-fluid {
        padding-bottom: 5rem !important;
    }
}

.modal-dialog {
    margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 3rem);
}

.modal-footer {
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
}

.topbar {
    background: var(--header-bg);
    color: var(--header-text);
    min-height: 58px;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#sidebarToggle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

#sidebarToggle:hover,
#sidebarToggle:focus-visible {
    background: #f1f5f9;
    color: var(--color-primary);
    transform: scale(1.03);
}

.header-breadcrumb {
    font-size: .8rem;
}
.header-breadcrumb a {
    color: var(--color-text-muted);
    font-weight: 500;
}
.header-breadcrumb a:hover {
    color: var(--color-primary);
}
.header-breadcrumb .active {
    color: #0f172a;
    font-weight: 600;
}

.header-search-box {
    position: relative;
    max-width: 320px;
}
.header-search-box input {
    width: 260px;
    padding: .45rem 1rem .45rem 2.3rem;
    font-size: .82rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: width .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.header-search-box input:focus {
    width: 310px;
    background: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem var(--input-focus-ring);
    outline: none;
}
.header-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    font-size: .85rem;
}

.card {
    background: var(--color-card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-card);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
}
.card-title {
    color: var(--color-text-heading);
}

.page-title,
.section-title,
.title-accent {
    color: var(--page-title-text-color);
    font-weight: 700;
    letter-spacing: -.02em;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-heading);
}

.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6,
.text-white .page-title, .text-white .card-title, .text-white .modal-title,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-primary .page-title, .bg-primary .card-title, .bg-primary .modal-title,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-secondary h1, .bg-secondary h2, .bg-secondary h3, .bg-secondary h4, .bg-secondary h5, .bg-secondary h6,
.bg-success h1, .bg-success h2, .bg-success h3, .bg-success h4, .bg-success h5, .bg-success h6,
h1.text-white, h2.text-white, h3.text-white, h4.text-white, h5.text-white, h6.text-white,
h1.text-light, h2.text-light, h3.text-light, h4.text-light, h5.text-light, h6.text-light {
    color: #fff !important;
}

.text-muted,
.text-muted-80 {
    color: #475569 !important;
}

.table,
table {
    border-collapse: separate !important;
    border-spacing: 0;
}

.table thead th,
table thead th,
.table-responsive table thead th,
#queryTable thead th,
.pos-layout table thead th,
.grv-section table thead th {
    background-color: var(--table-header-bg) !important;
    color: var(--table-header-text) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .05em;
    padding: .75rem 1rem;
    border-bottom: 2px solid #cbd5e1 !important;
    border-top: 0 !important;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--table-row-even-bg);
}
.table-hover > tbody > tr:hover > * {
    background-color: var(--table-row-hover-bg);
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-card);
    border: 1px solid #e2e8f0;
    background: #fff;
    margin-bottom: 1rem;
}
.table-responsive::-webkit-scrollbar { height: 6px; width: 6px; }
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.table-responsive::-webkit-scrollbar-track { background: #f8fafc; }

.form-control,
.form-select {
    background: var(--input-bg);
    border-color: var(--input-border);
    border-radius: var(--border-radius-base);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem var(--input-focus-ring);
}

.badge { border-radius: 999px; }

.btn {
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: var(--border-radius-base);
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-primary-hover) !important;
    border-color: var(--color-primary-hover) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px var(--input-focus-ring) !important;
}
.btn-secondary {
    background-color: var(--color-secondary) !important;
    border-color: var(--color-secondary) !important;
    color: #fff !important;
}
.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--color-secondary-hover) !important;
    border-color: var(--color-secondary-hover) !important;
}
.btn-light,
.btn-white {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
.btn-light:hover,
.btn-white:hover {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
.btn-outline-primary {
    border: 2px solid var(--color-primary) !important;
    color: var(--color-primary) !important;
    background: transparent !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--color-primary) !important;
    color: #fff !important;
}
.btn-outline-secondary {
    border: 2px solid var(--color-secondary) !important;
    color: var(--color-secondary) !important;
    background: transparent !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--color-secondary) !important;
    color: #fff !important;
}
.btn:disabled,
.btn.disabled {
    opacity: .65 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

.text-primary { color: var(--color-primary) !important; }
.bg-primary { background-color: var(--color-primary) !important; }
.border-primary { border-color: var(--color-primary) !important; }
.bg-primary-light,
.bg-primary-subtle { background-color: var(--color-primary-light) !important; }
.border-primary-subtle { border-color: color-mix(in srgb, var(--color-primary) 20%, #fff) !important; }
.table-primary { --bs-table-bg: var(--color-primary-light); }
.teal-accent { color: var(--color-primary); }
.orange-accent { color: var(--color-secondary); }

.stat-card {
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.auth-layout-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at top right, rgba(0, 61, 61, .08), transparent 40%),
        radial-gradient(circle at bottom left, rgba(249, 115, 22, .06), transparent 40%),
        #f1f5f9;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
body.sidebar-mobile-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.sidebar-footer {
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

/* ==========================================================================
   Shared 3-level ERP sidebar navigation
   ========================================================================== */

/* ==========================================================================
   ENTERPRISE ERP 3-LEVEL SIDEBAR NAVIGATION COMPONENT STYLES
   Self-contained scoped rules: immune to external cache lag, CDN, or CSS conflicts.
   ========================================================================== */
.sidebar,
#mainSidebar {
    width: 17.5rem;
    min-width: 17.5rem;
    max-width: 17.5rem;
    height: 100vh;
    min-height: 100vh;
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.03);
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* Ensure no bullet styles or unwanted lists */
#sidebarNav,
#sidebarNav ul,
#sidebarNav li,
.erp-nav-item-level1,
.erp-nav-item-level2,
.erp-nav-item-level3,
.erp-level2-wrapper,
.erp-level3-wrapper {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
}

/* Fallback collapse display rules independent of external framework */
#sidebarNav .collapse:not(.show) {
    display: none !important;
}
#sidebarNav .collapse.show {
    display: block !important;
}
#sidebarNav .collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.22s ease;
}

/* Brand area */
.sidebar-brand {
    border-bottom: 1px solid #f1f5f9;
    background-color: #ffffff;
    flex-shrink: 0;
}
.sidebar-tagline {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

/* Search input container */
.sidebar-search-wrapper {
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 10;
    flex-shrink: 0;
}

/* Scrollable container */
#sidebarNav {
    flex: 1 1 auto;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 1.5rem;
}
#sidebarNav::-webkit-scrollbar {
    width: 4px;
}
#sidebarNav::-webkit-scrollbar-track {
    background: transparent;
}
#sidebarNav::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
#sidebarNav::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* ==========================================================================
   LEVEL 1: Primary Module Menu Items (Clear, Bold, Prominent)
   ========================================================================== */
.erp-nav-item-level1 {
    position: relative;
    margin-bottom: 3px;
}
.erp-nav-link-level1 {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.58rem 0.85rem !important;
    margin: 0.15rem 0.5rem !important;
    border-radius: 8px !important;
    color: #1e293b !important;
    font-weight: 600 !important;
    font-size: 0.94rem !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    user-select: none;
    cursor: pointer;
    border-left: 3.5px solid transparent !important;
    background-color: transparent;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease !important;
    box-sizing: border-box;
}
.erp-nav-link-level1:hover,
.erp-nav-link-level1:focus-visible {
    color: #0f172a !important;
    background-color: #f1f5f9 !important;
    text-decoration: none !important;
}
.erp-nav-link-level1.active {
    color: var(--color-primary) !important;
    background-color: var(--color-primary-light) !important;
    border-left-color: var(--color-primary) !important;
    font-weight: 700 !important;
}
.erp-nav-link-level1.has-active-child {
    color: var(--color-primary) !important;
    background-color: #f8fafc !important;
    border-left-color: color-mix(in srgb, var(--color-primary) 45%, #cbd5e1) !important;
    font-weight: 650 !important;
}

.erp-nav-icon-box-level1 {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    font-size: 1.05rem !important;
    flex-shrink: 0;
    transition: all 0.16s ease !important;
}
.erp-nav-link-level1:hover .erp-nav-icon-box-level1 {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}
.erp-nav-link-level1.active .erp-nav-icon-box-level1,
.erp-nav-link-level1.has-active-child .erp-nav-icon-box-level1 {
    background-color: color-mix(in srgb, var(--color-primary) 12%, #ffffff) !important;
    color: var(--color-primary) !important;
}

.erp-nav-chevron {
    margin-left: auto !important;
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.16s ease !important;
}
.erp-nav-link-level1:not(.collapsed) .erp-nav-chevron,
.erp-nav-link-level1[aria-expanded="true"] .erp-nav-chevron {
    transform: rotate(90deg) !important;
    color: var(--color-primary) !important;
}

/* ==========================================================================
   LEVEL 2: Functional Submenu Groups (Distinct Steel Blue/Slate Hierarchy)
   ========================================================================== */
.erp-level2-wrapper {
    margin: 3px 0.5rem 6px 1.4rem !important;
    padding: 3px 0 3px 10px !important;
    border-left: 2px solid #cbd5e1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
}
.erp-nav-item-level2 {
    position: relative;
}
.erp-nav-link-level2 {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    padding: 0.48rem 0.75rem !important;
    border-radius: 6px !important;
    color: #334155 !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    text-decoration: none !important;
    line-height: 1.35 !important;
    user-select: none;
    cursor: pointer;
    border-left: 2.5px solid transparent !important;
    background-color: transparent;
    transition: all 0.16s ease-in-out !important;
    box-sizing: border-box;
}
.erp-nav-link-level2:hover,
.erp-nav-link-level2:focus-visible {
    color: #0f172a !important;
    background-color: #f1f5f9 !important;
    text-decoration: none !important;
}
.erp-nav-link-level2.active {
    color: var(--color-primary) !important;
    background-color: var(--color-primary-light) !important;
    border-left-color: var(--color-primary) !important;
    font-weight: 650 !important;
}
.erp-nav-link-level2.has-active-child {
    color: var(--color-primary) !important;
    background-color: #f8fafc !important;
    font-weight: 650 !important;
}
.erp-nav-icon-level2 {
    font-size: 0.95rem !important;
    color: var(--color-primary) !important;
    width: 18px !important;
    text-align: center !important;
    flex-shrink: 0;
    transition: color 0.16s ease !important;
}
.erp-nav-link-level2:hover .erp-nav-icon-level2,
.erp-nav-link-level2.active .erp-nav-icon-level2,
.erp-nav-link-level2.has-active-child .erp-nav-icon-level2 {
    color: var(--color-primary) !important;
}
.erp-nav-chevron-level2 {
    margin-left: auto !important;
    font-size: 0.70rem !important;
    color: #94a3b8 !important;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.16s ease !important;
}
.erp-nav-link-level2:not(.collapsed) .erp-nav-chevron-level2,
.erp-nav-link-level2[aria-expanded="true"] .erp-nav-chevron-level2 {
    transform: rotate(90deg) !important;
    color: var(--color-primary) !important;
}

/* ==========================================================================
   LEVEL 3: Action Links (Crisp, High-Contrast, Perfectly Legible)
   ========================================================================== */
.erp-level3-wrapper {
    margin: 2px 0 4px 12px !important;
    padding: 2px 0 2px 10px !important;
    border-left: 1.5px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}
.erp-nav-item-level3 {
    position: relative;
}
.erp-nav-link-level3 {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 0.42rem 0.7rem !important;
    border-radius: 6px !important;
    color: #475569 !important;
    font-weight: 500 !important;
    font-size: 0.84rem !important;
    text-decoration: none !important;
    line-height: 1.35 !important;
    user-select: none;
    border-left: 2px solid transparent !important;
    background-color: transparent;
    transition: all 0.15s ease-in-out !important;
    box-sizing: border-box;
}
.erp-nav-link-level3:hover,
.erp-nav-link-level3:focus-visible {
    color: var(--color-primary) !important;
    background-color: #f1f5f9 !important;
    padding-left: 0.85rem !important;
    text-decoration: none !important;
}
.erp-nav-link-level3.active {
    color: var(--color-primary) !important;
    background-color: var(--color-primary-light) !important;
    font-weight: 600 !important;
    border-left-color: var(--color-primary) !important;
    padding-left: 0.85rem !important;
}
.erp-nav-icon-level3 {
    font-size: 0.82rem !important;
    color: #64748b !important;
    width: 14px !important;
    text-align: center !important;
    flex-shrink: 0;
    transition: color 0.15s ease !important;
}
.erp-nav-link-level3:hover .erp-nav-icon-level3,
.erp-nav-link-level3.active .erp-nav-icon-level3 {
    color: var(--color-primary) !important;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    flex-shrink: 0;
}

/* Desktop Collapsed State */
.sidebar-collapsed .sidebar,
.sidebar-collapsed #mainSidebar {
    width: 5.5rem !important;
    min-width: 5.5rem !important;
    max-width: 5.5rem !important;
}
.sidebar-collapsed .sidebar .sidebar-brand .text-truncate,
.sidebar-collapsed .sidebar .sidebar-search-wrapper,
.sidebar-collapsed .sidebar .nav-label,
.sidebar-collapsed .sidebar .erp-nav-chevron,
.sidebar-collapsed .sidebar .badge,
.sidebar-collapsed .sidebar .erp-level2-wrapper,
.sidebar-collapsed .sidebar .sidebar-footer .d-flex {
    display: none !important;
    opacity: 0 !important;
}
.sidebar-collapsed .sidebar .erp-nav-link-level1 {
    justify-content: center !important;
    padding: 0.65rem 0 !important;
    margin: 0.2rem 0.4rem !important;
}
.sidebar-collapsed .sidebar .erp-nav-icon-box-level1 {
    margin: 0 !important;
}
.sidebar-collapsed .sidebar .collapse.show {
    display: none !important;
}

/* Mobile & Tablet Responsive Off-canvas */
@media (max-width: 991.98px) {
    .sidebar,
    #mainSidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -100% !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 1060 !important;
        box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25) !important;
    }
    body.sidebar-mobile-open .sidebar,
    body.sidebar-mobile-open #mainSidebar {
        left: 0 !important;
    }
    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(15, 23, 42, 0.55) !important;
        backdrop-filter: blur(3px) !important;
        z-index: 1050 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    body.sidebar-mobile-open .sidebar-overlay {
        opacity: 1 !important;
        visibility: visible !important;
    }
    body.sidebar-mobile-open {
        overflow: hidden !important;
    }
}


/* Small utility aliases used by the existing ERP templates. */
.text-xs { font-size: .75rem !important; }
.text-sm { font-size: .875rem !important; }
.text-md { font-size: 1rem !important; }
.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-500 { color: #64748b !important; }
.text-slate-600 { color: #475569 !important; }
.text-slate-700 { color: #334155 !important; }
.text-slate-800 { color: #1e293b !important; }
.text-slate-900 { color: #0f172a !important; }
.text-slate-950 { color: #020617 !important; }
.bg-light-subtle { background-color: #f8fafc !important; }
.rounded-4 { border-radius: 1rem !important; }
.rounded-5 { border-radius: 1.25rem !important; }
.px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
.py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.py-10 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.py-12 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.py-16 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
.py-20 { padding-top: 5rem !important; padding-bottom: 5rem !important; }

.kbd {
    background: #0f172a;
    color: #fff;
    padding: .15rem .4rem;
    border-radius: .35rem;
    font-size: .8rem;
}

/* POS terminal shared geometry. Page-specific POS CSS can refine this. */
.pos-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 340px;
    gap: 0;
    min-height: 0;
}
.pos-products-section,
.pos-cart-section { min-height: 0; }
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding: .2rem .2rem 2rem;
}
.pos-product-card {
    background: var(--color-card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-card);
    padding: .75rem;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}
.pos-product-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(27, 140, 129, .15);
    transform: translateY(-3px);
}
.pos-product-card:active { transform: translateY(1px); }
.cart-item { transition: background-color .2s ease; }
.cart-item:hover { background-color: var(--table-row-hover-bg); }
.cart-qty-ctrl { display: flex; align-items: center; }
.cart-qty-ctrl .btn { padding: .1rem .4rem; line-height: 1; }
.category-filters::-webkit-scrollbar { height: 4px; }
.category-filters::-webkit-scrollbar-thumb { background-color: var(--input-border); border-radius: 4px; }

@media (max-width: 991.98px) {
    .topbar { padding-left: 1rem !important; padding-right: 1rem !important; }
    .container-fluid { padding-left: 1rem; padding-right: 1rem; }
    .table-responsive > .table,
    .table-responsive > table { min-width: 620px; }
    .table-responsive > .table-report,
    .table-responsive > #grvItems,
    .table-responsive > #transferItems,
    .table-responsive > #worksheetTable,
    .table-responsive > #salesTable,
    .table-responsive > #inventoryTable { min-width: 760px; }
    .card-body:has(.table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .header-search-box { max-width: 220px; }
    .header-search-box input,
    .header-search-box input:focus { width: min(220px, 44vw); }
    .pos-layout { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
    .text-md-start { text-align: left !important; }
    .text-md-end { text-align: right !important; }
}

.navbar-user-dropdown {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    z-index: 1060;
}
.navbar-user-dropdown .dropdown-item {
    padding: .6rem 1.2rem;
    font-size: .85rem;
    font-weight: 500;
    color: #334155;
}
.navbar-user-dropdown .dropdown-item:hover {
    background: #f8fafc;
    color: var(--color-secondary);
}

.profile-initial-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .88rem;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* Google Translate cleanup */
#google_translate_element,
.skiptranslate,
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
}
body { top: 0 !important; }
.goog-logo-link { display: none !important; }
.goog-te-gadget { color: transparent !important; }
.goog-te-gadget-simple { background: transparent !important; border: 0 !important; }
.goog-text-highlight { background: transparent !important; box-shadow: none !important; }

@media print {
    header.topbar,
    aside.sidebar,
    .sidebar-overlay,
    .d-print-none,
    .no-print,
    .btn,
    .alert,
    form,
    #sidebarToggle,
    .header-search-box,
    .breadcrumb,
    .card-actions,
    .card-header .btn,
    .modal-footer {
        display: none !important;
    }
    html, body {
        background: #fff !important;
        color: #000 !important;
        font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
        font-size: 11pt !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .app-shell {
        display: block !important;
        min-height: 0 !important;
        max-width: none !important;
        background: none !important;
    }
    main.content-area {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: block !important;
    }
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-bottom: 20px !important;
    }
    .card-header {
        background: transparent !important;
        border-bottom: 1px solid #111 !important;
        padding: 10px 0 !important;
        margin-bottom: 10px !important;
    }
    .card-body { padding: 0 !important; }
    @page { size: A4 portrait; margin: 15mm; }
    .table, table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 20px !important;
    }
    .table thead th,
    table thead th {
        background-color: var(--color-primary) !important;
        color: #fff !important;
        border: 1px solid #000 !important;
        font-size: 9pt !important;
        padding: 6px !important;
    }
    .table td,
    table td {
        border: 1px solid #ddd !important;
        font-size: 8pt !important;
        padding: 6px !important;
        background: transparent !important;
    }
}

.mobile-title-container { max-width: 90px; }
@media (min-width: 400px) { .mobile-title-container { max-width: 140px; } }
@media (min-width: 576px) { .mobile-title-container { max-width: 220px; } }
@media (min-width: 768px) { .mobile-title-container { max-width: 320px; } }
