/* Optional retail-teal screen layouts. Keep every module's own data and actions. */
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family] {
  min-width: 0;
  color: #212529;
}

/* Record screens: open command bar, dense filters, and readable scrolling tables. */
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] {
  overflow-x: auto !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > .page-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 42px;
  margin-bottom: 16px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > .page-head:has(> .retail-party-search) {
  justify-content: space-between;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > .page-head :where(.btn-primary,.btn-ghost) {
  min-height: 38px;
  padding-inline: 12px !important;
  white-space: nowrap;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen :is(#page-sales-invoices,#page-purchase-invoices) > .page-head > .v19-page-actions {
  display: flex !important;
  width: auto !important;
  max-width: 100%;
  flex: 0 1 auto !important;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen :is(#page-sales-invoices,#page-purchase-invoices) > .page-head > .v19-page-actions > button {
  width: auto !important;
  flex: 0 0 auto !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > .page-head + div:has(> input,> select) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px !important;
  margin-bottom: 14px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > .page-head + div:has(> input,> select) :where(input,select) {
  min-height: 36px;
  height: 36px;
  margin: 0 !important;
  padding: 5px 10px;
  background: #fff;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > table {
  width: 100%;
  background: #fff;
  border: 1px solid #e3e8e8;
  border-collapse: collapse;
  box-shadow: 0 1px 2px #0d22220d;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > table:has(thead th:nth-child(8)) {
  min-width: 980px;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > table tbody tr {
  height: 72px;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] :where(.table-shell,.table-wrap,.data-table-wrap,.rg-table-wrap,.ii-table-scroll,.pbe-table-wrap,.dc-table-wrap,.table-scroll) {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e3e8e8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px #0d22220d !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] :where(.table-shell,.table-wrap,.data-table-wrap,.rg-table-wrap,.ii-table-scroll,.pbe-table-wrap,.dc-table-wrap,.table-scroll) > table {
  width: 100%;
  margin: 0;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] :where(.list-filters-row,.table-actions) {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] :where(.tabs,.pm-tabs,.perm-view-tabs) {
  border-bottom: 1px solid #e3e8e8 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] :where(.tabs,.pm-tabs,.perm-view-tabs) > :where(button,.tab) {
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Dashboards keep their real indicators, with the reference's restrained cards. */
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="dashboard"] :where(.dashboard-commandbar,.dashboard-filterbar) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .dashboard-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 0 !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19:not(.top-nav-mode) #appScreen #page-dashboard .dashboard-commandbar::before {
  content: "نظرة عامة";
  color: #212529;
  font-size: calc(20 / 16 * var(--app-font-size));
  font-weight: 600;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .dashboard-filterbar {
  margin-bottom: 14px;
  padding: 0 !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="dashboard"] :where(.dashboard-widget,.kpi-card,.dash-card) {
  border: 1px solid #e3e8e8 !important;
  border-radius: 5px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px #0d22220d !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .kpi-card {
  min-height: 184px;
  padding: 16px 18px !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .kpi-card .label {
  color: #596568;
  font-size: calc(14 / 16 * var(--app-font-size));
  font-weight: 500;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .kpi-card .value {
  color: #212529;
  font-size: calc(28 / 16 * var(--app-font-size));
  font-weight: 600;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .kpi-icon {
  background: #eff8f8 !important;
  color: #00807d !important;
  box-shadow: none !important;
  transform: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .kpi-icon::after { display: none !important; }

/* Settings: a horizontal tab rail and a full-width content form. */
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings > .settings-layout {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) !important;
  gap: 20px !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings .settings-sidebar {
  position: static !important;
  width: 100%;
  max-height: none !important;
  min-width: 0;
  margin: 0;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-bottom: 1px solid #dfe2e2 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings .settings-search {
  width: min(420px,100%);
  min-height: 36px;
  margin: 0 0 12px;
  background: #fff;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings #settingsTabs {
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings #settingsTabs > .settings-cat-label {
  display: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings #settingsTabs > .settings-tab {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 108px !important;
  min-height: 46px !important;
  padding: 8px 14px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #596568 !important;
  box-shadow: none !important;
  white-space: nowrap;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings #settingsTabs > .settings-tab.active {
  border-bottom-color: #00807d !important;
  color: #00807d !important;
  font-weight: 700;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings #settingsTabs > .settings-tab :where(i,span) {
  color: inherit !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings #settingsTabs > .settings-tab:focus-visible {
  outline: 2px solid #00807d;
  outline-offset: -3px;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings .settings-content {
  min-width: 0;
  max-width: 100%;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings .settings-tab-panel > .settings-card {
  border-radius: 4px !important;
}

/* Workspaces retain their own controls and use a flat, high-contrast frame. */
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="workspace"] :where(.report-center-topbar,.report-center-workspace,.report-center-catalog,.report-center-main) {
  border-color: #e3e8e8 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19:not(.top-nav-mode) #appScreen #page-reports .report-center-title {
  display: none;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-hero {
  min-height: 52px;
  padding: 8px 12px;
  background: #fff;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-search {
  border-radius: 4px !important;
  background: #fff !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-categories {
  gap: 14px;
  padding: 8px 0 10px;
  border-bottom: 1px solid #e3e8e8;
  background: transparent;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-categories > button {
  min-width: 138px;
  min-height: 56px;
  padding: 10px 18px;
  border: 1px solid #e3e8e8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #596568 !important;
  font-size: calc(16 / 16 * var(--app-font-size)) !important;
  font-weight: 500 !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-categories > button.active {
  color: #00807d !important;
  border-color: #00807d !important;
  background: #eaf7f6 !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports :where(.report-center-catalog,.report-center-workspace,.report-center-workspace-sticky) {
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-card.active {
  border-color: #a6d7d6 !important;
  background: #eaf7f6 !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-kpi {
  border: 1px solid #e3e8e8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 .report-focus-overlay :where(.report-focus-header,.report-focus-body) {
  background: #fff !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-daily-closing > .page-head {
  min-height: 42px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-daily-closing > table {
  min-width: 1120px;
  border: 1px solid #e3e8e8;
  background: #fff;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-daily-closing {
  overflow-x: auto !important;
}

/* Full-screen invoices and POS follow the same control geometry as lists. */
html[data-v19-preset="retail-teal"] body.ui-v19 :where(#salesInvoiceModal,#purchaseInvoiceModal,#salesReturnModal,#purchaseReturnModal,#quotationModal,#salesOrderModal,#purchaseOrderModal) > .fullscreen-modal {
  border: 0 !important;
  border-radius: 0 !important;
  background: #f6f8fa !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 :where(#salesInvoiceModal,#purchaseInvoiceModal,#salesReturnModal,#purchaseReturnModal,#quotationModal,#salesOrderModal,#purchaseOrderModal) :where(.fs-sticky-header,.si-workspace-header) {
  border-bottom: 1px solid #e3e8e8 !important;
  background: #fff !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #purchaseInvoiceModal .si-compact-fields {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)) !important;
  gap: 14px 16px !important;
  align-items: end;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #purchaseInvoiceModal .si-compact-fields > div {
  min-width: 0;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #purchaseInvoiceModal .si-compact-fields label {
  margin-bottom: 5px;
  color: #596568;
  font-size: calc(14 / 16 * var(--app-font-size)) !important;
  line-height: 1.45;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #purchaseInvoiceModal .si-compact-fields :where(input,select) {
  width: 100% !important;
  min-height: 48px;
  padding: 10px 12px !important;
  border: 1px solid #dfe2e2 !important;
  border-radius: 4px !important;
  font-size: calc(16 / 16 * var(--app-font-size)) !important;
  line-height: 1.5;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #purchaseInvoiceModal .si-compact-fields .searchable-select-wrap {
  min-width: 0;
  width: 100%;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #posScreen {
  background: #f6f8fa !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #posScreen :where(.pos-topbar,.pos-cart,.pos-products,.pos-product-card) {
  border-color: #e3e8e8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: none !important;
}
html[data-v19-preset="retail-teal"] body.ui-v19 #posScreen :where(.pos-product-card,.pos-checkout-btn,.pos-category-btn):hover {
  transform: none !important;
}

@media (max-width: 900px) {
  html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-reports .report-center-categories > button {
    min-width: 118px;
  }
  html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen .page[data-retail-family="records"] > .page-head + div:has(> input,> select) :where(input,select) {
    flex: 1 1 150px;
  }
  html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-dashboard .dashboard-commandbar {
    flex-wrap: wrap;
  }
  html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen #page-settings #settingsTabs > .settings-tab {
    min-width: 94px !important;
    padding-inline: 10px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-v19-preset="retail-teal"] body.ui-v19 #appScreen :where(.page,.kpi-card,.dashboard-widget) {
    transition: none !important;
    animation: none !important;
  }
}
