:root{
  --card-radius: 18px;
  --shadow: 0 14px 34px rgba(16, 24, 40, .08);
  --shadow-hover: 0 18px 45px rgba(16, 24, 40, .12);
  --border: 1px solid rgba(16, 24, 40, .08);

  --accent-1: #6d5efc;
  --accent-2: #20c997;
  --accent-3: #ff7a59;
  --accent-4: #0dcaf0;
}

/* page */
body{
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background:
    radial-gradient(1200px 500px at 20% 0%, rgba(109, 94, 252, .14), transparent 60%),
    radial-gradient(900px 420px at 80% 10%, rgba(32, 201, 151, .12), transparent 55%),
    linear-gradient(180deg, #f7f8ff 0%, #f6fbff 40%, #f7fffb 100%);
}

/* navbar */
.navbar.bg-dark{
  background: linear-gradient(135deg, rgba(109, 94, 252, 1), rgba(13, 110, 253, 1)) !important;
}
.navbar .nav-link{
  opacity: .95;
  transition: opacity .15s ease, transform .15s ease;
}
.navbar .nav-link:hover{
  opacity: 1;
  transform: translateY(-1px);
}
.navbar .navbar-brand{
  letter-spacing: .2px;
}

/* cards */
.card{
  border-radius: var(--card-radius);
  border: var(--border);
  box-shadow: var(--shadow);
}
.card.kpi{
  transition: transform .15s ease, box-shadow .15s ease;
}
.card.kpi:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.kpi{
  min-height: 112px;
}
.kpi .icon{
  width: 48px;
  height: 48px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 16px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
}

/* KPI variants */
.kpi.bg-dark{
  background: linear-gradient(135deg, var(--accent-1), #0d6efd) !important;
}
.kpi .icon.bg-success{ background: linear-gradient(135deg, #20c997, #198754) !important; }
.kpi .icon.bg-primary{ background: linear-gradient(135deg, #6d5efc, #0d6efd) !important; }
.kpi .icon.bg-info{ background: linear-gradient(135deg, #0dcaf0, #0d6efd) !important; }
.kpi .icon.bg-warning{ background: linear-gradient(135deg, #ffc107, #ff7a59) !important; }
.kpi .icon.bg-danger{ background: linear-gradient(135deg, #ff4d6d, #dc3545) !important; }

/* badges */
.badge-soft{
  background: rgba(109, 94, 252, .14);
  color: #3b2ff8;
  border: 1px solid rgba(109, 94, 252, .18);
}
.navbar .badge-soft{
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
}

/* normal tables only */
.table:not(.sheet-table) thead th{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  z-index: 2;
  border-bottom: 1px solid rgba(16, 24, 40, .08);
}

/* buttons */
.btn-dark{
  border: none;
  background: linear-gradient(135deg, var(--accent-1), #0d6efd);
  box-shadow: 0 10px 24px rgba(13, 110, 253, .18);
}
.btn-dark:hover{
  filter: brightness(1.02);
}
.btn-outline-dark{
  border-color: rgba(16, 24, 40, .18);
}
.btn-outline-dark:hover{
  background: rgba(109, 94, 252, .10);
  border-color: rgba(109, 94, 252, .28);
  color: #1c1c1c;
}

/* inputs */
.form-control:focus,
.form-select:focus{
  border-color: rgba(109, 94, 252, .45);
  box-shadow: 0 0 0 .25rem rgba(109, 94, 252, .16);
}

/* brand dot */
.brand-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  display:inline-block;
  box-shadow: 0 0 0 4px rgba(255, 122, 89, .14);
}




/* v2.7.2 compact tenant navigation */
.tenant-mega-menu{
  width:min(920px,calc(100vw - 2rem));
  max-height:calc(100vh - 90px);
  overflow-y:auto;
  border:0;
  box-shadow:0 18px 45px rgba(16,24,40,.18);
}
.tenant-operations-menu{width:min(860px,calc(100vw - 2rem));}
.tenant-menu-heading{
  font-size:.76rem;
  font-weight:700;
  color:#667085;
  letter-spacing:.04em;
  text-transform:uppercase;
  padding:.35rem .75rem .45rem;
  border-bottom:1px solid rgba(16,24,40,.08);
  margin-bottom:.35rem;
}
.tenant-mega-menu .dropdown-item{
  border-radius:.45rem;
  padding:.42rem .75rem;
  white-space:normal;
}
.tenant-mega-menu .dropdown-item:hover{background:rgba(109,94,252,.09);}
.workflow-choice{cursor:pointer;transition:.15s ease;}
.workflow-choice:hover{background:rgba(109,94,252,.05);}
@media (max-width:991.98px){
  .tenant-mega-menu,.tenant-operations-menu{width:100%;max-height:none;box-shadow:none;border:1px solid rgba(255,255,255,.12);}
  .tenant-menu-heading{color:#344054;background:#f8f9fa;border-radius:.4rem;}
}

/* v2.7.2.1 responsive tenant menu hotfix
   Bootstrap column breakpoints are viewport-based, not dropdown-width-based.
   The menu therefore uses its own container-responsive grid to prevent overlap. */
@media (min-width: 992px){
  .tenant-mega-menu{
    width:min(920px,calc(100vw - 2rem));
    min-width:min(920px,calc(100vw - 2rem));
    max-width:calc(100vw - 2rem);
    padding:1rem !important;
  }
  .tenant-operations-menu{
    width:min(860px,calc(100vw - 2rem));
    min-width:min(860px,calc(100vw - 2rem));
  }
}

/* Replace Bootstrap's fixed responsive columns inside mega menus. */
.tenant-mega-menu > .row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(195px,1fr));
  gap:1rem;
  margin:0;
}
.tenant-mega-menu > .row > [class*="col-"]{
  width:auto;
  max-width:none;
  min-width:0;
  padding:0;
}
.tenant-mega-menu .tenant-menu-heading{
  display:flex;
  align-items:center;
  gap:.45rem;
  white-space:normal;
  line-height:1.25;
}
.tenant-mega-menu .dropdown-item{
  display:block;
  width:100%;
  min-width:0;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.3;
}

/* Operations has two main sections; nested item columns stay responsive. */
.tenant-operations-menu > .row{
  grid-template-columns:repeat(auto-fit,minmax(330px,1fr));
}
.tenant-operations-menu > .row > [class*="col-"] > .row{
  margin-left:0;
  margin-right:0;
}
.tenant-operations-menu > .row > [class*="col-"] > .row > [class*="col-"]{
  min-width:0;
}

@media (max-width: 991.98px){
  .tenant-mega-menu > .row,
  .tenant-operations-menu > .row{
    grid-template-columns:1fr;
    gap:.5rem;
  }
  .tenant-mega-menu{
    overflow:visible;
  }
}

@media (max-width: 575.98px){
  .tenant-operations-menu > .row > [class*="col-"] > .row{
    display:grid;
    grid-template-columns:1fr;
  }
  .tenant-operations-menu > .row > [class*="col-"] > .row > [class*="col-"]{
    width:auto;
    max-width:none;
  }
}

/* v2.7.3 server-side searchable purchasing selectors */
.erp-remote-native{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
}
.erp-remote-select{min-width:0;}
.erp-remote-select .input-group{flex-wrap:nowrap;}
.erp-remote-input{padding-right:2.6rem;}
.erp-remote-clear{min-width:2.45rem;}
.erp-remote-loading{
  position:absolute;
  right:3rem;
  top:50%;
  transform:translateY(-50%);
  z-index:5;
  display:flex;
  align-items:center;
  color:var(--bs-secondary-color);
  pointer-events:none;
}
.erp-remote-menu{
  position:absolute;
  z-index:1080;
  left:0;
  right:0;
  top:calc(100% + .25rem);
  max-height:320px;
  overflow:auto;
  background:#fff;
  border:1px solid var(--bs-border-color);
  border-radius:.5rem;
  padding:.35rem;
}
.erp-remote-option{
  display:flex;
  flex-direction:column;
  width:100%;
  border:0;
  background:transparent;
  text-align:left;
  border-radius:.35rem;
  padding:.55rem .65rem;
  color:var(--bs-body-color);
}
.erp-remote-option:hover,.erp-remote-option.active{
  background:var(--bs-tertiary-bg);
}
.erp-remote-option-label{font-weight:600;line-height:1.25;}
.erp-remote-option-description{font-size:.78rem;color:var(--bs-secondary-color);margin-top:.15rem;line-height:1.25;}
.erp-remote-message{padding:.75rem;font-size:.875rem;}
.erp-remote-select.loading .erp-remote-input{padding-right:4.7rem;}
.purchase-line-lookup{min-width:290px;}
@media (max-width:767.98px){
  .erp-remote-menu{position:fixed;left:.75rem;right:.75rem;top:50%;bottom:auto;transform:translateY(-50%);max-height:55vh;}
}

/* v3.0.2 searchable/live-refresh sales selectors */
.erp-remote-refresh{min-width:2.45rem;}
.erp-remote-select.has-refresh .erp-remote-loading{right:5.5rem;}
.erp-lookup-actions{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap;}

/* v3.1.0 Help Center and guided tutorials */
.erp-context-help{
  position:fixed;
  right:1rem;
  bottom:1rem;
  z-index:1045;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:.5rem;
}
.erp-context-help .btn{display:flex;align-items:center;gap:.5rem;border-radius:999px;}
.help-guide-card{transition:transform .15s ease,box-shadow .15s ease;}
.help-guide-card:hover{transform:translateY(-2px);box-shadow:0 .75rem 1.5rem rgba(15,23,42,.12)!important;}
.help-checklist-card{display:block;border:1px solid var(--bs-border-color);border-radius:.75rem;padding:1rem;color:var(--bs-body-color);background:var(--bs-body-bg);}
.help-checklist-card:hover{border-color:var(--bs-primary);}
.help-article-section{margin-top:2.25rem;}
.help-article-section h2{font-size:1.25rem;margin-bottom:1rem;}
.help-steps{list-style:none;padding:0;margin:0;display:grid;gap:1rem;}
.help-steps li{display:flex;gap:1rem;align-items:flex-start;padding:1rem;border:1px solid var(--bs-border-color);border-radius:.75rem;background:var(--bs-tertiary-bg);}
.help-step-number{flex:0 0 2rem;width:2rem;height:2rem;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--bs-primary);color:#fff;font-weight:700;}
.erp-help-overlay{position:fixed;inset:0;background:rgba(15,23,42,.56);z-index:2000;}
.erp-help-highlight{position:relative!important;z-index:2002!important;outline:4px solid rgba(var(--bs-primary-rgb),.9)!important;outline-offset:5px!important;border-radius:.35rem;box-shadow:0 0 0 9999px rgba(15,23,42,0)!important;}
.erp-help-tour-panel{position:fixed;z-index:2003;width:min(390px,calc(100vw - 2rem));background:#fff;color:#212529;border-radius:1rem;padding:1.25rem;}
.erp-help-tour-open{overflow:hidden;}
.manual-category{margin-top:3rem;padding-bottom:.5rem;border-bottom:2px solid var(--bs-primary);page-break-after:avoid;}
.manual-guide{padding:1.5rem 0;border-bottom:1px solid var(--bs-border-color);page-break-inside:avoid;}
.manual-guide h3{font-size:1.25rem;}
.manual-guide h4{font-size:1rem;margin-top:1rem;}
.manual-contents{columns:2;column-gap:2rem;border:1px solid var(--bs-border-color);border-radius:.75rem;padding:1.25rem;}
.manual-contents h2,.manual-contents h3{column-span:all;}
.manual-contents h3{font-size:1rem;margin:1rem 0 .35rem;}
.manual-contents a{display:block;break-inside:avoid;padding:.15rem 0;text-decoration:none;}
@media (max-width:575.98px){
  .erp-context-help .btn span{display:none;}
  .erp-context-help .btn{width:3rem;height:3rem;justify-content:center;padding:0;}
}
@media print{
  body{background:#fff!important;}
  nav.navbar,footer,.erp-context-help,.toast-container,.erp-sidebar,.erp-topbar,.erp-breadcrumb-bar,.erp-sidebar-backdrop{display:none!important;}
  .erp-app-shell,.erp-main-shell{display:block!important;min-height:0!important;}
  main{padding:0!important;}
  .help-manual .card{box-shadow:none!important;border:0!important;}
  .manual-guide{font-size:10.5pt;page-break-inside:auto;}
  .manual-guide h3,.manual-guide h4{page-break-after:avoid;}
  .manual-contents{columns:1;border:0;padding:0;}
  .manual-category{page-break-before:always;}
}

/* v3.3.0 viewport-safe tenant navigation
   Desktop mega menus use the navbar container as their positioning boundary.
   They always start from the left side of the navigation area and never extend
   beyond the viewport, regardless of which menu toggle was clicked. */
@media (min-width: 992px){
  .navbar > .container-fluid{
    position:relative;
  }
  .tenant-primary-nav .tenant-mega-dropdown{
    position:static;
  }
  .tenant-primary-nav .tenant-mega-dropdown > .tenant-mega-menu{
    position:absolute!important;
    top:calc(100% + .35rem)!important;
    left:1rem!important;
    right:1rem!important;
    bottom:auto!important;
    inset-inline-start:1rem!important;
    inset-inline-end:1rem!important;
    transform:none!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    max-height:calc(100vh - 5.5rem);
    overflow-x:hidden;
    overflow-y:auto;
  }
}

@media (max-width: 991.98px){
  .tenant-primary-nav .tenant-mega-dropdown > .tenant-mega-menu{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:.25rem 0 .5rem!important;
  }
}


/* v3.4.0 central notifications */
.notification-nav .nav-link{min-width:2.6rem;text-align:center;}
.notification-count{font-size:.62rem;line-height:1;padding:.3rem .38rem;margin-top:.28rem;margin-left:-.2rem;}
.notification-dropdown{width:min(390px,calc(100vw - 1.5rem));max-height:70vh;overflow:auto;}
.notification-preview-item{white-space:normal;padding:.75rem 1rem;border-bottom:1px solid var(--bs-border-color-translucent);}
.notification-preview-item small{line-height:1.3;margin-top:.2rem;}
.notification-card{transition:border-color .15s ease,box-shadow .15s ease;}
.notification-card.notification-unread{border-left:4px solid var(--bs-primary);box-shadow:0 .25rem .75rem rgba(15,23,42,.06);}
.notification-icon{flex:0 0 2.6rem;width:2.6rem;height:2.6rem;border-radius:.7rem;display:flex;align-items:center;justify-content:center;}
.min-w-0{min-width:0;}
@media(max-width:575.98px){.notification-dropdown{position:fixed!important;left:.75rem!important;right:.75rem!important;top:4.25rem!important;width:auto!important;max-height:75vh;transform:none!important;}}

/* v3.16.1 workspace navigation and information architecture */
:root{
  --erp-sidebar-width: 276px;
  --erp-sidebar-collapsed-width: 78px;
  --erp-topbar-height: 68px;
  --erp-sidebar-bg: #111827;
  --erp-sidebar-text: #d1d5db;
  --erp-sidebar-muted: #9ca3af;
  --erp-sidebar-active: rgba(109,94,252,.24);
}
.erp-workspace-body{min-height:100vh;background:#f5f7fb;overflow-x:hidden;}
.erp-app-shell{min-height:100vh;display:flex;}
.erp-sidebar{
  position:fixed;inset:0 auto 0 0;width:var(--erp-sidebar-width);z-index:1040;
  display:flex;flex-direction:column;background:linear-gradient(180deg,#111827 0%,#172033 100%);
  color:var(--erp-sidebar-text);box-shadow:12px 0 35px rgba(15,23,42,.12);transition:width .2s ease,transform .2s ease;
}
.erp-sidebar-header{height:var(--erp-topbar-height);display:flex;align-items:center;justify-content:space-between;padding:0 1rem;border-bottom:1px solid rgba(255,255,255,.08);}
.erp-brand{display:flex;align-items:center;gap:.75rem;color:#fff;text-decoration:none;min-width:0;}
.erp-brand:hover{color:#fff;}
.erp-brand-text{display:flex;flex-direction:column;min-width:0;line-height:1.2;}
.erp-brand-text strong{white-space:nowrap;}
.erp-brand-text small{color:var(--erp-sidebar-muted);max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:.18rem;}
.erp-sidebar-close{color:#fff;border:1px solid rgba(255,255,255,.14);}
.erp-sidebar-nav{flex:1;overflow-y:auto;overflow-x:hidden;padding:.8rem .65rem;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent;}
.erp-sidebar-link,.erp-sidebar-sublink{display:flex;align-items:center;gap:.8rem;color:var(--erp-sidebar-text);text-decoration:none;border-radius:.7rem;transition:background .15s ease,color .15s ease;}
.erp-sidebar-link{min-height:44px;padding:.65rem .8rem;font-weight:600;}
.erp-sidebar-link>i{width:1.35rem;text-align:center;flex:0 0 1.35rem;}
.erp-sidebar-link:hover,.erp-sidebar-link.active{background:var(--erp-sidebar-active);color:#fff;}
.erp-sidebar-group{margin-bottom:.15rem;}
.erp-sidebar-group-row{display:flex;align-items:center;}
.erp-sidebar-expand{width:2.15rem;height:2.15rem;margin-right:.35rem;border:0;border-radius:.55rem;background:transparent;color:var(--erp-sidebar-muted);transition:transform .15s ease,background .15s ease;}
.erp-sidebar-expand:hover{background:rgba(255,255,255,.08);color:#fff;}
.erp-sidebar-expand[aria-expanded="true"] i{transform:rotate(180deg);}
.erp-sidebar-submenu{padding:.15rem 0 .45rem 2.2rem;}
.erp-sidebar-section{padding:.2rem 0;}
.erp-sidebar-section+.erp-sidebar-section{border-top:1px solid rgba(255,255,255,.07);margin-top:.2rem;padding-top:.4rem;}
.erp-sidebar-section-label{padding:.25rem .65rem .2rem;color:#94a3b8;font-size:.66rem;font-weight:700;letter-spacing:.075em;line-height:1.25;text-transform:uppercase;}
.erp-sidebar-sublink{min-height:36px;padding:.45rem .65rem;font-size:.875rem;color:var(--erp-sidebar-muted);}
.erp-sidebar-sublink>i{width:1.1rem;text-align:center;flex:0 0 1.1rem;}
.erp-sidebar-sublink:hover,.erp-sidebar-sublink.active{background:rgba(255,255,255,.08);color:#fff;}
.erp-sidebar-footer{padding:.7rem;border-top:1px solid rgba(255,255,255,.08);}
.erp-sidebar-footer .erp-sidebar-link{text-align:left;color:var(--erp-sidebar-muted);}
.erp-main-shell{width:calc(100% - var(--erp-sidebar-width));min-height:100vh;margin-left:var(--erp-sidebar-width);display:flex;flex-direction:column;transition:width .2s ease,margin-left .2s ease;}
.erp-topbar{height:var(--erp-topbar-height);z-index:1030;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0 1.25rem;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid rgba(15,23,42,.08);}
.erp-menu-toggle{display:none;width:42px;height:42px;align-items:center;justify-content:center;}
.erp-command-trigger{height:42px;width:min(430px,38vw);display:flex;align-items:center;gap:.7rem;border:1px solid rgba(15,23,42,.12);background:#f8fafc;color:#64748b;border-radius:.75rem;padding:0 .85rem;text-align:left;}
.erp-command-trigger:hover{background:#fff;border-color:rgba(109,94,252,.35);}
.erp-command-trigger span{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.erp-command-trigger kbd{font-size:.7rem;color:#64748b;background:#fff;border:1px solid #dbe2ea;box-shadow:none;}
.erp-topbar-action{height:42px;display:flex;align-items:center;gap:.45rem;}
.erp-topbar-icon{width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;}
.erp-user-menu{height:46px;display:flex;align-items:center;gap:.55rem;max-width:230px;border:0;background:transparent;}
.erp-user-avatar{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--accent-1),#0d6efd);color:#fff;font-weight:700;flex:0 0 34px;}
.erp-user-menu strong,.erp-user-menu small{max-width:145px;line-height:1.1;}
.erp-breadcrumb-bar{min-height:48px;display:flex;align-items:center;gap:1rem;padding:.45rem 1.5rem;background:#fff;border-bottom:1px solid rgba(15,23,42,.06);}
.erp-breadcrumb-bar nav{overflow:hidden;}
.erp-breadcrumb-bar .breadcrumb{font-size:.86rem;overflow:hidden;}
.erp-breadcrumb-bar .breadcrumb-item{min-width:0;max-width:240px;}
.erp-content{flex:1;min-width:0;}
.erp-page-container{padding-left:1.5rem;padding-right:1.5rem;}
.erp-app-footer{margin-top:0!important;background:transparent;}
.erp-sidebar-backdrop{display:none;}
.erp-quick-create-menu{width:min(330px,calc(100vw - 1.5rem));max-height:70vh;overflow:auto;}
.erp-command-dialog{margin-top:6vh;}
#erpCommandResults .list-group-item{display:flex;align-items:center;gap:.85rem;border-radius:.65rem;margin-bottom:.2rem;border:0;padding:.75rem;}
#erpCommandResults .list-group-item.active{background:rgba(109,94,252,.12);color:inherit;}
.erp-command-result-icon,.erp-nav-tile-icon,.erp-recent-icon,.erp-work-icon{display:inline-flex;align-items:center;justify-content:center;border-radius:.7rem;flex:0 0 auto;}
.erp-command-result-icon{width:38px;height:38px;background:#eef2ff;color:#4f46e5;}
.erp-nav-tile-icon{width:42px;height:42px;background:#eef2ff;color:#4f46e5;}
.erp-recent-icon{width:36px;height:36px;background:#f1f5f9;color:#475569;}
.erp-work-icon{width:48px;height:48px;font-size:1.1rem;}
.erp-work-card{transition:transform .15s ease,box-shadow .15s ease;}
.erp-work-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-hover);}
.erp-favorite-card{display:flex;align-items:center;gap:.5rem;padding:.85rem;border:1px solid var(--bs-border-color);border-radius:.85rem;background:#fff;}
.erp-setup-section .list-group-item{border-left:0;border-right:0;}
.erp-setup-section .list-group-item:first-child{border-top:0;}

/* Compact desktop sidebar preserves labels as tooltips while keeping workspaces accessible. */
@media (min-width:992px){
  .erp-sidebar-collapsed .erp-sidebar{width:var(--erp-sidebar-collapsed-width);}
  .erp-sidebar-collapsed .erp-main-shell{width:calc(100% - var(--erp-sidebar-collapsed-width));margin-left:var(--erp-sidebar-collapsed-width);}
  .erp-sidebar-collapsed .erp-brand-text,.erp-sidebar-collapsed .erp-sidebar-link span,.erp-sidebar-collapsed .erp-sidebar-footer span,.erp-sidebar-collapsed .erp-sidebar-expand{display:none;}
  .erp-sidebar-collapsed .erp-sidebar-header{justify-content:center;}
  .erp-sidebar-collapsed .erp-sidebar-link{justify-content:center;padding:.65rem;}
  .erp-sidebar-collapsed .erp-sidebar-submenu{display:none!important;}
}

@media (max-width:991.98px){
  .erp-sidebar{width:min(310px,86vw);transform:translateX(-105%);}
  .erp-main-shell{width:100%;margin-left:0;}
  .erp-menu-toggle{display:inline-flex;}
  .erp-sidebar-open .erp-sidebar{transform:translateX(0);}
  .erp-sidebar-open .erp-sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(15,23,42,.52);z-index:1039;}
  .erp-command-trigger{width:42px;padding:0;justify-content:center;}
  .erp-command-trigger span,.erp-command-trigger kbd{display:none;}
  .erp-page-container{padding-left:1rem;padding-right:1rem;}
  .erp-breadcrumb-bar{padding-left:1rem;padding-right:1rem;}
}
@media (max-width:575.98px){
  .erp-topbar{padding:0 .65rem;gap:.35rem;}
  .erp-topbar-action{width:42px;padding:0;justify-content:center;}
  .erp-user-menu{padding:.35rem;}
  .erp-breadcrumb-bar .breadcrumb-item{max-width:145px;}
  .erp-page-container{padding-left:.75rem;padding-right:.75rem;}
  .erp-command-dialog{margin:.75rem;}
}
@media print{
  .erp-sidebar,.erp-topbar,.erp-breadcrumb-bar,.erp-sidebar-backdrop{display:none!important;}
  .erp-main-shell{width:100%!important;margin-left:0!important;}
  .erp-content{padding:0!important;}
}

/* v3.16.2 role-aware dashboard and actionable My Work queues */
.erp-role-dashboard .card,.erp-work-summary{border-color:var(--bs-border-color-translucent);box-shadow:0 8px 24px rgba(15,23,42,.045)}
.erp-dashboard-summary{border:0;overflow:hidden;position:relative}
.erp-dashboard-summary:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:currentColor;opacity:.7}
.erp-summary-primary{color:var(--bs-primary)}.erp-summary-danger{color:var(--bs-danger)}.erp-summary-warning{color:var(--bs-warning-text-emphasis)}
.erp-dashboard-summary .card-body{color:var(--bs-body-color)}
.erp-dashboard-summary-icon{width:54px;height:54px;border-radius:16px;display:inline-flex;align-items:center;justify-content:center;font-size:1.3rem;background:var(--bs-tertiary-bg);flex:0 0 auto}
.erp-metric-card,.erp-action-card{transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.erp-metric-card:hover,.erp-action-card:hover{transform:translateY(-2px);box-shadow:0 14px 30px rgba(15,23,42,.09)}
.erp-metric-icon,.erp-action-icon,.erp-queue-list-icon{width:42px;height:42px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;background:var(--bs-tertiary-bg)}
.erp-action-card{border-width:1px}
.erp-action-count{font-size:1.7rem;line-height:1;font-weight:700}
.erp-queue-group+.erp-queue-group{border-top:1px solid var(--bs-border-color)}
.erp-queue-group-heading{background:var(--bs-tertiary-bg)}
.erp-dashboard-preference-menu{min-width:270px}
.erp-empty-state{min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.erp-work-summary .erp-dashboard-summary-icon{background:transparent}
@media(max-width:767.98px){.erp-role-dashboard .display-6,.erp-work-summary .display-6{font-size:2rem}.erp-dashboard-preference-menu{min-width:min(270px,calc(100vw - 2rem))}}

/* v3.16.3 forms, tables, filters, mobile and accessibility consistency */
:root{
  --erp-focus-ring: 0 0 0 .25rem rgba(109,94,252,.28);
  --erp-control-min-height: 42px;
  --erp-table-mobile-label-width: minmax(8.5rem,40%);
}
html{scroll-padding-top:calc(var(--erp-topbar-height,68px) + 1rem);}
.erp-skip-link{
  position:fixed;left:1rem;top:.75rem;z-index:3000;transform:translateY(-160%);
  padding:.7rem 1rem;border-radius:.65rem;background:#111827;color:#fff;text-decoration:none;
  box-shadow:0 10px 25px rgba(15,23,42,.25);transition:transform .15s ease;
}
.erp-skip-link:focus{transform:translateY(0);color:#fff;}
#erpMainContent:focus{outline:0;}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid rgba(109,94,252,.72)!important;
  outline-offset:2px!important;
  box-shadow:var(--erp-focus-ring);
}
.form-control,.form-select,.btn:not(.btn-sm):not(.btn-lg){min-height:var(--erp-control-min-height);}
.form-check-input{min-width:1.1rem;min-height:1.1rem;}
.form-label{font-weight:600;color:#344054;margin-bottom:.4rem;}
.form-text{line-height:1.4;}
.erp-required-marker{color:var(--bs-danger);font-weight:700;}
[aria-invalid="true"]{border-color:var(--bs-danger)!important;box-shadow:0 0 0 .2rem rgba(var(--bs-danger-rgb),.12)!important;}
.erp-validation-summary{border-left:4px solid var(--bs-danger);margin-bottom:1rem;}
.erp-validation-summary .btn-link{text-decoration:underline;text-underline-offset:2px;}
.erp-page-header{
  padding-bottom:1rem;margin-bottom:1rem!important;border-bottom:1px solid var(--bs-border-color-translucent);
  align-items:flex-start!important;
}
.erp-page-header h1,.erp-page-header h2,.erp-page-header h3,.erp-page-header h4,.erp-page-header h5,.erp-page-header h6{letter-spacing:-.015em;}
.erp-page-header .btn{white-space:nowrap;}
.erp-filter-form{
  position:relative;padding:.9rem;border:1px solid var(--bs-border-color-translucent);border-radius:.85rem;
  background:var(--bs-tertiary-bg);margin-bottom:1rem;
}
.card .erp-filter-form{border-color:rgba(15,23,42,.08);box-shadow:none;}
.erp-filter-actions{display:flex!important;gap:.45rem;align-items:stretch;}
.erp-filter-actions>.btn,.erp-filter-actions>button,.erp-filter-actions>input[type="submit"]{flex:1 1 auto;}
.erp-filter-clear{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;white-space:nowrap;}
.erp-table-shell{border-radius:.75rem;scrollbar-width:thin;scrollbar-color:rgba(100,116,139,.5) transparent;}
.erp-table-shell:focus-within{box-shadow:inset 0 0 0 2px rgba(109,94,252,.12);}
.table.erp-table-enhanced{margin-bottom:0;}
.table.erp-table-enhanced>thead>tr>th{
  font-size:.78rem;letter-spacing:.025em;text-transform:uppercase;color:#475467;vertical-align:middle;
}
.table.erp-table-enhanced>tbody>tr>td,.table.erp-table-enhanced>tbody>tr>th{vertical-align:middle;}
.table.erp-table-enhanced>tbody>tr:hover{background:rgba(109,94,252,.035);}
.erp-action-cell{white-space:nowrap;}
.erp-action-cell .btn,.erp-action-cell form{margin:.1rem 0 .1rem .2rem;}
.erp-table-empty-row td,.erp-table-empty-row th{
  padding:2.5rem 1rem!important;text-align:center!important;color:var(--bs-secondary-color)!important;
  background:var(--bs-tertiary-bg);
}
.erp-table-empty-row td:before,.erp-table-empty-row th:before{display:none!important;}
.erp-density-compact{
  --erp-control-min-height:36px;
  --card-radius:13px;
}
.erp-density-compact .card-body,.erp-density-compact .card.p-3{padding:.75rem!important;}
.erp-density-compact .table>:not(caption)>*>*{padding:.42rem .5rem;}
.erp-density-compact .form-control,.erp-density-compact .form-select{padding-top:.35rem;padding-bottom:.35rem;}
.erp-density-compact .erp-sidebar-link{min-height:39px;padding:.48rem .68rem;}
.erp-density-compact .erp-sidebar-sublink{min-height:32px;padding:.35rem .55rem;}
.erp-density-compact .erp-content{padding-top:1rem!important;padding-bottom:1rem!important;}
.erp-high-contrast{--bs-border-color:#667085;--bs-border-color-translucent:rgba(15,23,42,.35);}
.erp-high-contrast body,.erp-high-contrast.erp-workspace-body{background:#fff!important;color:#111827;}
.erp-high-contrast .card,.erp-high-contrast .erp-filter-form{border:2px solid #475467!important;box-shadow:none!important;}
.erp-high-contrast .text-muted{color:#475467!important;}
.erp-high-contrast .btn-outline-dark,.erp-high-contrast .btn-outline-secondary{border-width:2px;}
.erp-high-contrast .table>thead>tr>th{background:#f2f4f7!important;color:#101828!important;border-bottom:2px solid #344054!important;}
.erp-reduce-motion *,
.erp-reduce-motion *::before,
.erp-reduce-motion *::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;}
}
@media (max-width:767.98px){
  .erp-page-header{gap:.75rem;}
  .erp-page-header,.erp-page-header>div{width:100%;}
  .erp-page-header>.d-flex,.erp-page-header>div:last-child{flex-wrap:wrap;}
  .erp-page-header .btn{flex:1 1 auto;}
  .erp-filter-form{padding:.75rem;}
  .erp-filter-actions{width:100%;}
  .erp-filter-actions>.btn,.erp-filter-actions>button{min-width:0;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tr,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile td,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile th{display:block;width:100%;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile thead{
    position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;
    overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;
  }
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody{display:grid;gap:.8rem;background:transparent;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody tr{
    border:1px solid var(--bs-border-color);border-radius:.8rem;overflow:hidden;background:var(--bs-body-bg);
    box-shadow:0 5px 14px rgba(15,23,42,.045);
  }
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody td,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody th{
    display:grid;grid-template-columns:var(--erp-table-mobile-label-width) minmax(0,1fr);gap:.75rem;
    align-items:start;text-align:left!important;padding:.65rem .75rem;border-bottom:1px solid var(--bs-border-color-translucent);
    white-space:normal;
  }
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody td:last-child,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody th:last-child{border-bottom:0;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody td::before,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile tbody th::before{
    content:attr(data-label);font-size:.72rem;font-weight:700;letter-spacing:.025em;text-transform:uppercase;color:var(--bs-secondary-color);
  }
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile .erp-action-cell{
    display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:.35rem;
  }
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile .erp-action-cell::before{flex:0 0 100%;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile .erp-action-cell .btn,
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile .erp-action-cell form{margin:0;flex:1 1 auto;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile .erp-action-cell .btn{width:100%;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile .erp-table-empty-row{box-shadow:none;}
  html:not(.erp-stack-tables-disabled) table.erp-table-stacked-mobile .erp-table-empty-row td{
    display:block;text-align:center!important;border:0;
  }
}
@media (max-width:575.98px){
  :root{--erp-table-mobile-label-width:minmax(7rem,36%);}
  .container,.container-fluid{--bs-gutter-x:1.25rem;}
  .card{border-radius:14px;}
  .card.p-4{padding:1rem!important;}
  .btn-group:not(.erp-no-wrap),.d-flex.gap-2:has(>.btn){flex-wrap:wrap;}
  .modal-dialog{margin:.6rem;}
  .modal-footer{gap:.5rem;}
  .modal-footer .btn{flex:1 1 auto;}
}
@media (forced-colors:active){
  .card,.btn,.form-control,.form-select,.erp-sidebar-link,.erp-sidebar-sublink{forced-color-adjust:auto;}
  .erp-required-marker{color:CanvasText;}
}
@media print{
  .erp-skip-link,.erp-display-preference-trigger,#erpDisplayPreferencesModal,.erp-filter-clear{display:none!important;}
  .erp-filter-form{border:0!important;padding:0!important;background:#fff!important;}
  .erp-table-shell{overflow:visible!important;}
  .table.erp-table-enhanced thead th{position:static!important;background:#fff!important;}
}
/* v3.16.16 unified report printing */
:root{--mas-print-primary:#123A63}.mas-report-toolbar{position:relative;z-index:2}.mas-report-print-header{display:none}
@media print{
  @page{size:auto;margin:12mm 9mm}
  html,body{background:#fff!important;color:#111!important;font-size:10pt}
  .erp-sidebar,.erp-topbar,.erp-breadcrumb-bar,.erp-context-help,.erp-app-footer,.d-print-none,.mas-report-toolbar,form,.pagination,.btn{display:none!important}
  .erp-main-shell,.erp-content,.container,.container-fluid,main{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
  .card{box-shadow:none!important;border:0!important;break-inside:auto}.card-header{background:#fff!important;color:#111!important;border-bottom:2px solid var(--mas-print-primary)!important}
  .table-responsive{overflow:visible!important}.table{width:100%!important;font-size:8.5pt}.table thead{display:table-header-group}.table tr{break-inside:avoid}.table th{background:var(--mas-print-primary)!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.table td,.table th{padding:4px!important;border:1px solid #bcc5d0!important;white-space:normal!important}
  a{color:#111!important;text-decoration:none!important}h1,h2,h3{break-after:avoid}
  .mas-report-print-header{display:block!important;border-bottom:3px solid var(--mas-print-primary);margin-bottom:8mm;padding-bottom:4mm}.mas-report-print-header h1{font-size:17pt;margin:0}.mas-report-print-header h2{font-size:12pt;margin:2mm 0}.mas-report-print-meta{display:flex;flex-wrap:wrap;gap:2mm 8mm;color:#4b5563;font-size:8.5pt}
}
