/* Application shell and structural layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: transparent;
}
.app-sidebar {
  flex: 0 0 var(--app-sidebar-width);
  width: var(--app-sidebar-width);
  min-width: var(--app-sidebar-width);
  max-width: var(--app-sidebar-width);
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, #0b2354 0%, #0c2861 100%);
  color: #fff;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.08);
  z-index: 1030;
}
.app-mobile-nav {
  background: linear-gradient(180deg, #0b2354 0%, #0c2861 100%);
  color: #fff;
}
.app-mobile-nav .offcanvas-header,
.app-mobile-nav .offcanvas-body {
  color: #fff;
}
.app-mobile-nav .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}
.app-sidebar-brand {
  min-height: 132px;
  padding-bottom: 1.5rem !important;
}
.app-logo {
  width: 54px;
  height: 54px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.2rem;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.app-nav {
  width: 100%;
}
.app-nav-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  min-height: 54px;
  padding: .95rem 1rem;
  border-radius: 1rem;
  color: rgba(255,255,255,.86);
  font-weight: 600;
  transition: all .18s ease;
}
.app-nav-link i {
  font-size: 1.1rem;
  opacity: .92;
}
.app-nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.app-nav-link.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.main-shell {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  background: linear-gradient(180deg, #f7faff 0%, #edf2f8 100%);
}
.app-topbar {
  background: rgba(255,255,255,.82) !important;
  backdrop-filter: blur(14px);
}
.content {
  min-width: 0;
}
.main-shell .app-topbar .container-fluid,
.main-shell .app-content-shell {
  width: 100%;
  max-width: var(--app-shell-max);
  margin-inline: auto;
}
.main-shell .app-topbar .container-fluid,
.main-shell .app-content-shell {
  padding-left: clamp(1rem, 1.6vw, 1.5rem);
  padding-right: clamp(1rem, 1.6vw, 1.5rem);
}
.app-content-shell {
  width: 100%;
}
.page-chip {
  width: 3rem;
  height: 3rem;
  font-size: 1rem;
  box-shadow: 0 .75rem 1.5rem rgba(13,110,253,.18);
}
.mini-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.quick-receive-layout,
.inventory-layout,
.dashboard-layout,
.system-layout,
.articles-layout,
.help-layout,
.reports-layout {
  width: 100%;
}
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-shell {
  width: min(100%, 460px);
}
.auth-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(219,228,240,.95);
}
.auth-card-modern {
  padding: 2rem;
}
.auth-brand-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.auth-intro,
.auth-footer-note,
.auth-legal-links {
  color: var(--app-muted);
}
.auth-legal-links {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.auth-flash-stack {
  width: min(100%, 980px);
  display: grid;
  gap: .75rem;
}
.auth-flash-stack .container {
  width: 100%;
  max-width: none;
  padding: 0;
}
.modal,
.iframe-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal[hidden],
.iframe-modal[hidden] {
  display: none !important;
}
.modal::before,
.iframe-modal-backdrop,
.iframe-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: transparent;
}
.modal-panel,
.modal-card,
.iframe-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 820px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
}
.modal-card,
.modal-panel {
  border-radius: 1rem;
  box-shadow: var(--app-shadow);
  padding: 1.1rem 1.2rem;
}
.modal-card-medium {
  width: min(100%, 680px);
}
.iframe-modal-card {
  width: min(100%, 980px);
  display: flex;
  flex-direction: column;
}
.iframe-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
}
.iframe-modal iframe {
  border: 0;
  width: 100%;
  min-height: 72vh;
  background: #fff;
}
.modal-frame-body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7fb;
  color: var(--app-text);
  padding: 1rem;
}
.workspace-title-badge {
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--app-primary), #4ea3ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 12px 25px rgba(13,110,253,.22);
}
.workspace-kicker {
  color: var(--app-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
@media (max-width: 991.98px) {
  .app-sidebar {
    width: var(--app-sidebar-width);
    min-width: 0;
    max-width: none;
  }
  .main-shell {
    width: 100%;
  }
  .main-shell .app-topbar .container-fluid,
  .main-shell .app-content-shell {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
