html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #2a2750;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f3eef2;
  color: #241f33;
}

/*
  Menu strip colors from Malwa_New_App Main_Form.Designer.vb MenuStrip1.
  BackColor is Thistle (216, 191, 216). Top-level items that set a color use
  ForeColor (0, 0, 64). The strip font is Segoe UI 9.75pt bold.
  Payments and Add Dataset do not set ForeColor, and the designer sets no hover color.
  These rules live here because layout-scoped CSS does not attach to the anchor tag helpers.
*/
/* Sticky on header so the strip has travel room within body; z-index below modals. */
body > header {
  position: sticky;
  top: 0;
  z-index: 1020;
}

nav.app-menu-strip {
  background-color: #d8bfd8;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

nav.app-menu-strip .navbar-brand,
nav.app-menu-strip .navbar-nav .nav-link,
nav.app-menu-strip .navbar-text {
  color: #000040;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

nav.app-menu-strip .navbar-brand:hover,
nav.app-menu-strip .navbar-brand:focus,
nav.app-menu-strip .navbar-nav .nav-link:hover,
nav.app-menu-strip .navbar-nav .nav-link:focus {
  color: #000040;
}

nav.app-menu-strip .navbar-nav button.nav-link {
  background: transparent;
  border: 0;
}

nav.app-menu-strip .dropdown-menu {
  background-color: #d8bfd8;
  border-color: #c4a8c4;
  padding: 0.15rem 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

nav.app-menu-strip .dropdown-item {
  color: #000040;
  background-color: #d8bfd8;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
}

nav.app-menu-strip .dropdown-item:hover,
nav.app-menu-strip .dropdown-item:focus,
nav.app-menu-strip .dropdown-item:active,
nav.app-menu-strip .dropdown-item.active {
  color: #000040;
  background-color: #d8bfd8;
}

nav.app-menu-strip .dropdown-item:focus {
  outline: 1px solid #000040;
  outline-offset: -1px;
}

/*
  Compact standard for catalog data-entry pages.
  Add data-entry-page to the page root, entry-action-bar around the button
  row and status, and entry-actions / entry-grid-wrap to the buttons and grid.
  Page classes keep each form's field arrangement.
*/
:root {
  --entry-font-size: 0.75rem;
  --entry-heading-size: 1.02rem;
  --entry-control-height: 1.4rem;
  --entry-label-width: 7.4rem;
  --entry-row-gap: 0.12rem;
  --entry-action-gap: 0.25rem;
}

body:has(.data-entry-page) header .app-menu-strip {
  margin-bottom: 0.35rem;
}

body:has(.data-entry-page) main {
  padding-bottom: 0.2rem;
}

.data-entry-page {
  padding-top: 0.05rem;
  padding-bottom: 0.05rem;
  overflow-anchor: none;
}

.data-entry-page .customer-heading,
.data-entry-page .item-heading,
.data-entry-page .worker-heading,
.data-entry-page .wire-size-heading,
.data-entry-page .rate-heading,
.data-entry-page .sale-heading,
.data-entry-page .statement-heading,
.data-entry-page .labour-wire-heading,
.data-entry-page .worker-advance-heading,
.data-entry-page .payment-heading {
  margin-bottom: 0.2rem;
  padding-bottom: 0.08rem;
}

.data-entry-page .customer-heading h1,
.data-entry-page .item-heading h1,
.data-entry-page .worker-heading h1,
.data-entry-page .wire-size-heading h1,
.data-entry-page .rate-heading h1,
.data-entry-page .sale-heading h1,
.data-entry-page .statement-heading h1,
.data-entry-page .labour-wire-heading h1,
.data-entry-page .worker-advance-heading h1,
.data-entry-page .payment-heading h1 {
  font-size: var(--entry-heading-size);
  line-height: 1.15;
}

.data-entry-page .customer-status,
.data-entry-page .item-status,
.data-entry-page .worker-status,
.data-entry-page .wire-size-status,
.data-entry-page .rate-status,
.data-entry-page .sale-status,
.data-entry-page .statement-status,
.data-entry-page .labour-wire-status,
.data-entry-page .worker-advance-status,
.data-entry-page .payment-status {
  margin-bottom: 0.15rem;
  font-size: var(--entry-font-size);
  line-height: 1.15;
}

.data-entry-page .customer-status,
.data-entry-page .item-status,
.data-entry-page .worker-status,
.data-entry-page .wire-size-status,
.data-entry-page .rate-status,
.data-entry-page .sale-status,
.data-entry-page .statement-status,
.data-entry-page .labour-wire-status,
.data-entry-page .worker-advance-status,
.data-entry-page .payment-status {
  min-height: 1.25rem;
  padding: 0.04rem 0.3rem;
  border: 2px inset #c8c8c8;
  background: #fff;
}

.data-entry-page .worker-status {
  text-align: center;
}

.data-entry-page .alert {
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.2rem;
  font-size: var(--entry-font-size);
}

.data-entry-page .field-row {
  display: grid;
  grid-template-columns: var(--entry-label-width) minmax(0, 1fr);
  column-gap: 0.3rem;
  align-items: center;
  margin-bottom: var(--entry-row-gap);
}

.data-entry-page .field-row label {
  margin: 0;
  font-size: var(--entry-font-size);
  line-height: 1.15;
}

.data-entry-page .form-control {
  font-size: var(--entry-font-size);
  line-height: 1.15;
  height: var(--entry-control-height);
  min-height: 0;
  padding: 0.05rem 0.35rem;
}

.data-entry-page .entry-action-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--entry-action-gap);
  margin-top: 0.05rem;
}

.data-entry-page .entry-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--entry-action-gap);
  margin-top: 0.05rem;
}

.data-entry-page .entry-action-bar .entry-actions {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  margin-top: 0;
}

.data-entry-page .entry-action-bar .customer-status,
.data-entry-page .entry-action-bar .item-status,
.data-entry-page .entry-action-bar .worker-status,
.data-entry-page .entry-action-bar .wire-size-status,
.data-entry-page .entry-action-bar .rate-status,
.data-entry-page .entry-action-bar .sale-status,
.data-entry-page .entry-action-bar .labour-wire-status,
.data-entry-page .entry-action-bar .worker-advance-status,
.data-entry-page .entry-action-bar .payment-status {
  flex: 1 1 8rem;
  margin-bottom: 0;
  margin-left: auto;
  min-width: 6rem;
}

