/* PlusERP authenticated workspace frame — Approval Workspace visual authority. */
.page {
  box-sizing: border-box;
  height: 100%;
  max-height: 100%;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable !important;
}
html,
body {
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
}
/* Authentication pages do not have the scrollable signed-in workspace frame. */
html:has(.login-shell),
body:has(.login-shell) {
  height: auto;
  min-height: 100svh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
.app-shell > .content {
  min-height: 0 !important;
  overflow: hidden !important;
}
.page > .pluserp-dashboard,
.page > .hr-workspace {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}
.page > .pluserp-dashboard {
  align-content: start !important;
}
.page :is(.pluserp-dashboard-context-loading, .pluserp-dashboard-context-ready),
.page .global-workspace-head,
.page .global-workspace-head * {
  animation: none !important;
  transition: none !important;
}

.page:has(> :is(.plus-workspace, .erp-admin-center, .banking-owner-workspace)) {
  box-sizing: border-box;
  padding: 12px 24px 24px !important;
  gap: 12px !important;
}
.page:has(> .global-workspace-head) {
  box-sizing: border-box;
  padding: 14px 48px 24px !important;
  gap: 12px !important;
}
.page > :is(.plus-workspace, .erp-admin-center, .banking-owner-workspace) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 2px 24px 20px !important;
  gap: 12px !important;
}
.page:has(> .global-workspace-head) > :is(.plus-workspace, .erp-admin-center, .banking-owner-workspace) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.page > .coa-workspace.plus-workspace,
.page > .banking-owner-workspace {
  padding: 2px 24px 20px !important;
}
.page .global-workspace-head {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) 760px;
  width: 100%;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 52px !important;
  height: 52px;
  align-items: flex-end !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 0 2px 6px !important;
  border-bottom: 1px solid #e4eaf2 !important;
}
.page .global-workspace-identity,
.page .global-workspace-tools { align-self: flex-end; }
.page .global-workspace-identity { width: 100%; min-width: 0; gap: 3px; }
.page .global-workspace-identity h1 { font-size: 21px !important; line-height: 24px !important; }
.page .global-workspace-identity p {
  font-size: 12px !important;
  line-height: 15px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page .global-workspace-tools {
  width: 760px !important;
  max-width: 760px;
  min-width: 0;
}
.page .global-workspace-tools .approval-header-controls {
  display: grid !important;
  grid-template-columns: 210px 210px 40px 40px 164px;
  width: 100%;
  min-height: 43px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
}
.page .global-workspace-tools .approval-header-context {
  box-sizing: border-box;
  flex: 0 0 210px;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  height: 43px;
  min-height: 43px;
  padding: 4px 10px;
}
.page .global-workspace-tools .approval-header-context strong,
.page .global-workspace-tools .approval-header-context select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page .global-workspace-tools .approval-header-user {
  flex: 0 0 164px;
  width: 164px;
  min-width: 164px;
}
.page .global-workspace-actions {
  box-sizing: border-box;
  width: 100%;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 48px;
  margin: 0 !important;
  padding: 0 2px !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}
.page .general-journal-workspace > *,
.page .general-journal-workspace .gj-kpis {
  min-width: 0 !important;
  max-width: 100% !important;
}
.page .global-workspace-actions > .global-workspace-actions { min-height: 0; padding: 0 !important; }
.page :is(.sales-workspace-tools, .purchase-tools, .masters-header-tools, .erp-admin-search) {
  width: 100%;
  min-width: 0 !important;
  max-width: none;
}
.page :is(.sales-workspace-tools, .purchase-tools) {
  display: grid !important;
  grid-template-columns: max-content minmax(260px, 1fr) 48px;
  align-items: center;
}
.page :is(.sales-workspace-tools, .purchase-tools) .sales-search { width: 100%; min-width: 0; }
.page .masters-header-tools,
.page .erp-admin-search {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}
.page .masters-header-tools .masters-search,
.page .erp-admin-search label { width: min(100%, 420px); margin: 0; }
.page :is(.pluserp-dashboard, .approval-workspace-main, .sales-workspace,
  .purchases-workspace, .masters-workspace, .banking-owner-workspace,
  .general-journal-workspace, .coa-workspace, .inventory-workspace,
  .hr-workspace, .reports-workspace, .erp-admin-center) { gap: 12px !important; }
@media (min-width: 1440px) {
  .purchases-workspace.plus-workspace :is(.purchase-kpis, .purchase-loading-kpis) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .page:has(> :is(.plus-workspace, .erp-admin-center, .banking-owner-workspace)) { padding: 10px 16px 20px !important; }
  .page:has(> .global-workspace-head) { padding: 10px 16px 20px !important; }
  .page > :is(.plus-workspace, .erp-admin-center, .banking-owner-workspace) { padding: 0 !important; }
  .page .global-workspace-head {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0 !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .page .global-workspace-tools { align-self: stretch; width: 100% !important; max-width: none; }
  .page .global-workspace-tools .approval-header-controls {
    grid-template-columns: repeat(2, minmax(210px, 1fr)) 40px 40px minmax(164px, auto);
    justify-content: flex-start;
  }
  .page .global-workspace-tools .approval-header-context { flex: 1 1 210px; width: auto; max-width: none; }
  .page .global-workspace-actions {
    height: auto;
    min-height: 48px;
    justify-content: flex-start !important;
    flex-wrap: wrap;
  }
}
@media (max-width: 680px) {
  .page .global-workspace-identity p { white-space: normal; }
  .page .global-workspace-tools .approval-header-controls { grid-template-columns: 1fr; }
  .page .global-workspace-tools .approval-header-context { flex-basis: 100%; width: 100%; }
  .page :is(.sales-workspace-tools, .purchase-tools) { grid-template-columns: 1fr; }
}
/* Sales workspace owner-approved KPI row and receipt table fit. */
body .sales-workspace.plus-workspace .sales-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card {
  min-width: 0 !important;
  min-height: 98px !important;
  padding: 14px 16px !important;
  gap: 16px !important;
  align-items: center !important;
  overflow: hidden !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card > .sales-kpi-icon {
  box-sizing: border-box !important;
  display: grid !important;
  place-items: center !important;
  width: 48px !important;
  height: 48px !important;
  flex: 0 0 48px !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.12) !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card.success > .sales-kpi-icon {
  background: linear-gradient(135deg, #059669, #34d399) !important;
  box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.12) !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card.violet > .sales-kpi-icon {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  box-shadow: 0 0 0 7px rgba(139, 92, 246, 0.12) !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card.danger > .sales-kpi-icon {
  background: linear-gradient(135deg, #dc2626, #fb7185) !important;
  box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.12) !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card > .sales-kpi-icon svg {
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  color: inherit !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card > div {
  min-width: 0 !important;
  gap: 5px !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card small {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card strong {
  max-width: 100% !important;
  font-size: 22px !important;
  line-height: 1.1 !important;
}

body .sales-workspace.plus-workspace .sales-kpi-card em {
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
}

body .sales-workspace.plus-workspace > .sales-operation-grid {
  padding: 0 !important;
}

body .sales-workspace.plus-workspace .sales-lower-grid {
  grid-template-columns:
    minmax(190px, 0.72fr)
    minmax(0, 1.08fr)
    minmax(0, 1.28fr)
    minmax(180px, 0.72fr) !important;
  align-items: stretch !important;
}

body .sales-workspace.plus-workspace .sales-lower-grid > .sales-panel {
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
}

body .sales-workspace.plus-workspace .sales-table {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
}

body .sales-workspace.plus-workspace .sales-table::-webkit-scrollbar {
  display: none !important;
}

body .sales-workspace.plus-workspace .sales-table :is(.sales-table-head, .sales-table-row) {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  grid-template-columns: minmax(72px, 0.88fr) minmax(0, 1.22fr) minmax(78px, 0.72fr) !important;
  gap: 6px !important;
  padding-inline: 10px !important;
}

body .sales-workspace.plus-workspace .sales-table :is(.sales-table-head, .sales-table-row) > * {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body .sales-workspace.plus-workspace .sales-table :is(.sales-table-head, .sales-table-row) > :last-child {
  overflow: visible !important;
  white-space: nowrap !important;
  text-align: right !important;
}

body .sales-workspace.plus-workspace .sales-receipt-table :is(.sales-table-head, .sales-table-row) {
  grid-template-columns: minmax(118px, 1.1fr) minmax(0, 1.12fr) minmax(78px, 0.62fr) !important;
}

body .sales-workspace.plus-workspace .sales-report-link {
  align-items: flex-start !important;
}

body .sales-workspace.plus-workspace .sales-report-link > span {
  min-width: 0 !important;
  max-width: 100% !important;
}

body .sales-workspace.plus-workspace .sales-report-link :is(strong, small) {
  display: block !important;
  max-width: 100% !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body .sales-workspace.plus-workspace .sales-report-link small {
  line-height: 1.35 !important;
}

@media (max-width: 900px) {
  body .sales-workspace.plus-workspace .sales-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  body .sales-workspace.plus-workspace .sales-kpi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Keep tenant labels and values inside their cells in every ERP workspace. */
.page .global-workspace-tools .approval-header-context select {
  height: 22px;
  min-height: 22px;
  padding-block: 0;
}

@media (min-width: 1101px) {
  .page .global-workspace-head .global-workspace-tools .approval-header-controls {
    grid-template-columns: 280px 190px 40px 40px 164px;
  }
  .page .global-workspace-head .global-workspace-tools .approval-header-context:first-child {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
  }
  .page .global-workspace-head .global-workspace-tools .approval-header-context:nth-child(2) {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
  }
}

@media (min-width: 1450px) {
  .page .global-workspace-head {
    grid-template-columns: minmax(260px, 1fr) 850px;
  }
  .page .global-workspace-head .global-workspace-tools {
    width: 850px !important;
    max-width: 850px;
  }
  .page .global-workspace-head .global-workspace-tools .approval-header-controls {
    grid-template-columns: 300px 220px 40px 40px 164px;
  }
  .page .global-workspace-head .global-workspace-tools .approval-header-context:first-child {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
  }
  .page .global-workspace-head .global-workspace-tools .approval-header-context:nth-child(2) {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
  }
}