.data-entry-page .entry-actions .btn,
.data-entry-page .customer-heading .btn,
.data-entry-page .worker-heading .btn,
.data-entry-page .rate-heading .btn,
.data-entry-page .sale-heading .btn {
  font-size: var(--entry-font-size);
  line-height: 1.15;
  padding: 0.05rem 0.42rem;
}

.data-entry-page .customer-list-panel,
.data-entry-page .item-list-panel,
.data-entry-page .worker-list-panel,
.data-entry-page .rate-list-panel,
.data-entry-page .sale-list-panel {
  margin-top: 0.28rem;
}

.data-entry-page .customer-search,
.data-entry-page .item-search,
.data-entry-page .worker-search {
  column-gap: 0.3rem;
  align-items: center;
  margin-bottom: 0.15rem;
}

.data-entry-page .customer-search label,
.data-entry-page .item-search label,
.data-entry-page .worker-search label {
  margin: 0;
  font-size: var(--entry-font-size);
  line-height: 1.15;
}

.data-entry-page .customer-list-note,
.data-entry-page .item-list-note,
.data-entry-page .worker-list-note,
.data-entry-page .rate-list-note,
.data-entry-page .sale-list-note {
  margin-bottom: 0.15rem;
}

.data-entry-page .entry-grid-wrap {
  overflow: auto;
  overflow-anchor: none;
  border: 1px solid #dee2e6;
  border-radius: 0.2rem;
}

.data-entry-page .entry-grid-wrap table {
  margin-bottom: 0;
  font-size: var(--entry-font-size);
}

.data-entry-page .entry-grid-wrap th,
.data-entry-page .entry-grid-wrap td {
  padding: 0.12rem 0.32rem;
  line-height: 1.15;
}

.data-entry-page .entry-grid-wrap thead th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 1;
}

.data-entry-page .entry-grid-wrap tbody tr {
  cursor: pointer;
}

.add-coustomer-page .customer-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: start;
  margin-bottom: 0.05rem;
}

.add-coustomer-page .customer-search {
  display: grid;
  grid-template-columns: var(--entry-label-width) minmax(12rem, 22rem);
}

.add-coustomer-page #txtc_id {
  max-width: 7rem;
}

.add-coustomer-page .customer-grid-wrap {
  max-height: calc(100vh - 16.2rem);
  min-height: 8rem;
}

.add-wire-party-page {
  --entry-label-width: 8.6rem;
}

.add-wire-party-page .customer-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: start;
  margin-bottom: 0.05rem;
}

.add-wire-party-page .customer-search {
  display: grid;
  grid-template-columns: var(--entry-label-width) minmax(12rem, 22rem);
}

.add-wire-party-page #txtc_id {
  max-width: 7rem;
}

.add-wire-party-page .customer-grid-wrap {
  max-height: calc(100vh - 18.4rem);
  min-height: 8rem;
}

.add-item-page .item-fields {
  max-width: 36rem;
}

.add-item-page #txtid {
  max-width: 7rem;
}

.add-item-page .item-search {
  display: grid;
  grid-template-columns: var(--entry-label-width) minmax(8rem, 18rem);
}

.add-item-page .item-grid-wrap {
  max-height: calc(100vh - 15.4rem);
  min-height: 8rem;
}

.add-item-page .item-col-id {
  width: 60px;
}

.add-item-page .item-col-name {
  width: 200px;
}

.add-item-page .item-col-sub {
  width: 96px;
}

.add-worker-job-page .worker-fields {
  max-width: 36rem;
}

.add-worker-job-page #txt_w_id {
  max-width: 7rem;
}

.add-wire-size-page .wire-size-fields {
  max-width: 36rem;
}

.add-wire-size-page #txtid {
  max-width: 7rem;
}

.add-worker-job-page .worker-search {
  display: grid;
  grid-template-columns: var(--entry-label-width) minmax(8rem, 18rem);
}

.add-worker-job-page .worker-grid-wrap {
  max-height: calc(100vh - 14.6rem);
  min-height: 8rem;
}

.add-worker-job-page .worker-col-id {
  width: 60px;
}

.add-worker-job-page .worker-col-name {
  width: 200px;
}

.add-rate-page .rate-fields {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.85fr;
  gap: 0.12rem 0.55rem;
  align-items: start;
}

.add-rate-page .rate-fields .field-row {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0.02rem;
  align-items: stretch;
  margin-bottom: 0;
}

.add-rate-page .rate-span-2 {
  grid-column: span 2;
}

.add-rate-page .rate-span-3 {
  grid-column: span 3;
}

.add-rate-page .rate-span-4 {
  grid-column: span 4;
}

.add-rate-page .rate-row-break {
  min-height: 0;
}

.add-rate-page #txtid {
  max-width: 7rem;
}

.lookup-host {
  position: relative;
  display: block;
  min-width: 0;
}

.lookup-host .form-control {
  width: 100%;
  padding-right: 1.35rem;
}

.lookup-trigger {
  position: absolute;
  top: 0;
  right: 0;
  width: 1.35rem;
  height: var(--entry-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000040;
  line-height: 1;
}

.lookup-trigger:disabled {
  opacity: 0.35;
}

.lookup-trigger svg {
  width: 0.75rem;
  height: 0.75rem;
  display: block;
}

.lookup-dialog {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: block;
  padding: 0;
  background: rgba(0, 0, 64, 0.18);
  font-family: var(--bs-body-font-family);
  font-size: var(--entry-font-size);
}

.lookup-dialog[hidden] {
  display: none !important;
}

.lookup-dialog-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(32rem, calc(100vw - 1rem));
  max-height: min(24rem, calc(100vh - 1rem));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #000040;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 64, 0.2);
  font-family: inherit;
  font-size: var(--entry-font-size);
  z-index: 1;
}

.lookup-dialog .form-control {
  font-family: inherit;
  font-size: var(--entry-font-size);
  line-height: 1.15;
  height: var(--entry-control-height);
  min-height: 0;
  padding: 0.05rem 0.35rem;
}

.lookup-dialog .btn {
  font-family: inherit;
  font-size: var(--entry-font-size);
  line-height: 1.15;
  padding: 0.05rem 0.42rem;
}

.lookup-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--entry-action-gap);
  padding: 0.12rem 0.35rem;
  background: #d8bfd8;
  color: #000040;
}

.lookup-dialog-header h2 {
  margin: 0;
  font-family: inherit;
  font-size: var(--entry-font-size);
  font-weight: 700;
  line-height: 1.15;
  color: #000040;
}

.lookup-dialog-search {
  margin: var(--entry-row-gap) 0.3rem;
  width: auto;
}

.lookup-dialog-message {
  margin: 0 0.3rem var(--entry-row-gap);
  font-size: var(--entry-font-size);
  line-height: 1.15;
  color: #842029;
}

.lookup-dialog-message.is-loading {
  color: #000040;
}

.lookup-dialog-message.is-empty {
  color: #664d03;
}

.lookup-dialog-message.is-error {
  color: #842029;
}

.lookup-dialog-grid {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 8rem;
  max-height: none;
  margin: 0 0.3rem 0.3rem;
  border: 1px solid #dee2e6;
  border-radius: 0.2rem;
}

.lookup-dialog-grid table {
  margin-bottom: 0;
  font-size: var(--entry-font-size);
}

.lookup-dialog-grid th,
.lookup-dialog-grid td {
  padding: 0.12rem 0.32rem;
  line-height: 1.15;
}

.lookup-dialog-grid thead th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 1;
}

.lookup-dialog-grid tbody tr {
  cursor: pointer;
}

.lookup-dialog-grid tbody tr.is-active {
  background: #d8bfd8;
}

.add-rate-page .rate-grid-wrap {
  max-height: calc(100vh - 19.5rem);
  min-height: 8rem;
}

.add-rate-page .rate-col-id {
  width: 52px;
}

.add-rate-page .rate-col-party {
  width: 160px;
}

.add-rate-page .rate-col-remarks {
  width: 180px;
}

.sale-entry-page .sale-hint {
  margin: 0 0 0.18rem;
  font-size: var(--entry-font-size);
  line-height: 1.15;
  color: #0000c0;
}

body:has(.sale-entry-page) .container {
  max-width: min(100%, 1280px);
}

.sale-entry-page .sale-field-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.35rem;
  align-items: start;
  margin-bottom: 0.1rem;
}

.sale-entry-page .sale-panel {
  min-width: 0;
  padding: 0.28rem 0.4rem 0.35rem;
  border: 1px solid #000040;
  background: #fff;
}

.sale-entry-page .sale-panel-auto {
  background: #f7f7fb;
}

.sale-entry-page .sale-panel-title {
  margin: 0 0 0.22rem;
  padding-bottom: 0.08rem;
  border-bottom: 1px solid #000040;
  font-size: var(--entry-font-size);
  font-weight: 700;
  line-height: 1.15;
  color: #000040;
}

.sale-entry-page .sale-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.12rem;
  align-items: start;
  margin-bottom: 0;
}

.sale-entry-page .sale-fields .field-row {
  grid-template-columns: minmax(5.4rem, 7.2rem) minmax(0, 1fr);
  margin-bottom: 0;
}

.sale-entry-page .sale-panel-auto .form-control[readonly] {
  background: #ececf3;
}

.sale-entry-page .remarks-suggestions {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 11rem;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid #000040;
  background: #fff;
}

.sale-entry-page .remarks-suggestions[hidden] {
  display: none !important;
}

.sale-entry-page .remarks-choice {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.12rem 0.35rem;
  border: 0;
  background: #fff;
  color: #000;
  font: inherit;
  line-height: 1.2;
  text-align: left;
  white-space: pre-wrap;
}

.sale-entry-page .remarks-choice[aria-selected="true"],
.sale-entry-page .remarks-choice:hover {
  background: #cfe2ff;
}

.sale-entry-page .sale-fields .form-check-input {
  margin: 0;
  width: 0.9rem;
  height: 0.9rem;
}

.sale-entry-page .sale-grid-wrap {
  max-height: calc(100vh - 22.5rem);
  min-height: 8rem;
}

.sale-entry-page .sale-grid-wrap thead th {
  font-weight: 700;
  color: #000040;
  border-bottom: 1px solid #000040;
  white-space: nowrap;
}

.sale-entry-page .sale-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.12rem 0.55rem;
  margin-top: 0.2rem;
}

@media (max-width: 991.98px) {
  .sale-entry-page .sale-field-panels {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .data-entry-page .entry-action-bar .entry-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .data-entry-page .entry-action-bar .customer-status,
  .data-entry-page .entry-action-bar .item-status,
  .data-entry-page .entry-action-bar .worker-status,
  .data-entry-page .entry-action-bar .wire-size-status,
  .data-entry-page .entry-action-bar .rate-status,
  .data-entry-page .entry-action-bar .sale-status,
  .data-entry-page .entry-action-bar .labour-wire-status,
  .data-entry-page .entry-action-bar .worker-advance-status,
  .data-entry-page .entry-action-bar .payment-status {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .add-coustomer-page .customer-fields,
  .add-coustomer-page .customer-search,
  .add-wire-party-page .customer-fields,
  .add-wire-party-page .customer-search,
  .add-item-page .item-search,
  .add-worker-job-page .worker-search {
    grid-template-columns: minmax(0, 1fr);
  }

  .add-item-page .item-fields,
  .add-worker-job-page .worker-fields {
    max-width: none;
  }

  .add-coustomer-page .customer-grid-wrap,
  .add-wire-party-page .customer-grid-wrap,
  .add-item-page .item-grid-wrap,
  .add-worker-job-page .worker-grid-wrap,
  .add-rate-page .rate-grid-wrap,
  .sale-entry-page .sale-grid-wrap {
    max-height: none;
    min-height: 0;
  }

  .add-rate-page .rate-fields,
  .sale-entry-page .sale-field-panels,
  .sale-entry-page .sale-fields,
  .sale-entry-page .sale-totals {
    grid-template-columns: minmax(0, 1fr);
  }

  .add-rate-page .rate-span-2,
  .add-rate-page .rate-span-3,
  .add-rate-page .rate-span-4 {
    grid-column: auto;
  }

  .add-rate-page .rate-row-break {
    display: none;
  }

  .lookup-dialog-panel {
    width: min(100vw - 1rem, 32rem);
  }

  .lookup-dialog-grid {
    min-height: 6rem;
  }
}

@media (max-height: 700px) {
  .lookup-dialog-grid {
    min-height: 5rem;
  }
}

body:has(.statement-page) .container {
  max-width: min(100%, 1280px);
}

.statement-page .statement-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.9fr);
  gap: 0.45rem;
  align-items: start;
}

.statement-page .statement-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0.7rem;
}

.statement-page .statement-filter-spacer {
  min-height: var(--entry-control-height);
}

.statement-page .statement-total {
  text-align: right;
}

.statement-page .statement-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.25rem 0 0.3rem;
  font-size: var(--entry-font-size);
}

.statement-page .statement-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.statement-page .statement-actions {
  margin-bottom: 0.2rem;
}

.statement-page .statement-phase-note {
  margin: 0.15rem 0 0.25rem;
  font-size: var(--entry-font-size);
  line-height: 1.25;
}

.statement-page .statement-summary-wrap,
.statement-page .statement-grid-wrap {
  overflow: auto;
}

.statement-page .statement-summary-wrap {
  max-height: 14.5rem;
}

.statement-page .statement-grid-wrap {
  margin-top: 0.35rem;
  max-height: calc(100vh - 22rem);
  min-height: 14rem;
}

.statement-page .statement-grid thead th,
.statement-page .statement-summary thead th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 1;
}

.statement-page .statement-grid tbody tr[data-kind="opening"] {
  background: #fff8dc;
}

.statement-page .statement-grid tbody tr[data-kind="settled"] {
  background: #add8e6;
}

.statement-page .statement-grid tbody tr[data-kind="open"] {
  background: #fff;
}

.statement-page .statement-grid tbody tr.is-selected[data-kind="opening"] {
  background: #e6d296;
}

.statement-page .statement-grid tbody tr.is-selected[data-kind="settled"] {
  background: #78b4d2;
}

.statement-page .statement-grid tbody tr.is-selected[data-kind="open"] {
  background: #ccfbf1;
}

@media (max-width: 991.98px) {
  .statement-page .statement-top,
  .statement-page .statement-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .statement-page .statement-filter-spacer {
    display: none;
  }

  .statement-page .statement-grid-wrap {
    max-height: none;
  }
}

body:has(.production-page) .container {
  max-width: min(100%, 1440px);
}

.production-page .production-heading {
  margin-bottom: 0.2rem;
  padding-bottom: 0.08rem;
}

.production-page .production-heading h1 {
  font-size: var(--entry-heading-size);
  line-height: 1.15;
}

.production-page .production-top {
  display: grid;
  grid-template-columns: minmax(20rem, 1.35fr) minmax(13rem, 0.7fr) minmax(20rem, 1.25fr);
  gap: 0.4rem;
  align-items: start;
}

.production-page .production-panel {
  border: 1px solid #9ec9c9;
  border-radius: 0.2rem;
  padding: 0.28rem 0.4rem 0.35rem;
  background: #f4ffff;
}

.production-page .production-panel h2 {
  margin: 0 0 0.22rem;
  font-size: var(--entry-font-size);
  font-weight: 700;
  line-height: 1.15;
}

.production-page .production-item-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.2rem;
  column-gap: 0.35rem;
}

.production-page .production-qty {
  grid-template-columns: 2rem minmax(0, 1fr);
}

.production-page .production-cyan {
  background: #00ffff;
}

.production-page .production-status {
  min-height: 1.25rem;
  margin: 0.2rem 0 0;
  padding: 0.04rem 0.3rem;
  border: 2px inset #c8c8c8;
  background: #00ffff;
  font-size: var(--entry-font-size);
  font-weight: 700;
}

.production-page .production-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.6rem;
  align-items: center;
}

.production-page .production-filter-grid .form-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  font-size: var(--entry-font-size);
}

.production-page .production-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: 0.4rem;
  align-items: start;
  margin-top: 0.35rem;
}

.production-page .production-grid-wrap {
  max-height: calc(100vh - 23rem);
  min-height: 12rem;
}

.production-page .production-side {
  display: grid;
  gap: 0.35rem;
}

.production-page .production-side-grid {
  max-height: 11rem;
}

.production-page .production-side-note,
.production-page .production-phase-note {
  margin: 0 0 0.2rem;
  font-size: var(--entry-font-size);
  line-height: 1.25;
}

.production-page .production-phase-note {
  margin-top: 0.35rem;
}

.production-page .production-total {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  column-gap: 0.3rem;
  align-items: center;
  margin-top: 0.22rem;
}

.production-page .production-total label {
  margin: 0;
  font-size: var(--entry-font-size);
}

.production-page .production-total input {
  text-align: right;
}

.production-page .production-grid tbody tr.is-settled {
  background: #add8e6;
}

.production-page .production-grid tbody tr.is-open {
  background: #fff;
}

.production-page .production-grid tbody tr[data-bill-id]:not([data-bill-id=""]) {
  cursor: pointer;
}

.production-page .production-grid tbody tr.is-selected.is-settled {
  background: #78b4d2;
}

.production-page .production-grid tbody tr.is-selected.is-open,
.production-page #dispatched-grid tbody tr.is-selected {
  background: #ccfbf1;
}

.production-page #dispatched-grid tbody tr[data-item] {
  cursor: pointer;
}

@media (max-width: 1100px) {
  .production-page .production-top,
  .production-page .production-body,
  .production-page .production-item-line,
  .production-page .production-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .production-page .production-grid-wrap,
  .production-page .production-side-grid {
    max-height: none;
  }
}

.labour-wire-page .labour-wire-company {
  margin-left: auto;
  font-size: var(--entry-font-size);
  font-weight: 700;
}

.labour-wire-page .labour-wire-fields {
  display: grid;
  grid-template-columns: minmax(16rem, 1.15fr) minmax(14rem, 0.85fr);
  column-gap: 0.8rem;
  align-items: start;
}

.labour-wire-page .labour-wire-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin: 0.2rem 0;
}

.labour-wire-page .labour-wire-totals .field-row {
  grid-template-columns: 5.2rem 6rem;
}

.labour-wire-page .labour-wire-total {
  background: #80ffff;
  color: navy;
  font-weight: 700;
}

.labour-wire-page .labour-wire-grid tbody tr[data-lb-id] {
  cursor: pointer;
}

.labour-wire-page .labour-wire-links {
  display: flex;
  gap: 0.6rem;
  margin: 0.1rem 0 0.2rem;
  font-size: var(--entry-font-size);
}

.labour-wire-page .entry-grid-wrap {
  max-height: 18rem;
}

.worker-advance-page .worker-advance-company {
  margin-left: auto;
  font-size: var(--entry-font-size);
  font-weight: 700;
}

.worker-advance-page .worker-advance-filters,
.worker-advance-page .worker-advance-fields {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(14rem, 1fr);
  column-gap: 0.8rem;
  align-items: start;
}

.worker-advance-page .worker-advance-fields {
  grid-template-columns: minmax(18rem, 1.2fr) minmax(12rem, 0.8fr);
  margin-top: 0.2rem;
}

.worker-advance-page .worker-advance-totals {
  margin: 0.2rem 0;
}

.worker-advance-page .worker-advance-totals .field-row {
  grid-template-columns: 7.4rem 6rem;
}

.worker-advance-page .worker-advance-total {
  background: #80ffff;
  color: navy;
  font-weight: 700;
}

.worker-advance-page .entry-grid-wrap {
  max-height: 18rem;
}

.worker-advance-page .worker-advance-grid tbody tr[data-advance-id] {
  cursor: pointer;
}

.worker-advance-page .entry-grid-wrap.is-disabled {
  opacity: 0.55;
}

.worker-advance-page .entry-grid-wrap.is-disabled .worker-advance-grid tbody tr[data-advance-id] {
  cursor: default;
  pointer-events: none;
}

@media (max-width: 767.98px) {
  .worker-advance-page .worker-advance-filters,
  .worker-advance-page .worker-advance-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .labour-wire-page .labour-wire-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.payment-page .payment-company {
  margin-left: auto;
  font-size: var(--entry-font-size);
  font-weight: 700;
}

.payment-page .payment-sections,
.payment-page .payment-fields,
.payment-page .payment-search {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 1fr);
  column-gap: 0.8rem;
  align-items: start;
}

.payment-page .payment-panel {
  margin: 0 0 0.35rem;
  padding: 0.25rem 0.45rem 0.35rem;
  border: 1px solid #9ec9c9;
}

.payment-page .payment-panel legend {
  float: none;
  width: auto;
  margin-bottom: 0.2rem;
  padding: 0 0.25rem;
  font-size: var(--entry-font-size);
  font-weight: 700;
  color: navy;
}

.payment-page .form-control:not(.payment-total) {
  background-color: #fff;
  color: #212529;
}

.payment-page .form-control:disabled,
.payment-page .form-control[readonly]:not(.payment-total) {
  background-color: #e9ecef;
  color: #212529;
  opacity: 1;
}

.payment-page .payment-total {
  background-color: #80ffff;
  color: navy;
  font-weight: 700;
}

.payment-page #BtnSearch {
  margin-top: 0.15rem;
}

.payment-page .payment-grid-total .field-row {
  grid-template-columns: 7.4rem 6rem;
}

.login-panel {
  max-width: 28rem;
}

.login-brand,
.welcome-brand {
  margin-bottom: 0.25rem;
  color: #000040;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid #c4a8c4;
  border-radius: 0.4rem;
  background: #fff;
  color: #000040;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.welcome-card-arrow {
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.welcome-card:hover,
.welcome-card:focus {
  background: #f7f1f8;
  color: #000040;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(42, 39, 80, 0.08);
}

.welcome-card:hover .welcome-card-arrow,
.welcome-card:focus .welcome-card-arrow {
  transform: translateX(4px);
}

.welcome-card:focus-visible {
  outline: 2px solid #000040;
  outline-offset: 2px;
}

.payment-page .entry-grid-wrap {
  max-height: 16rem;
}

.payment-page .payment-grid tbody tr[data-pay-id] {
  cursor: pointer;
}

.payment-page .payment-mark {
  background: #ffff00;
}

@media (max-width: 767.98px) {
  .payment-page .payment-sections,
  .payment-page .payment-fields,
  .payment-page .payment-search {
    grid-template-columns: minmax(0, 1fr);
  }
}

nav.app-menu-strip {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.login-panel {
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem 1.4rem;
  border: 1px solid #e4d7e6;
  border-radius: 0.7rem;
  background: #fff;
}

.btn {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  transition: background-color 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), border-color 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.12s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.16);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.btn:hover:not(:disabled):not(.disabled)::after,
.btn:focus-visible:not(:disabled)::after {
  transform: scaleX(1);
}

.btn:hover:not(:disabled):not(.disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(42, 39, 80, 0.12);
}

.btn:active:not(:disabled):not(.disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid #000040;
  outline-offset: -3px;
}

.btn:disabled,
.btn.disabled {
  transform: none;
  box-shadow: none;
}

.btn:disabled::after,
.btn.disabled::after,
.btn-link::after {
  transform: scaleX(0);
}

.btn-link:hover,
.btn-link:active {
  transform: none;
  box-shadow: none;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:disabled,
.btn-primary.disabled {
  color: #fff;
  background-color: #2a2750;
  border-color: #2a2750;
}

.btn-primary:active {
  background-color: #211e40;
  border-color: #211e40;
}

.btn-outline-primary,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary:disabled,
.btn-outline-primary.disabled {
  color: #2a2750;
  background-color: #fff;
  border-color: #c4b0cc;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  border-color: #2a2750;
}

.btn-outline-primary::after,
.btn-outline-secondary::after {
  background: #f3e7f4;
}

.btn-success,
.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success:disabled,
.btn-success.disabled {
  color: #fff;
  background-color: #2f6b58;
  border-color: #2f6b58;
}

.btn-success:active {
  background-color: #275846;
  border-color: #275846;
}

.btn-outline-danger,
.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active,
.btn-outline-danger:disabled,
.btn-outline-danger.disabled {
  color: #8d3144;
  background-color: #fff;
  border-color: #d3a3ad;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
  border-color: #8d3144;
}

.btn-outline-danger::after {
  background: #f8ecee;
}

.btn-danger,
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger:disabled,
.btn-danger.disabled {
  color: #fff;
  background-color: #8d3144;
  border-color: #8d3144;
}

.btn-danger:active {
  background-color: #742836;
  border-color: #742836;
}

.btn.is-success {
  background-color: #2f6b58;
  border-color: #2f6b58;
  color: #fff;
}

.btn.is-loading {
  pointer-events: none;
}

.btn.is-loading::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: -0.35rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: malwa-spin 0.7s linear infinite;
}

.btn-forward,
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.btn-forward:hover .btn-arrow,
.btn-forward:focus-visible .btn-arrow {
  transform: translateX(4px);
}

.btn-back:hover .btn-arrow,
.btn-back:focus-visible .btn-arrow {
  transform: translateX(-4px);
}

.dashboard-page {
  padding-bottom: 1rem;
}

.dashboard-heading {
  margin-bottom: 0.45rem;
}

.dashboard-heading h1 {
  margin-bottom: 0.1rem;
  font-size: 1.25rem;
  line-height: 1.2;
}

.dashboard-meta {
  margin-bottom: 0.15rem;
  color: #4d465c;
  font-size: 0.88rem;
}

.period-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.45rem 0 0.85rem;
}

.mix-filter-bar,
.chart-type-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.chart-type-bar .btn,
.mix-filter-bar .btn {
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
  line-height: 1.25;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.dash-card {
  border: 1px solid #e4d7e6;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.95rem 1rem 1rem;
  box-shadow: 0 1px 2px rgba(42, 39, 80, 0.04);
  animation: dash-rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.dashboard-grid .dash-card:nth-child(2) { animation-delay: 0.05s; }
.dashboard-grid .dash-card:nth-child(3) { animation-delay: 0.1s; }
.dashboard-grid .dash-card:nth-child(4) { animation-delay: 0.15s; }

.dash-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.dash-card h2,
.dashboard-links h2,
.dash-progress h2 {
  margin: 0;
  font-size: 1.05rem;
}

.dash-unit,
.chart-caption,
.dashboard-note {
  margin: 0.15rem 0 0;
  color: #625b70;
  font-size: 0.82rem;
}

.dash-total,
.donut-value {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.chart-host {
  position: relative;
  min-height: 9rem;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-axis {
  fill: #625b70;
  font-size: 11px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.chart-dot {
  fill: #fff;
  stroke: #5c4d86;
  stroke-width: 2;
}

.chart-dot:hover,
.chart-dot:focus,
.chart-bar:hover,
.chart-bar:focus {
  outline: none;
}

.chart-tip {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  max-width: calc(100% - 0.4rem);
  padding: 0.25rem 0.45rem;
  border-radius: 0.35rem;
  background: #2a2750;
  color: #fff;
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 2;
}

.chart-empty {
  margin: 2rem 0;
  color: #625b70;
}

.hbar-list,
#progress-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.hbar-row,
.progress-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 7rem) minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  animation: dash-rise 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--stagger, 0) * 45ms);
}

.progress-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem;
}

.progress-label,
.hbar-name,
.hbar-value {
  font-size: 0.8rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.progress-track {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e7f1;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #8d82ad, #5c4d86);
  animation: progress-fill 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: calc(var(--stagger, 0) * 45ms);
}

.progress-fill.is-bags {
  background: linear-gradient(90deg, #8d7eb4, #5c4d86);
}

.wire-side {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.8rem 0 0;
}

.wire-side dt {
  color: #625b70;
  font-size: 0.75rem;
}

.wire-side dd {
  margin: 0;
  font-weight: 700;
}

.donut-layout {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.donut-wrap {
  position: relative;
}

.donut-center {
  position: absolute;
  inset: 22%;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-value {
  font-size: 1rem;
  margin: 0;
}

.donut-unit,
.mix-detail p {
  margin: 0;
  color: #625b70;
  font-size: 0.78rem;
}

.mix-detail {
  padding: 0.75rem;
  border-radius: 0.6rem;
  background: #f7f2f7;
  transition: background-color 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mix-detail.is-changing {
  background: #f3e7f4;
  transform: translateX(4px);
}

.mix-detail h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.mix-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e4d7e6;
  border-radius: 999px;
  background: #fff;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
}

.mix-chip-check {
  cursor: pointer;
  user-select: none;
}

.mix-chip-check .mix-check {
  margin: 0;
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
}

.mix-chip[aria-pressed="true"] {
  border-color: #2a2750;
  background: #f7f1f8;
}

.mix-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.ring-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.ring {
  width: 5.4rem;
  min-height: 5.4rem;
  padding: 0.7rem;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #fff 68%, transparent 70%),
    conic-gradient(var(--ring, #5c4d86) calc(var(--portion, 0) * 1turn), #efe6f0 0);
  font-size: 0.72rem;
  font-weight: 700;
  animation: dash-rise 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--stagger, 0) * 50ms);
}

.ring-label {
  display: block;
  max-width: 4.2rem;
  font-weight: 600;
  color: #625b70;
}

.dash-progress,
.dashboard-links {
  margin-top: 0.9rem;
}

.dashboard-page.is-loading .chart-host::after,
.dashboard-page.is-loading #progress-list::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.4rem;
  background: linear-gradient(90deg, rgba(243, 238, 242, 0.2) 25%, rgba(255, 255, 255, 0.9) 50%, rgba(243, 238, 242, 0.2) 75%);
  background-size: 200% 100%;
  animation: malwa-skeleton 1.1s ease infinite;
}

.dashboard-page.is-loading #progress-list {
  position: relative;
  min-height: 4rem;
}

@keyframes dash-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes progress-fill {
  from { width: 0; }
  to { width: calc(var(--fill, 0) * 1%); }
}

@keyframes malwa-spin {
  to { transform: rotate(360deg); }
}

@keyframes malwa-skeleton {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 900px) {
  .dashboard-grid,
  .donut-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.company-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.company-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #e4d7e6;
  border-radius: 0.55rem;
  background: #fff;
}

.company-row-name {
  margin: 0;
  color: #000040;
  font-weight: 700;
}

.btn.is-error {
  color: #fff;
  background-color: #8d3144;
  border-color: #8d3144;
}

.malwa-loader {
  --malwa-loader-size: 60px;
  --malwa-progress: 28;
  position: relative;
  display: inline-grid;
  width: var(--malwa-loader-size);
  height: var(--malwa-loader-size);
  place-items: center;
  flex: 0 0 auto;
}

.malwa-loader-inline {
  --malwa-loader-size: 18px;
  margin-right: 0.35rem;
  vertical-align: -0.2rem;
}

.malwa-loader-small {
  --malwa-loader-size: 44px;
}

.malwa-loader-main {
  --malwa-loader-size: 60px;
}

.malwa-loader-track,
.malwa-loader-face {
  position: absolute;
  border-radius: 50%;
}

.malwa-loader-track {
  inset: 0;
  background: conic-gradient(#2a2750 calc(var(--malwa-progress) * 1%), rgba(216, 191, 216, 0.72) 0);
  filter: drop-shadow(0 0 5px rgba(42, 39, 80, 0.28));
}

.malwa-loader.is-indeterminate .malwa-loader-track {
  animation: malwa-loader-spin 0.9s linear infinite;
}

.malwa-loader.has-progress .malwa-loader-track {
  animation: none;
}

.malwa-loader-face {
  inset: 18%;
  background: #fff;
}

.malwa-loader-inline .malwa-loader-face {
  background: transparent;
}

.malwa-loader-value {
  position: relative;
  color: #2a2750;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.malwa-loader-inline .malwa-loader-value,
.malwa-loader.is-indeterminate .malwa-loader-value {
  display: none;
}

.malwa-process {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: grid;
  place-items: center;
  background: rgba(36, 31, 51, 0.28);
}

.malwa-process-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  min-width: 12rem;
  padding: 1rem 1.2rem 1.1rem;
  border: 1px solid #e4d7e6;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(42, 39, 80, 0.16);
}

.malwa-process-text {
  margin: 0;
  color: #241f33;
  font-weight: 700;
}

.whatsapp-page {
  max-width: 46rem;
}

.whatsapp-settings-page {
  max-width: 96rem;
}

.whatsapp-settings-page .wa-template-pane .row > [class*="col-"] {
  min-width: 0;
}

.whatsapp-settings-page .wa-template-text {
  min-height: 9.5rem; /* ~152px — comfortable for longer intro messages */
  height: 9.5rem;
  resize: vertical;
  line-height: 1.45;
}

.whatsapp-nav-tabs .nav-link {
  color: #2a2750;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
}

.whatsapp-nav-tabs .nav-link.active {
  color: #000040;
  background-color: #fff;
  border-color: #c4a8c4 #c4a8c4 #fff;
}

.wa-sample-preview {
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e4d7e6;
  border-radius: 0.45rem;
  background: #faf7fa;
  color: #241f33;
  font-size: 0.8rem;
  line-height: 1.45;
  min-height: 14rem;
  word-break: normal;
  overflow-wrap: normal;
}

.wa-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem 1rem;
  background: rgba(0, 0, 64, 0.34);
  font-family: var(--bs-body-font-family);
}

.wa-preview-modal[hidden] {
  display: none !important;
}

.wa-preview-modal-panel {
  width: min(38rem, 100%);
  max-height: calc(100vh - 4.5rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #000040;
  border-radius: 0.4rem;
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 64, 0.25);
  overflow: hidden;
}

.wa-preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: #d8bfd8;
  color: #000040;
  border-bottom: 1px solid #c4a8c4;
}

.wa-preview-modal-header h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #000040;
}

.wa-preview-modal-body {
  padding: 0.75rem 0.85rem;
  overflow: auto;
  flex: 1 1 auto;
}

.wa-preview-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.wa-preview-meta .field-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
}

.wa-preview-meta .field-row label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2a2750;
}

.wa-preview-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem !important;
  height: auto !important;
  min-height: 12rem !important;
  line-height: 1.35 !important;
  padding: 0.5rem 0.65rem !important;
  white-space: pre-wrap;
}

.wa-preview-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-top: 1px solid #e4d7e6;
  background: #faf7fa;
}

@media (max-width: 767.98px) {
  .wa-preview-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

.whatsapp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.whatsapp-preview {
  margin-top: 1.2rem;
}

.whatsapp-preview pre {
  white-space: pre-wrap;
  padding: 0.9rem 1rem;
  border: 1px solid #e4d7e6;
  border-radius: 0.55rem;
  background: #fff;
  color: #241f33;
}

@keyframes malwa-loader-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 575.98px) {
  .company-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/*
  Mobile responsive pass for phones and small tablets.
  Desktop / large-tablet rules above stay the source of truth;
  these overrides only enlarge touch targets and prevent overflow.
*/
@media (max-width: 767.98px) {
  html {
    font-size: 15px;
  }

  body {
    margin-bottom: 4.5rem;
    overflow-x: hidden;
  }

  .container,
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .footer {
    white-space: normal;
    line-height: 1.35;
    padding: 0.75rem 0;
    height: auto;
  }

  /* Navigation: tappable collapsed menu */
  nav.app-menu-strip .navbar-toggler {
    padding: 0.45rem 0.65rem;
    border-color: #000040;
  }

  nav.app-menu-strip .navbar-brand,
  nav.app-menu-strip .navbar-nav .nav-link,
  nav.app-menu-strip .navbar-nav button.nav-link {
    font-size: 0.95rem;
    padding: 0.55rem 0.75rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }

  nav.app-menu-strip .dropdown-item {
    font-size: 0.92rem;
    padding: 0.55rem 0.9rem;
    min-height: 2.5rem;
  }

  nav.app-menu-strip .dropdown-menu {
    max-height: min(70vh, 28rem);
    overflow-y: auto;
  }

  /* Login / company selection */
  .login-panel {
    max-width: none;
    width: 100%;
    margin-top: 0.75rem;
    padding: 1rem 0.95rem 1.15rem;
  }

  .login-panel .form-control,
  .login-panel .input-group .btn,
  .company-select-page .form-control,
  .company-select-page .btn {
    min-height: 2.75rem;
  }

  .login-panel .btn-primary[type="submit"] {
    width: 100%;
    min-height: 2.75rem;
  }

  .login-panel .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.15rem;
  }

  .company-select-page .btn,
  .company-row .btn {
    width: 100%;
  }

  .company-select-page form.row .col-md-2 {
    width: 100%;
  }

  .company-select-page form.row .col-md-2 .btn {
    width: 100%;
  }

  /* Data-entry pages: readable, finger-sized controls */
  .data-entry-page {
    --entry-font-size: 0.92rem;
    --entry-heading-size: 1.15rem;
    --entry-control-height: 2.65rem;
    --entry-label-width: 6.4rem;
    --entry-row-gap: 0.35rem;
    --entry-action-gap: 0.4rem;
  }

  .data-entry-page .field-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.2rem;
    align-items: stretch;
  }

  .data-entry-page .field-row label {
    font-weight: 600;
  }

  .data-entry-page .form-control,
  .data-entry-page .form-select,
  .data-entry-page input[type="date"],
  .data-entry-page input[type="month"] {
    font-size: var(--entry-font-size);
    height: var(--entry-control-height);
    min-height: var(--entry-control-height);
    padding: 0.35rem 0.55rem;
  }

  .data-entry-page .entry-actions .btn,
  .data-entry-page .customer-heading .btn,
  .data-entry-page .worker-heading .btn,
  .data-entry-page .rate-heading .btn,
  .data-entry-page .sale-heading .btn,
  .data-entry-page .entry-action-bar .btn {
    min-height: 2.65rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
  }

  .data-entry-page .entry-grid-wrap,
  .statement-page .statement-summary-wrap,
  .statement-page .statement-grid-wrap,
  .production-page .production-grid-wrap,
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .data-entry-page .entry-grid-wrap th,
  .data-entry-page .entry-grid-wrap td {
    padding: 0.4rem 0.45rem;
    white-space: nowrap;
  }

  .lookup-host .form-control {
    padding-right: 2.4rem;
  }

  .lookup-trigger {
    width: 2.4rem;
    height: var(--entry-control-height);
  }

  .lookup-trigger svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .lookup-dialog .form-control,
  .lookup-dialog .btn {
    height: auto;
    min-height: 2.65rem;
    padding: 0.4rem 0.65rem;
  }

  .lookup-dialog-grid th,
  .lookup-dialog-grid td {
    padding: 0.45rem 0.5rem;
  }

  .sale-entry-page .sale-fields .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .sale-entry-page .sale-fields .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
  }

  .sale-entry-page .sale-totals {
    grid-template-columns: minmax(0, 1fr);
  }

  .production-page .production-qty,
  .production-page .production-total {
    grid-template-columns: minmax(0, 1fr);
  }

  .labour-wire-page .labour-wire-totals .field-row,
  .worker-advance-page .worker-advance-totals .field-row,
  .payment-page .payment-grid-total .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .labour-wire-page .labour-wire-company,
  .worker-advance-page .worker-advance-company,
  .payment-page .payment-company {
    margin-left: 0;
    width: 100%;
  }

  /* Dashboard */
  .dashboard-heading h1 {
    font-size: 1.15rem;
  }

  .dash-card {
    padding: 0.85rem 0.8rem 0.9rem;
  }

  .dash-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .period-bar .btn,
  .chart-type-bar .btn,
  .mix-filter-bar .btn {
    min-height: 2.4rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }

  .hbar-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

  .ring {
    width: 4.8rem;
    min-height: 4.8rem;
  }

  /* Users / WhatsApp / Worker Salary: enlarge compact Bootstrap controls */
  .user-management-page .form-control,
  .user-management-page .form-select,
  .user-management-page .btn,
  .whatsapp-settings-page .form-control,
  .whatsapp-settings-page .form-select,
  .whatsapp-settings-page .btn,
  .whatsapp-page .form-control,
  .whatsapp-page .form-select,
  .whatsapp-page .btn,
  .worker-salary-page .form-control,
  .worker-salary-page .form-select,
  .worker-salary-page .btn {
    min-height: 2.65rem;
    font-size: 0.95rem;
  }

  .user-management-page .form-control-sm,
  .user-management-page .form-select-sm,
  .whatsapp-settings-page .form-control-sm,
  .whatsapp-settings-page .form-select-sm {
    min-height: 2.65rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.95rem;
  }

  .whatsapp-settings-page .wa-template-text {
    min-height: 8rem;
    height: 8rem;
  }

  .user-management-page .btn-sm,
  .whatsapp-settings-page .btn-sm {
    min-height: 2.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
  }

  .whatsapp-nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
  }

  .whatsapp-nav-tabs .nav-item {
    flex: 0 0 auto;
  }

  .whatsapp-nav-tabs .nav-link {
    white-space: nowrap;
    min-height: 2.65rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
  }

  .wa-preview-modal {
    padding: 0.5rem;
    align-items: stretch;
  }

  .wa-preview-modal-panel {
    width: 100%;
    max-height: calc(100vh - 1rem);
  }

  .wa-preview-modal-footer {
    flex-wrap: wrap;
  }

  .wa-preview-modal-footer .btn {
    flex: 1 1 auto;
    min-height: 2.65rem;
  }

  .malwa-process-card {
    width: min(18rem, calc(100vw - 2rem));
    min-width: 0;
  }

  .welcome-card {
    min-height: 3.25rem;
    padding: 0.9rem 1rem;
  }
}

@media (max-width: 429.98px) {
  .data-entry-page {
    --entry-label-width: 100%;
  }

  .navbar-brand {
    max-width: calc(100% - 3.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    word-break: normal;
  }

  .dash-total {
    font-size: 1.3rem;
  }

  .period-bar {
    gap: 0.3rem;
  }

  .period-bar .btn {
    flex: 1 1 calc(50% - 0.3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn::after,
  .btn-arrow,
  .welcome-card,
  .welcome-card-arrow,
  .malwa-loader-track,
  .dash-card,
  .progress-row,
  .hbar-row,
  .progress-fill,
  .ring,
  .mix-detail,
  .chart-line,
  .chart-bar {
    animation: none !important;
    transition: none !important;
  }

  .progress-fill {
    width: calc(var(--fill, 0) * 1%);
  }
}
