:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #d6e1f0;
  --line-strong: #b9cae4;
  --text: #0b1730;
  --muted: #60708a;
  --blue: #2563eb;
  --blue-dark: #1747b8;
  --green: #0f9f5f;
  --red: #dc2626;
  --orange: #d97706;
  --shadow: 0 16px 45px rgba(38, 62, 103, 0.12);
  --radius: 8px;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.v2-root {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(244, 247, 251, 0.96)),
    var(--bg);
}

.auth-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-card--compact {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  font-size: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  align-items: center;
  gap: 12px;
}

.field-row label {
  color: #35445d;
  font-size: 13px;
  font-weight: 700;
}

.field-row input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #eef4ff;
  color: var(--text);
  outline: none;
}

.field-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.btn-primary {
  min-width: 132px;
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.btn:disabled,
.btn-primary:disabled {
  cursor: not-allowed;
  background: #eef3fb;
  border-color: #d7e1f0;
  color: #72819a;
  box-shadow: none;
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.message.success {
  color: var(--green);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.side-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 18px;
  border-bottom: 1px solid var(--line);
}

.nav-section {
  margin: 18px 0;
}

.nav-section-title {
  margin: 0 0 8px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-group {
  position: relative;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-group-toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  list-style: none;
}

.nav-group-toggle::-webkit-details-marker {
  display: none;
}

.nav-group-toggle::after {
  content: ">";
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  transition: transform 120ms ease;
}

.nav-group[open] > .nav-group-toggle::after {
  transform: rotate(90deg);
}

.nav-group.has-active-route > .nav-group-toggle {
  background: #eaf2ff;
  border-radius: 7px;
  color: var(--blue);
}

.nav-group-list {
  display: grid;
  gap: 3px;
  padding: 4px 0 4px 28px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.nav-child-link {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.nav-link[aria-current="page"] {
  background: #eaf2ff;
  border-color: #bed3ff;
  color: var(--blue);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #f0f4fa;
  font-size: 12px;
}

.rail-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #1e40af;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 56px;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar-spacer {
  min-height: 1px;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #b7ebcd;
  border-radius: 999px;
  background: #effdf5;
  color: #087443;
  font-size: 12px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset 0 0 0 3px #effdf5;
}

.status-pill[data-state="connecting"],
.status-pill[data-state="reconnecting"] {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.status-pill[data-state="connecting"]::before,
.status-pill[data-state="reconnecting"]::before {
  background: var(--orange);
  box-shadow: inset 0 0 0 3px #fff7ed;
}

.status-pill[data-state="offline"],
.status-pill[data-state="unsupported"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.status-pill[data-state="offline"]::before,
.status-pill[data-state="unsupported"]::before {
  background: var(--red);
  box-shadow: inset 0 0 0 3px #fef2f2;
}

.module-host {
  min-width: 0;
  padding: 20px 24px 96px;
}

.module-host:has(.delivery-desktop-parity),
.module-host:has(.challan-desktop-parity) {
  padding-bottom: 20px;
}

@media (min-width: 921px) {
  html:has(.delivery-desktop-parity) {
    overflow: hidden;
  }

  body:has(.delivery-desktop-parity),
  body:has(.challan-desktop-parity) {
    overflow: hidden;
  }

  .module-host:has(.delivery-desktop-parity) {
    height: calc(100vh - 56px);
    overflow: hidden;
    padding: 12px 24px;
  }

  .module-host:has(.challan-desktop-parity) {
    height: calc(100vh - 56px);
    overflow: hidden;
    padding: 12px 24px;
  }
}

.module-host:focus {
  outline: none;
}

.page-grid {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.dashboard-kpis {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(40, 62, 94, 0.06);
}

.panel-pad {
  padding: 18px;
}

.metric {
  min-height: 108px;
}

.metric strong {
  display: block;
  margin-top: 18px;
  font-size: 24px;
}

.split-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.table-shell {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  font-size: 13px;
}

.table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bottom-bar {
  position: fixed;
  left: 248px;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 40px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.chip span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.loading-block {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.module-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tab-strip {
  display: flex;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.tab-button {
  min-height: 38px;
  min-width: 88px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 12px;
  background: var(--surface-soft);
  color: #31415b;
  font-weight: 800;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button.is-active {
  background: var(--blue);
  color: #fff;
}

.inline-search {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.inline-search label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-search input,
.inline-field input,
.inline-field select {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.inline-search input:focus,
.inline-field input:focus,
.inline-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.delivery-v2 {
  min-width: 0;
}

.delivery-workbench {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.1fr) minmax(280px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.delivery-row-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.delivery-row {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  text-align: left;
}

.delivery-row:hover,
.delivery-row:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.delivery-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.delivery-row strong,
.delivery-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-row small {
  color: var(--muted);
  font-weight: 700;
}

.delivery-desktop-parity {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding-bottom: 0;
}

.delivery-desktop-parity .delivery-workbench {
  grid-template-columns: minmax(280px, 0.75fr) minmax(500px, 1.45fr) minmax(320px, 0.8fr);
  gap: 10px;
  align-items: start;
  height: 100%;
  min-height: 0;
}

.delivery-desktop-parity .delivery-list-panel,
.delivery-desktop-parity .delivery-form-panel,
.delivery-desktop-parity .delivery-side-stack {
  min-width: 0;
  min-height: 0;
}

.delivery-desktop-parity .delivery-list-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.delivery-desktop-parity .delivery-form-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  align-self: start;
}

.delivery-side-stack {
  display: grid;
  align-self: start;
  align-content: start;
  gap: 12px;
}

.delivery-metrics-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.delivery-metrics-strip .metric {
  min-height: 48px;
  padding: 7px 10px;
  box-shadow: none;
}

.delivery-metrics-strip .metric span {
  font-size: 10px;
}

.delivery-metrics-strip .metric strong {
  margin-top: 2px;
  font-size: 19px;
}

.delivery-editor-head {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 120px;
  gap: 10px;
  align-items: start;
}

.receipt-lookup-grid {
  display: grid;
  gap: 6px;
}

.delivery-forward-picker {
  --delivery-forward-label-width: 112px;
  position: relative;
  min-width: 0;
}

.delivery-forward-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 0;
}

.delivery-forward-control input {
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.delivery-forward-dropdown-btn {
  min-width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
  font-size: 15px;
  line-height: 1;
}

.delivery-forward-suggestions {
  position: absolute;
  z-index: 60;
  top: calc(100% + 2px);
  left: calc(var(--delivery-forward-label-width) + 8px);
  width: calc(100% - var(--delivery-forward-label-width) - 8px);
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(40, 62, 94, 0.16);
  padding: 4px;
}

.delivery-forward-option {
  width: 100%;
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
}

.delivery-forward-option:hover,
.delivery-forward-option.is-highlighted {
  background: #eaf2ff;
}

.delivery-forward-option span {
  font-size: 13px;
  font-weight: 800;
}

.delivery-forward-option small,
.delivery-forward-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.delivery-forward-empty {
  padding: 9px 8px;
}

.delivery-editor-title {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  align-self: stretch;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  text-align: left;
}

.delivery-editor-title h2 {
  margin: 0;
  font-size: 18px;
}

.delivery-editor-title p {
  display: none;
}

.receipt-no-box {
  min-height: 60px;
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px 12px;
  text-align: right;
}

.receipt-no-box span,
.receipt-no-box small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.receipt-no-box strong {
  font-size: 22px;
  line-height: 1;
}

.delivery-entry-split {
  min-width: 0;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.delivery-entry-split .charge-grid {
  margin-top: 0;
  grid-template-columns: 1fr;
  gap: 5px;
  align-content: start;
}

.delivery-entry-split .charge-grid h3 {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: #7c2d12;
  font-size: 15px;
  line-height: 1.2;
}

.delivery-entry-split .amount-box {
  grid-column: 1 / -1;
  min-height: 34px;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.delivery-entry-split .amount-box span {
  color: #33435e;
  font-size: 12px;
  text-transform: none;
}

.delivery-entry-split .amount-box input {
  height: 34px;
  font-size: 16px;
}

.receipt-total-box {
  grid-column: 1 / -1;
  min-height: 36px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.receipt-total-box span {
  color: #33435e;
  font-size: 12px;
  font-weight: 800;
}

.receipt-total-box strong {
  justify-self: end;
  font-size: 17px;
}

.delivery-entry-split .receipt-entry-grid {
  grid-template-columns: 1fr;
  gap: 5px;
  align-content: start;
}

.delivery-desktop-parity .delivery-payment-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  margin-top: 8px;
}

.delivery-received-in-field {
  grid-column: span 2;
}

.delivery-desktop-parity .inline-field {
  grid-template-columns: 88px minmax(0, 1fr);
}

.delivery-desktop-parity .delivery-forward-picker {
  --delivery-forward-label-width: 88px;
}

.delivery-desktop-parity .inline-field input,
.delivery-desktop-parity .inline-field select {
  height: 36px;
  min-height: 36px;
  border-radius: 7px;
}

.delivery-desktop-parity .delivery-forward-control input,
.delivery-desktop-parity .delivery-forward-dropdown-btn {
  height: 36px;
  min-height: 36px;
}

.delivery-desktop-parity .delivery-wide-field {
  grid-column: 1 / -1;
}

.delivery-side-stack .panel {
  box-shadow: 0 8px 26px rgba(40, 62, 94, 0.04);
}

.delivery-detail-panel {
  position: relative;
  display: grid;
  gap: 10px;
}

.old-record-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.old-record-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.delivery-old-record-controls {
  position: relative;
  display: grid;
  gap: 8px;
}

.delivery-old-filter-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.9fr) 28px minmax(0, 1.15fr);
  gap: 6px;
  align-items: end;
}

.delivery-old-filter,
.delivery-old-picker {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.delivery-old-filter input,
.delivery-old-filter select,
.delivery-old-picker input {
  min-width: 0;
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.delivery-old-filter input:focus,
.delivery-old-filter select:focus,
.delivery-old-picker input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.delivery-old-clear-date {
  width: 28px;
  height: 30px;
  min-width: 28px;
  min-height: 30px;
  padding: 0;
  align-self: end;
  font-size: 16px;
  line-height: 1;
}

.delivery-old-picker-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
}

.delivery-old-dropdown-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
}

.delivery-old-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 338px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.delivery-old-suggestions[hidden] {
  display: none;
}

.delivery-old-option {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  text-align: left;
}

.delivery-old-option:last-child {
  border-bottom: 0;
}

.delivery-old-option:hover,
.delivery-old-option:focus {
  background: #eff6ff;
  outline: none;
}

.delivery-old-option span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.delivery-old-option strong,
.delivery-old-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-old-option small,
.delivery-old-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.delivery-old-status {
  min-height: 14px;
  margin: 0;
}

.delivery-old-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.delivery-old-message.success {
  color: #047857;
}

.delivery-old-message.error {
  color: #b91c1c;
}

.delivery-form-footer {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.delivery-form-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.delivery-form-summary .chip {
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  overflow: hidden;
  font-size: 13px;
}

.delivery-form-summary .chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}

.delivery-form-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.delivery-form-actions .btn {
  min-width: 96px;
}

.loading-block.is-compact {
  min-height: 44px;
}

.delivery-v2.is-old-open .delivery-list-panel,
.delivery-v2.is-old-open .delivery-form-panel {
  opacity: 0.36;
  pointer-events: none;
}

.delivery-v2.is-old-open.has-old-selection .delivery-form-panel {
  opacity: 1;
  pointer-events: auto;
}

.delivery-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.36);
  padding: 20px;
}

.delivery-confirm-backdrop[hidden] {
  display: none;
}

.delivery-payment-reference[hidden] {
  display: none !important;
}

.delivery-confirm-dialog {
  width: min(400px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  padding: 18px;
}

.delivery-confirm-dialog h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.delivery-confirm-summary {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.delivery-confirm-summary div {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.delivery-confirm-summary div:last-child {
  border-bottom: 0;
}

.delivery-confirm-summary strong {
  color: var(--text);
}

.delivery-confirm-charge {
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr minmax(120px, 160px);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.delivery-confirm-charge input {
  width: 100%;
  min-height: 34px;
  text-align: right;
}

.delivery-share-dialog {
  width: min(560px, 100%);
}

.delivery-share-dialog textarea {
  width: 100%;
  resize: vertical;
}

.delivery-share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.delivery-share-close {
  width: 100%;
  margin-top: 8px;
}

.check-row.is-disabled {
  opacity: 0.55;
}

.btn.btn-danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.btn.btn-danger:hover:not(:disabled),
.btn.btn-danger:focus-visible:not(:disabled) {
  border-color: #fca5a5;
  background: #fee2e2;
}

.btn.btn-danger:disabled {
  border-color: var(--line);
  background: #eef3fb;
  color: var(--muted);
}

.delivery-mode-tabs {
  min-width: 188px;
}

.button-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.delivery-detail-panel .button-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2px;
}

.delivery-settings-panel {
  display: grid;
  gap: 10px;
}

.delivery-side-stack .delivery-settings-panel {
  gap: 6px;
  padding: 12px;
}

.delivery-side-stack .delivery-settings-panel .eyebrow {
  margin: 0;
}

.delivery-side-stack .check-row {
  min-height: 34px;
  padding: 6px 8px;
}

.check-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.collections-v2 {
  min-width: 0;
  padding-bottom: 118px;
}

.collection-desk-tabs {
  margin-bottom: 14px;
}

.collection-desk-shell {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(320px, 0.62fr) minmax(320px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.collection-primary-panel,
.collections-queue-panel,
.collections-sheet-panel {
  min-width: 0;
}

.collection-desk-selector {
  display: grid;
  grid-template-columns: minmax(180px, 0.46fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.collection-desk-selector .inline-field {
  grid-template-columns: 72px minmax(0, 1fr);
}

.collection-lookup-field {
  grid-template-columns: 96px minmax(0, 1fr);
}

.collection-loaded-grid,
.collection-queue-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.collection-fact {
  min-width: 0;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.collection-fact span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.collection-fact strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-bank-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(260px, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.collection-bank-panel[hidden] {
  display: none;
}

.collection-live-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.collection-current-list {
  min-height: 360px;
  max-height: calc(100vh - 420px);
}

.collection-queue-row {
  min-height: 70px;
}

.collections-workbench {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1fr) minmax(300px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.collection-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.55fr) minmax(160px, 0.55fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.collection-search-field {
  grid-template-columns: 70px minmax(0, 1fr);
}

.collection-row-list,
.queue-row-list {
  min-height: 420px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.collection-row {
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto) minmax(100px, auto);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  text-align: left;
}

.collection-row:hover,
.collection-row:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.collection-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.collection-row strong,
.collection-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-row small {
  color: var(--muted);
  font-weight: 700;
}

.search-v2 {
  min-width: 0;
}

.search-filter-panel {
  margin-bottom: 16px;
}

.search-filter-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) repeat(3, minmax(150px, 0.7fr));
  gap: 10px;
  align-items: center;
}

.search-query-field {
  grid-column: span 2;
}

.search-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(320px, 0.36fr);
  gap: 16px;
  align-items: start;
}

.search-results-panel,
.search-detail-panel {
  min-width: 0;
}

.search-row-list {
  min-height: 480px;
  max-height: calc(100vh - 380px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.search-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) minmax(0, 1fr) minmax(126px, auto);
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.search-row:hover,
.search-row:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.search-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.search-row strong,
.search-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-row-amount {
  text-align: right;
}

.reports-v2 {
  min-width: 0;
  padding-bottom: 118px;
}

.reports-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(250px, 0.28fr) minmax(560px, 1fr) minmax(300px, 0.32fr);
  gap: 16px;
  align-items: start;
}

.reports-menu-panel,
.reports-work-panel,
.reports-detail-panel {
  min-width: 0;
}

.reports-menu-list {
  min-height: 420px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 4px;
}

.reports-menu-section {
  display: grid;
  gap: 8px;
}

.reports-menu-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reports-menu-button {
  min-height: 48px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.reports-menu-button span,
.reports-menu-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-menu-button span {
  font-size: 13px;
  font-weight: 900;
}

.reports-menu-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.reports-menu-button:hover,
.reports-menu-button:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.reports-menu-button.is-active {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
}

.reports-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.reports-filter-grid .inline-field {
  grid-template-columns: 76px minmax(0, 1fr);
}

.reports-query-field {
  grid-column: 1 / -1;
}

.reports-filter-grid > .btn {
  min-height: 44px;
  grid-column: 1 / -1;
}

.reports-result-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.reports-pager {
  flex: 0 0 auto;
}

.reports-table-shell {
  min-width: 0;
  min-height: 460px;
  max-height: calc(100vh - 430px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.reports-table {
  min-width: 900px;
  table-layout: auto;
}

.reports-table th,
.reports-table td {
  white-space: nowrap;
  word-break: normal;
}

.reports-cell-button {
  width: 100%;
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.row-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--blue);
}

.reports-mobile-back {
  display: none;
}

.accounts-v2 {
  min-width: 0;
  padding-bottom: 118px;
}

.accounts-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(640px, 1fr) minmax(320px, 0.35fr);
  gap: 16px;
  align-items: start;
}

.accounts-list-panel,
.accounts-detail-panel {
  min-width: 0;
}

.accounts-detail-panel {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.accounts-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.accounts-filter-grid .inline-field {
  grid-template-columns: 82px minmax(0, 1fr);
}

.accounts-query-field {
  grid-column: 1 / -1;
}

.accounts-result-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.accounts-row-list {
  min-height: 500px;
  max-height: calc(100vh - 410px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.account-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 150px 96px 110px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.account-row:hover,
.account-row:focus,
.account-row.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.account-ledger,
.account-type,
.account-status,
.account-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.account-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.account-main strong,
.account-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.directory-layout {
  grid-template-columns: minmax(620px, 1fr) minmax(300px, 0.34fr);
}

.directory-filter-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.directory-filter-grid .accounts-query-field {
  grid-column: span 2;
}

.directory-filter-grid .inline-field {
  grid-template-columns: 70px minmax(0, 1fr);
}

.directory-row {
  grid-template-columns: 92px minmax(0, 1fr) 132px 78px 104px;
}

.directory-row-list {
  min-height: 520px;
  max-height: calc(100vh - 430px);
}

.directory-detail-panel .detail-row strong {
  word-break: break-word;
  white-space: normal;
}

.eway-v2 {
  min-width: 0;
  padding-bottom: 118px;
}

.eway-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.32fr);
  gap: 16px;
  align-items: start;
}

.eway-main-panel,
.eway-side-panel {
  min-width: 0;
}

.eway-side-panel {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.eway-status-strip {
  margin-bottom: 14px;
}

.trust-chip-warn .trust-check {
  color: #b45309;
  background: #fffbeb;
  border-color: #fed7aa;
}

.eway-tabs {
  margin-bottom: 14px;
  overflow-x: auto;
  overflow-y: hidden;
}

.eway-tabs .tab-button {
  flex: 0 0 auto;
}

.eway-body {
  display: grid;
  gap: 14px;
}

.eway-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.eway-card {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.eway-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eway-card strong {
  font-size: 20px;
}

.eway-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.eway-checklist {
  display: grid;
  gap: 8px;
}

.eway-check-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.eway-check-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eway-form-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.eway-table-shell {
  min-height: 220px;
  max-height: calc(100vh - 500px);
  overflow: auto;
}

.eway-table {
  min-width: 620px;
}

.account-status,
.account-link {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 8px;
}

.chip-warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.accounts-mobile-back {
  display: none;
}

.invoice-v2 {
  min-width: 0;
  padding-bottom: 118px;
}

.invoice-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.24fr) minmax(0, 1fr) minmax(280px, 0.32fr);
  gap: 16px;
  align-items: start;
}

.invoice-menu-panel,
.invoice-work-panel,
.invoice-detail-panel {
  min-width: 0;
}

.invoice-detail-panel {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.invoice-menu-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.invoice-menu-button {
  width: 100%;
  min-height: 56px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.invoice-menu-button strong,
.invoice-menu-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-menu-button strong {
  font-size: 13px;
}

.invoice-menu-button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.invoice-menu-button.is-active,
.invoice-menu-button:hover,
.invoice-menu-button:focus {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
  outline: none;
}

.invoice-summary-stack {
  display: grid;
}

.invoice-type-strip,
.invoice-source-tabs {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.invoice-type-strip .tab-button {
  flex: 1 0 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.invoice-filter-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.invoice-filter-grid .inline-field {
  grid-template-columns: 100px minmax(0, 1fr);
}

.invoice-party-field,
.invoice-query-field {
  grid-column: span 2;
}

.invoice-filter-grid > .btn {
  min-height: 44px;
}

.invoice-source-tab {
  min-height: 48px;
  min-width: 170px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 12px;
  font-weight: 900;
}

.invoice-source-tab.is-active {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
}

.invoice-source-tab strong {
  min-width: 30px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
}

.invoice-result-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

.invoice-table-shell {
  min-width: 0;
  min-height: 360px;
  max-height: calc(100vh - 460px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.invoice-table {
  min-width: 980px;
  table-layout: auto;
}

.invoice-table th,
.invoice-table td {
  white-space: nowrap;
}

.invoice-table td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.invoice-table tr.is-selected td {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.row-select-button,
.invoice-cell-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue);
  padding: 0 10px;
  font: inherit;
  font-weight: 900;
}

.invoice-cell-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.invoice-extra-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.invoice-extra-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.invoice-extra-grid .inline-field {
  grid-template-columns: 82px minmax(0, 1fr);
}

.invoice-extra-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.invoice-extra-description {
  grid-column: 1 / -1;
}

.invoice-extra-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.invoice-extra-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.invoice-payment-form {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.invoice-payment-form .inline-field {
  grid-template-columns: 86px minmax(0, 1fr);
}

.invoice-payment-history {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-section-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-section-title strong {
  color: var(--text);
  font-size: 12px;
}

.invoice-payment-history-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.9fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.invoice-payment-history-row.is-cancelled {
  background: #fff7f7;
}

.invoice-payment-history-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.invoice-payment-history-row strong,
.invoice-payment-history-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-payment-history-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.builty-v2 {
  min-width: 0;
  padding-bottom: 118px;
}

.builty-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.3fr) minmax(420px, 1fr) minmax(300px, 0.4fr);
  gap: 16px;
  align-items: start;
}

.builty-source-panel,
.builty-work-panel,
.builty-register-panel {
  min-width: 0;
}

.builty-source-panel,
.builty-register-panel {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.builty-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric-mini {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px 10px;
}

.metric-mini span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-mini strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.builty-mode-tabs {
  margin-bottom: 14px;
}

.builty-form-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.builty-form-grid .inline-field,
.builty-register-filters .inline-field {
  grid-template-columns: 94px minmax(0, 1fr);
}

.builty-wide-field,
.builty-register-query {
  grid-column: 1 / -1;
}

.builty-form-grid .builty-physical-only {
  display: none;
}

.builty-v2.is-physical-mode .builty-form-grid .builty-physical-only {
  display: grid;
}

.builty-v2.is-physical-mode .builty-form-grid .builty-received-only,
.builty-v2.is-office-mode .builty-form-grid .builty-received-only {
  display: none;
}

.builty-source-list,
.builty-register-list {
  min-height: 360px;
  max-height: calc(100vh - 440px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 12px;
}

.builty-source-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(108px, 0.48fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.builty-source-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.builty-source-row strong,
.builty-source-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builty-source-row small,
.builty-register-table small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.builty-source-row span:last-child {
  text-align: right;
}

.builty-source-row.is-selected,
.builty-register-table tr.is-selected td {
  border-color: var(--blue);
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.builty-v2.is-locked-record .builty-work-panel {
  border-color: #cbd5e1;
  box-shadow: inset 3px 0 0 #64748b;
}

.builty-v2.is-locked-record .builty-form-grid input,
.builty-v2.is-locked-record .builty-form-grid select {
  background: #f8fafc;
  color: #475569;
}

.builty-register-table tr.is-locked td {
  background: #f8fafc;
  color: #475569;
}

.builty-register-table tr.is-locked td:first-child {
  box-shadow: inset 3px 0 0 #94a3b8;
}

.builty-lock-chip {
  width: max-content;
  margin-top: 5px;
}

.builty-register-filters {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.builty-register-list {
  min-width: 0;
  max-width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
  overflow-y: auto;
  contain: paint;
}

.builty-register-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.builty-register-table th,
.builty-register-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builty-register-table th:nth-child(3),
.builty-register-table td:nth-child(3),
.builty-register-table th:nth-child(4),
.builty-register-table td:nth-child(4),
.builty-register-table th:nth-child(5),
.builty-register-table td:nth-child(5) {
  display: none;
}

.builty-register-table td small {
  display: block;
}

.module-toast {
  position: sticky;
  top: 8px;
  z-index: 8;
  margin-bottom: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
}

.module-toast.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.module-toast.is-warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.chip-warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.toggle-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #31415b;
  font-size: 13px;
  font-weight: 900;
}

.collections-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.collections-entry-grid .inline-field {
  grid-template-columns: 92px minmax(0, 1fr);
}

.staff-v2 {
  min-width: 0;
}

.staff-trust-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.trust-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.trust-check {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.staff-workbench {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(640px, 1fr) minmax(320px, 0.36fr);
  gap: 16px;
  align-items: stretch;
}

.staff-queue-panel,
.staff-detail-panel {
  min-width: 0;
}

.staff-title-row {
  margin-bottom: 12px;
}

.count-badge,
.staff-total-pill {
  min-height: 32px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--blue);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.staff-total-pill {
  color: var(--text);
}

.staff-tabs {
  margin-bottom: 14px;
  width: 100%;
}

.staff-tabs .tab-button {
  flex: 1;
}

.staff-filters {
  display: grid;
  grid-template-columns: minmax(118px, 0.55fr) minmax(220px, 1.35fr) repeat(3, minmax(120px, 0.7fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.staff-filters .inline-field {
  grid-template-columns: 1fr;
  gap: 4px;
}

.staff-filters .inline-field span {
  min-height: 16px;
}

.staff-table-wrap {
  min-width: 0;
  max-height: calc(100vh - 390px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.staff-table {
  min-width: 920px;
}

.staff-table th,
.staff-table td {
  white-space: nowrap;
}

.staff-table td strong,
.staff-table td small {
  display: block;
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-table td small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.staff-table tr.is-selected td {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.staff-table tr.is-blocked td {
  background: #fff7ed;
}

.staff-table tr.is-blocked input,
.staff-table tr.is-blocked button {
  cursor: not-allowed;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.staff-detail-body {
  display: grid;
  gap: 10px;
}

.staff-batches-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.staff-mini-title {
  margin-bottom: 8px;
}

.staff-mini-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.staff-batch-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.staff-batch-row {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.staff-batch-heading,
.staff-batch-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.staff-batch-row strong {
  color: var(--text);
  font-size: 12px;
}

.staff-batch-row span,
.staff-batch-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-review-alert {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 900;
}

.staff-payment-drawer[hidden] {
  display: none;
}

.staff-payment-drawer {
  position: fixed;
  right: 24px;
  bottom: 104px;
  z-index: 30;
  width: min(420px, calc(100vw - 48px));
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.staff-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.staff-qr-zone {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.staff-cash-confirm,
.staff-qr-card {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.staff-cash-confirm {
  justify-content: space-between;
}

.staff-cash-confirm strong {
  font-size: 20px;
}

.staff-qr-card span,
.staff-qr-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.staff-qr-card strong {
  display: block;
  margin: 4px 0;
  color: var(--blue);
  font-size: 13px;
}

.staff-qr-mark {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 2px;
  border: 5px solid #fff;
  outline: 1px solid var(--line);
  background: #fff;
}

.staff-qr-image {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  gap: 0;
  overflow: hidden;
}

.staff-qr-image img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.staff-qr-image strong {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.staff-qr-mark span {
  background: #fff;
}

.staff-qr-mark span.is-on {
  background: #111827;
}

.staff-bank-mark {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
}

.challan-v2 {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding-bottom: 0;
}

.challan-header-card {
  position: relative;
  min-height: 106px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 48px 12px 12px;
}

.challan-header-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.challan-header-actions .btn {
  min-width: 112px;
  min-height: 34px;
}

.challan-record-count {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.challan-module-head,
.challan-panel-head {
  align-items: center;
}

.challan-panel-head h2 {
  font-size: 20px;
  line-height: 1.15;
}

.challan-panel-head .eyebrow {
  margin-bottom: 6px;
}

.challan-header-grid {
  display: grid;
  grid-template-columns: minmax(420px, 2fr) minmax(260px, 1.04fr) minmax(170px, 0.62fr) minmax(145px, 0.54fr) minmax(160px, 0.6fr) minmax(160px, 0.6fr);
  gap: 12px;
  align-items: end;
}

.challan-old-strip {
  display: grid;
  grid-template-columns: 136px 140px 128px minmax(240px, 1.1fr) minmax(360px, 1.8fr) auto auto;
  gap: 10px;
  align-items: end;
}

.challan-top-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #33435e;
  font-size: 13px;
  font-weight: 700;
}

.challan-top-field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challan-top-field input,
.challan-top-field select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid #d6dce5;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.challan-top-field input:focus,
.challan-top-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
  outline: none;
}

.challan-old-drawer {
  display: grid;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.challan-old-drawer[hidden] {
  display: none;
}

.challan-v2[data-old-open="true"] .challan-header-card {
  align-content: stretch;
  padding: 12px;
}

.challan-v2[data-old-open="true"] .challan-header-actions {
  display: none;
}

.challan-v2[data-old-open="true"] .challan-header-grid {
  opacity: 0.55;
}

.challan-old-pager {
  display: none;
}

.challan-old-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.challan-old-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.challan-old-row:hover,
.challan-old-row:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.challan-old-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.challan-old-row strong,
.challan-old-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challan-old-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.challan-workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 540px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}

.challan-entry-panel,
.challan-records-panel {
  min-width: 0;
  min-height: 0;
}

.challan-entry-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.challan-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 8px;
  align-content: start;
}

.challan-line-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 500;
}

.challan-line-field.is-wide {
  grid-column: 1 / -1;
}

.challan-line-field span {
  min-width: 0;
  overflow: hidden;
  color: #1f2937;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challan-line-field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  border: 1px solid #dcdfe5;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.challan-line-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
  outline: none;
}

.challan-entry-panel .message {
  min-height: 18px;
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.challan-entry-panel .message[data-tone="success"],
.challan-status-line[data-tone="success"] {
  color: var(--green);
}

.challan-entry-panel .message[data-tone="error"],
.challan-status-line[data-tone="error"] {
  color: var(--red);
}

.challan-records-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
}

.challan-table-host {
  min-height: 0;
  overflow: auto;
  border: 1px solid #dcdfe5;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(253, 245, 250, 0.5), rgba(248, 252, 255, 0.78));
}

.challan-record-table {
  min-width: 980px;
  table-layout: fixed;
}

.challan-record-table th,
.challan-record-table td {
  padding: 9px 8px;
  overflow: hidden;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.challan-record-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 251, 255, 0.94);
  color: #586983;
  font-size: 12px;
  font-weight: 800;
}

.challan-record-table td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.challan-record-table tr.is-selected td {
  background: #eff6ff;
}

.challan-record-table tr.is-locked td {
  color: var(--muted);
  background: #f8fbff;
}

.challan-record-table th:nth-child(1),
.challan-record-table td:nth-child(1) {
  width: 7%;
}

.challan-record-table th:nth-child(2),
.challan-record-table td:nth-child(2) {
  width: 8%;
}

.challan-record-table th:nth-child(3),
.challan-record-table td:nth-child(3),
.challan-record-table th:nth-child(4),
.challan-record-table td:nth-child(4) {
  width: 13%;
}

.challan-record-table th:nth-child(5),
.challan-record-table td:nth-child(5) {
  width: 8%;
}

.challan-record-table th:nth-child(6),
.challan-record-table td:nth-child(6) {
  width: 8%;
}

.challan-record-table th:nth-child(7),
.challan-record-table td:nth-child(7),
.challan-record-table th:nth-child(8),
.challan-record-table td:nth-child(8) {
  width: 8%;
}

.challan-record-table th:nth-child(9),
.challan-record-table td:nth-child(9) {
  width: 9%;
}

.challan-record-table th:nth-child(10),
.challan-record-table td:nth-child(10) {
  width: 8%;
}

.challan-record-table th:nth-child(11),
.challan-record-table td:nth-child(11) {
  width: 18%;
}

.challan-record-table .table-actions {
  gap: 6px;
}

.challan-record-table .btn-small {
  min-height: 30px;
  padding: 0 8px;
}

.challan-summary-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid #e4e9f2;
  border-bottom: 1px solid #e4e9f2;
  background: rgba(248, 251, 255, 0.84);
  padding: 9px 12px;
}

.summary-chip {
  min-width: 0;
  min-height: 40px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 10px 0 0;
}

.summary-chip span {
  color: #586983;
  font-size: 12px;
  font-weight: 800;
}

.summary-chip strong {
  align-self: end;
  font-size: 16px;
}

.summary-chip.is-net {
  color: var(--text);
}

.challan-footer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid #dcdfe5;
  padding-top: 10px;
}

.challan-status-line {
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.challan-bottom-bar {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.challan-bottom-bar .summary-chips,
.challan-bottom-bar #challanFocusBuiltyBtn {
  display: none;
}

.challan-bottom-bar .compact-row {
  margin-top: 0;
  margin-left: auto;
}

.challan-bottom-bar .btn {
  min-width: 110px;
}

.challan-bottom-bar .btn-primary {
  min-width: 140px;
}

.challan-records-panel .empty-state,
.challan-old-drawer .empty-state {
  min-height: 92px;
}

.challan-records-panel .loading-block,
.challan-old-drawer .loading-block {
  min-height: 92px;
}

.challan-v2 input,
.challan-v2 select,
.challan-v2 button {
  scroll-margin-top: 96px;
  scroll-margin-bottom: 120px;
}

.challan-record-table .status-chip {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
}

.challan-old-drawer .pager-row {
  margin-top: 10px;
}

.challan-records-panel .button-row {
  justify-content: flex-end;
}

.challan-record-table td[data-label="Action"] {
  white-space: normal;
}

.challan-record-table td[data-label="GR"],
.challan-record-table td[data-label="Topay"],
.challan-record-table td[data-label="Paid"] {
  font-weight: 900;
}

.challan-record-table td[data-label="Nug / Wt."],
.challan-record-table td[data-label="Katt / DD"],
.challan-record-table td[data-label="E-Way"] {
  color: #33435e;
}

.challan-record-table td[data-label="Date"] {
  color: var(--muted);
}

.collection-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.queue-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.queue-row strong,
.queue-row span,
.queue-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-row span,
.queue-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.queue-row .btn {
  grid-row: 1 / span 3;
  grid-column: 2;
}

.pager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receipt-entry-grid {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 10px;
}

.inline-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.inline-field span {
  color: #33435e;
  font-size: 12px;
  font-weight: 800;
}

.inline-field input[readonly] {
  background: #f8fbff;
  color: #1f2f48;
}

.charge-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.amount-box {
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.amount-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.amount-box strong {
  font-size: 16px;
}

.amount-box input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 8px;
  text-align: right;
  font-size: 15px;
  font-weight: 800;
  outline: none;
}

.amount-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.delivery-payment-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.delivery-wide-field {
  grid-column: 1 / -1;
}

.status-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.status-chip-warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.status-chip-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.admin-v2 {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.admin-profile-panel {
  min-width: 0;
}

.admin-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.admin-profile-form {
  min-width: 0;
}

.admin-profile-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-profile-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-profile-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-profile-field em {
  color: #ef4444;
  font-style: normal;
}

.admin-profile-field input,
.admin-profile-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

.admin-profile-field textarea {
  resize: vertical;
  min-height: 74px;
}

.admin-profile-field input:focus,
.admin-profile-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.admin-profile-wide {
  grid-column: span 3;
}

.admin-profile-side {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.admin-asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-asset-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.admin-asset-card strong {
  display: block;
  margin-bottom: 8px;
}

.admin-asset-preview {
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-asset-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.admin-asset-preview.empty span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-health-grid {
  align-items: stretch;
}

.admin-health-table {
  min-width: 860px;
}

.admin-legacy-table {
  min-width: 900px;
}

.admin-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-control-panel {
  min-width: 0;
}

.admin-v2 > .bottom-bar {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.admin-security-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-policy-card {
  min-width: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.admin-policy-card span,
.admin-policy-card em {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-policy-card span {
  text-transform: uppercase;
}

.admin-policy-card strong {
  display: block;
  min-width: 0;
  margin: 3px 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
}

.admin-policy-card em {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
}

.admin-policy-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 15px;
  font-weight: 900;
}

.admin-policy-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.admin-policy-ok .admin-policy-icon {
  background: #dcfce7;
  color: #15803d;
}

.admin-policy-warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.admin-policy-danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.admin-policy-danger .admin-policy-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-session-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
}

.admin-session-card strong {
  display: block;
  margin-top: 4px;
}

.detail-divider {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-review-drawer[hidden] {
  display: none;
}

.admin-review-drawer {
  border-color: #bcd2ff;
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.1);
}

.admin-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-review-fact {
  min-height: 58px;
}

.admin-review-select-row {
  grid-template-columns: 96px minmax(0, 1fr);
}

.admin-review-select-row select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.admin-review-select-row select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.admin-health-table strong,
.admin-audit-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-audit-row {
  grid-template-columns: 112px minmax(0, 1fr);
}

.admin-session-row {
  grid-template-columns: 96px minmax(0, 1fr) minmax(82px, 0.55fr);
}

.admin-session-row em {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-stack {
  display: grid;
  gap: 8px;
}

.detail-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.empty-state-compact {
  place-items: center;
  gap: 6px;
  text-align: center;
  padding: 18px;
}

.empty-state-compact span {
  max-width: 420px;
  font-size: 13px;
  font-weight: 700;
}

.small-empty {
  min-height: 46px;
}

.compact-row {
  margin: 0;
}

.builty-bottom-bar .compact-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.builty-bottom-bar .compact-row .btn {
  min-width: 104px;
}

.builty-bottom-bar .compact-row .btn-primary {
  min-width: 128px;
}

.partner-dashboard-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.partner-summary-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(40, 62, 94, 0.08);
}

.partner-activity-table {
  min-width: 880px;
}

.partner-activity-table strong,
.partner-history-row strong {
  display: grid;
  gap: 2px;
}

.partner-activity-table small,
.partner-history-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.partner-history-row em {
  color: var(--blue);
  font-style: normal;
  font-size: 14px;
}

.dashboard-main-grid {
  align-items: start;
}

.dashboard-row-list {
  min-width: 0;
  display: grid;
}

.dashboard-row {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  font-size: 13px;
}

.dashboard-row-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-breakdown-row,
.dashboard-breakdown-list .dashboard-row-head {
  grid-template-columns: minmax(160px, 1.4fr) 78px 130px minmax(150px, 0.9fr) 74px;
}

.dashboard-recent-row,
.dashboard-recent-list .dashboard-row-head {
  grid-template-columns: 150px minmax(180px, 1.4fr) minmax(150px, 1fr) 118px 116px;
}

.dashboard-row strong,
.dashboard-staff-row strong {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dashboard-row span {
  min-width: 0;
}

.dashboard-row .btn {
  min-width: 0;
}

.dashboard-row mark.status-chip {
  width: max-content;
  max-width: 100%;
}

.dashboard-row small,
.dashboard-staff-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-staff-chips {
  margin-bottom: 12px;
}

.dashboard-staff-row em {
  color: var(--blue);
  font-style: normal;
}

.info-icon {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--blue);
  background: var(--surface);
  font-weight: 900;
}

.metric-card {
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(40, 62, 94, 0.05);
}

.metric-card strong {
  font-size: 22px;
  line-height: 1.05;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fact-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fact-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fact-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.status-chip-good {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.status-chip-muted {
  border-color: #d7e1f0;
  background: #f8fbff;
  color: #52627a;
}

.labour-v2 {
  min-width: 0;
  padding-bottom: 96px;
}

.labour-tabs {
  margin-bottom: 14px;
}

.labour-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.52fr) minmax(480px, 1fr) minmax(300px, 0.52fr);
  gap: 16px;
  align-items: start;
}

.labour-entry-panel,
.labour-list-panel,
.labour-summary-panel {
  min-width: 0;
}

.labour-date-row,
.labour-lookup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.labour-lookup-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.labour-search-field {
  grid-template-columns: 92px minmax(0, 1fr);
}

.labour-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.labour-entry-grid .inline-field,
.labour-date-row .inline-field,
.labour-mini-grid .inline-field {
  grid-template-columns: 94px minmax(0, 1fr);
}

.labour-entry-grid > .btn {
  min-height: 42px;
}

.labour-mini-forms {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.labour-mini-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.compact-toolbar {
  min-height: auto;
  margin-bottom: 8px;
}

.compact-toolbar h3 {
  margin: 0;
  font-size: 13px;
}

.labour-mini-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.55fr) auto;
  gap: 8px;
  align-items: center;
}

.labour-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) minmax(130px, 0.5fr) minmax(130px, 0.5fr);
}

.labour-record-list {
  min-height: 470px;
  max-height: calc(100vh - 390px);
}

.labour-current-list {
  min-height: 240px;
  max-height: calc(100vh - 560px);
}

.labour-queue-row {
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto) minmax(130px, 0.6fr) auto;
}

.labour-side-lists {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.labour-chip-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.labour-chip-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.labour-chip-row span,
.labour-chip-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.labour-chip-row:hover,
.labour-chip-row:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.labour-bottom-bar .compact-row {
  margin-top: 0;
}

@media (max-width: 1500px) {
  .collection-desk-shell {
    grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.78fr);
  }

  .collections-sheet-panel {
    grid-column: 1 / -1;
  }

  .collection-desk-selector {
    grid-template-columns: 1fr;
  }

  .labour-layout {
    grid-template-columns: minmax(330px, 0.55fr) minmax(0, 1fr);
  }

  .labour-summary-panel {
    grid-column: 1 / -1;
  }
}

@media (max-height: 780px) and (min-width: 721px) {
  .collections-v2 {
    padding-bottom: 0;
  }

  .collections-v2 .collections-bottom-bar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(40, 62, 94, 0.06);
    backdrop-filter: none;
  }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 82px 1fr;
  }

  .rail-brand strong,
  .nav-link:not(.nav-child-link) span:last-child,
  .nav-group-toggle .nav-label,
  .user-card div {
    display: none;
  }

  .nav-link {
    justify-content: center;
    padding: 0;
  }

  .nav-group-toggle {
    justify-content: center;
    padding: 0;
  }

  .nav-group-toggle::after {
    display: none;
  }

  .nav-group-list {
    position: absolute;
    top: 0;
    left: 68px;
    z-index: 30;
    width: 236px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 26px rgba(40, 62, 94, 0.16);
  }

  .nav-child-link {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .bottom-bar {
    left: 82px;
  }

  .split-grid,
  .dashboard-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .partner-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-review-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-profile-grid {
    grid-template-columns: 1fr;
  }

  .admin-security-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-profile-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-profile-wide {
    grid-column: span 2;
  }

  .delivery-workbench {
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  }

  .delivery-detail-panel,
  .delivery-side-stack {
    grid-column: 1 / -1;
  }

  .delivery-desktop-parity .delivery-workbench {
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  }

  .delivery-desktop-parity .delivery-list-panel,
  .delivery-desktop-parity .delivery-form-panel,
  .delivery-desktop-parity .delivery-side-stack {
    min-height: auto;
  }

  .delivery-editor-head {
    grid-template-columns: minmax(260px, 1fr) 150px;
  }

  .delivery-editor-title {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-items: start;
    text-align: left;
  }

  .delivery-entry-split {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .labour-v2 {
    padding-bottom: 0;
  }

  .labour-layout {
    grid-template-columns: 1fr;
  }

  .labour-summary-panel {
    grid-column: auto;
  }

  .labour-date-row,
  .labour-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .labour-entry-grid .inline-field,
  .labour-date-row .inline-field,
  .labour-mini-grid .inline-field {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .labour-mini-grid {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 0.45fr) auto;
  }

  .labour-record-list,
  .labour-current-list {
    min-height: 260px;
    max-height: none;
  }

  .labour-bottom-bar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    display: grid;
    gap: 10px;
    align-items: stretch;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(40, 62, 94, 0.06);
    backdrop-filter: none;
  }

  .labour-bottom-bar .summary-chips {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .collections-workbench {
    grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
  }

  .collection-desk-shell {
    grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.7fr);
  }

  .collections-sheet-panel {
    grid-column: 1 / -1;
  }

  .collection-loaded-grid,
  .collection-queue-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-filter-grid {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
  }

  .search-query-field {
    grid-column: 1 / -1;
  }

  .search-layout {
    grid-template-columns: 1fr;
  }

  .search-row-list {
    min-height: 360px;
  }

  .reports-layout {
    grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  }

  .reports-detail-panel {
    grid-column: 1 / -1;
  }

  .reports-menu-list {
    min-height: 360px;
    max-height: calc(100vh - 360px);
  }

  .reports-filter-grid {
    grid-template-columns: 1fr;
  }

  .reports-query-field {
    grid-column: auto;
  }

  .reports-result-head {
    display: grid;
  }

  .reports-table-shell {
    min-height: 360px;
    max-height: calc(100vh - 440px);
  }

  .accounts-layout {
    grid-template-columns: 1fr;
  }

  .accounts-filter-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .accounts-query-field {
    grid-column: 1 / -1;
  }

  .account-row {
    grid-template-columns: 92px minmax(0, 1fr) 130px 90px;
  }

  .account-link {
    display: none;
  }

  .accounts-row-list {
    min-height: 360px;
    max-height: 520px;
  }

  .invoice-layout {
    grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  }

  .invoice-detail-panel {
    grid-column: 1 / -1;
  }

  .invoice-filter-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .invoice-party-field,
  .invoice-query-field {
    grid-column: 1 / -1;
  }

  .invoice-extra-grid {
    grid-template-columns: 1fr 1fr;
  }

  .invoice-extra-description {
    grid-column: 1 / -1;
  }

  .invoice-table-shell {
    min-height: 340px;
    max-height: 520px;
  }

  .builty-layout {
    grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1fr);
  }

  .builty-register-panel {
    grid-column: 1 / -1;
  }

  .builty-source-panel,
  .builty-register-panel {
    max-height: none;
  }

  .builty-source-list {
    min-height: 320px;
    max-height: 480px;
  }

  .builty-register-list {
    min-height: 300px;
    max-height: 460px;
  }

  .builty-register-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .eway-layout {
    grid-template-columns: 1fr;
  }

  .eway-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eway-side-panel {
    max-height: none;
  }

  .staff-workbench {
    grid-template-columns: 1fr;
  }

  .staff-filters {
    grid-template-columns: minmax(140px, 0.7fr) minmax(220px, 1.4fr) repeat(2, minmax(130px, 0.8fr));
  }

  .staff-filters .inline-field:last-child {
    grid-column: 1 / -1;
  }

  .challan-v2 {
    padding-bottom: 0;
  }

  .challan-header-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .challan-old-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .challan-workbench {
    grid-template-columns: 1fr;
  }

  .challan-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challan-old-list {
    min-height: 0;
    max-height: 320px;
  }

  .challan-table-host {
    max-height: 440px;
  }

  .challan-footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .staff-detail-panel {
    min-height: 220px;
  }

  .staff-filters {
    grid-template-columns: minmax(260px, 1fr) minmax(150px, 0.5fr);
  }

  .collections-queue-panel {
    grid-column: 1 / -1;
  }

  .collection-filters {
    grid-template-columns: 1fr;
  }

  .collection-row {
    grid-template-columns: 1fr;
  }

  .collections-entry-grid {
    grid-template-columns: 1fr;
  }

  .collections-entry-grid .inline-field {
    grid-template-columns: 124px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .builty-layout {
    grid-template-columns: 1fr;
  }

  .builty-source-list,
  .builty-register-list {
    max-height: 420px;
  }

  .invoice-layout {
    grid-template-columns: 1fr;
  }

  .invoice-filter-grid,
  .invoice-extra-grid {
    grid-template-columns: 1fr;
  }

  .invoice-party-field,
  .invoice-query-field,
  .invoice-extra-description {
    grid-column: auto;
  }

  .invoice-detail-panel {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .shell {
    display: block;
  }

  .side-rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    max-width: 100vw;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .rail-brand,
  .rail-footer,
  .nav-section-title {
    display: none;
  }

  .nav-section {
    margin: 0;
  }

  .nav-group-toggle {
    min-width: 68px;
    height: 54px;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .nav-group-toggle .nav-label {
    display: block;
  }

  .nav-group-list {
    position: fixed;
    right: 8px;
    bottom: 80px;
    left: 8px;
    z-index: 30;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    max-height: min(260px, calc(100vh - 160px));
    overflow: auto;
    padding: 8px;
  }

  .nav-child-link {
    min-width: 0;
    height: 42px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 10px;
    font-size: 12px;
  }

  .nav-child-link .nav-label {
    display: block;
  }

  .nav-list {
    display: flex;
    gap: 6px;
  }

  .nav-link {
    min-width: 68px;
    height: 54px;
    flex-direction: column;
    font-size: 10px;
  }

  .nav-link span:last-child {
    display: block;
  }

  .workspace {
    min-height: 100vh;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
  }

  .topbar .status-pill {
    display: none;
  }

  .module-host {
    padding: 14px 12px 260px;
  }

  .split-grid,
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .partner-summary-bar {
    display: grid;
    gap: 10px;
  }

  .module-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-row-head {
    display: none;
  }

  .dashboard-breakdown-row,
  .dashboard-recent-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 14px 0;
  }

  .dashboard-breakdown-row strong,
  .dashboard-recent-row strong {
    grid-column: 1 / -1;
  }

  .dashboard-row span[data-label] {
    display: grid;
    gap: 2px;
  }

  .dashboard-row span[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .dashboard-row mark.status-chip {
    white-space: normal;
    text-align: center;
  }

  .admin-profile-fields,
  .admin-asset-grid,
  .admin-security-policy-grid {
    grid-template-columns: 1fr;
  }

  .admin-profile-wide {
    grid-column: auto;
  }

  .tab-strip,
  .tab-button {
    width: 100%;
  }

  .inline-search {
    grid-template-columns: 1fr;
  }

  .delivery-workbench,
  .collections-workbench,
  .collection-desk-shell,
  .search-layout,
  .reports-layout,
  .accounts-layout,
  .invoice-layout,
  .builty-layout,
  .staff-workbench,
  .challan-workbench,
  .challan-header-grid,
  .challan-old-strip,
  .challan-entry-grid,
  .challan-footer-grid,
  .receipt-entry-grid,
  .collections-entry-grid,
  .collection-filters,
  .search-filter-grid,
  .reports-filter-grid,
  .accounts-filter-grid,
  .invoice-filter-grid,
  .invoice-extra-grid,
  .builty-form-grid,
  .builty-register-filters,
  .staff-filters,
  .charge-grid,
  .delivery-payment-grid {
    grid-template-columns: 1fr;
  }

  .delivery-desktop-parity {
    padding-bottom: 0;
  }

  .delivery-editor-head,
  .delivery-entry-split,
  .delivery-desktop-parity .delivery-payment-grid,
  .delivery-entry-split .charge-grid,
  .delivery-entry-split .receipt-entry-grid {
    grid-template-columns: 1fr;
  }

  .delivery-editor-title,
  .receipt-no-box {
    justify-items: start;
    text-align: left;
  }

  .delivery-entry-split .amount-box,
  .receipt-total-box {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .delivery-received-in-field {
    grid-column: auto;
  }

  .search-query-field {
    grid-column: auto;
  }

  .reports-query-field {
    grid-column: auto;
  }

  .directory-filter-grid .accounts-query-field {
    grid-column: auto;
  }

  .reports-v2 {
    padding-bottom: 230px;
  }

  .reports-mobile-back {
    display: inline-flex;
  }

  .reports-v2.is-menu-stage .reports-work-panel,
  .reports-v2.is-menu-stage .reports-detail-panel {
    display: none;
  }

  .reports-v2.is-work-stage .reports-menu-panel {
    display: none;
  }

  .reports-menu-list,
  .reports-table-shell {
    min-height: 280px;
    max-height: none;
  }

  .reports-result-head {
    display: grid;
  }

  .reports-pager {
    justify-content: stretch;
  }

  .accounts-v2 {
    padding-bottom: 320px;
  }

  .accounts-mobile-back {
    display: inline-flex;
  }

  .accounts-v2.is-list-stage .accounts-detail-panel {
    display: none;
  }

  .accounts-v2.is-detail-stage .accounts-list-panel {
    display: none;
  }

  .accounts-detail-panel {
    margin-bottom: 120px;
  }

  .accounts-result-head {
    display: grid;
  }

  .accounts-row-list {
    min-height: 360px;
    max-height: none;
  }

  .account-row {
    grid-template-columns: 76px minmax(0, 1fr) 94px;
  }

  .account-status {
    min-height: 28px;
  }

  .account-type,
  .account-link {
    display: none;
  }

  .invoice-v2 {
    padding-bottom: 320px;
  }

  .invoice-filter-grid .inline-field,
  .invoice-extra-grid .inline-field,
  .invoice-payment-form .inline-field {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .invoice-party-field,
  .invoice-query-field,
  .invoice-extra-description {
    grid-column: auto;
  }

  .invoice-result-head {
    display: grid;
  }

  .invoice-table-shell {
    min-height: 300px;
    max-height: none;
  }

  .invoice-extra-row {
    grid-template-columns: 1fr auto;
  }

  .invoice-extra-row .btn {
    grid-column: 1 / -1;
  }

  .invoice-payment-history-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .invoice-payment-history-row > div:nth-child(2) {
    grid-column: 1 / -1;
  }

  .builty-v2 {
    padding-bottom: 330px;
  }

  .eway-v2 {
    padding-bottom: 330px;
  }

  .eway-status-strip,
  .eway-card-grid,
  .eway-form-preview {
    grid-template-columns: 1fr;
  }

  .eway-tabs .tab-button {
    width: auto;
    min-width: 132px;
  }

  .eway-check-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .eway-check-row .status-chip {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .eway-table-shell {
    min-height: 260px;
    max-height: none;
  }

  .builty-source-panel,
  .builty-register-panel {
    max-height: none;
  }

  .builty-form-grid .inline-field,
  .builty-register-filters .inline-field {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .builty-wide-field,
  .builty-register-query {
    grid-column: auto;
  }

  .builty-source-list,
  .builty-register-list {
    min-height: 280px;
    max-height: none;
  }

  .builty-source-row {
    grid-template-columns: 1fr;
  }

  .delivery-row-list,
  .collection-row-list,
  .queue-row-list,
  .search-row-list {
    min-height: 280px;
    max-height: none;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row-amount {
    text-align: left;
  }

  .staff-trust-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .trust-chip {
    min-height: 38px;
    justify-content: center;
    padding: 0 8px;
    font-size: 11px;
  }

  .staff-table-wrap {
    max-height: 360px;
  }

  .staff-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  .staff-table thead {
    display: none;
  }

  .staff-table,
  .staff-table tbody,
  .staff-table tr,
  .staff-table td {
    display: block;
    width: 100%;
  }

  .staff-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
  }

  .staff-table td {
    min-width: 0;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    white-space: normal;
  }

  .staff-table td:last-child {
    border-bottom: 0;
  }

  .staff-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .staff-table td strong,
  .staff-table td small {
    max-width: none;
  }

  .staff-table .table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .staff-table .table-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .staff-tabs {
    overflow-x: auto;
  }

  .staff-tabs .tab-button {
    flex: 0 0 112px;
  }

  .staff-v2 {
    padding-bottom: 92px;
  }

  .staff-filters {
    grid-template-columns: 1fr;
  }

  .staff-filters .inline-field:last-child {
    grid-column: auto;
  }

  .staff-bottom-bar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    display: grid;
    gap: 10px;
    align-items: stretch;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
  }

  .staff-bottom-bar .summary-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-payment-drawer {
    left: 12px;
    right: 12px;
    bottom: 86px;
    width: auto;
  }

  .labour-v2 {
    padding-bottom: 0;
  }
.labour-layout {
    grid-template-columns: 1fr;
  }
.labour-entry-grid .inline-field,
.labour-date-row .inline-field,
.labour-mini-grid .inline-field {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .labour-date-row,
  .labour-lookup-row,
  .labour-entry-grid,
  .labour-mini-grid,
  .labour-filters {
    grid-template-columns: 1fr;
  }

  .labour-record-list,
  .labour-current-list {
    min-height: 220px;
    max-height: none;
  }

  .labour-summary-panel {
    grid-column: auto;
  }

  .labour-bottom-bar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    display: grid;
    gap: 10px;
    align-items: stretch;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
  }

  .labour-bottom-bar .summary-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-row {
    grid-template-columns: 1fr;
  }

  .collection-desk-tabs {
    position: sticky;
    top: 66px;
    z-index: 9;
    background: var(--bg);
    padding-top: 4px;
  }

  .collections-v2.is-desk-stage .collections-sheet-panel,
  .collections-v2.is-list-stage .collection-primary-panel,
  .collections-v2.is-list-stage .collections-queue-panel {
    display: none;
  }

  .collection-desk-selector,
  .collection-bank-panel,
  .collection-loaded-grid,
  .collection-queue-summary {
    grid-template-columns: 1fr;
  }

  .collection-current-list {
    min-height: 220px;
    max-height: none;
  }

  .inline-field {
    grid-template-columns: 98px minmax(0, 1fr);
  }
.builty-bottom-bar .button-row,
.collections-bottom-bar .button-row,
.staff-bottom-bar .button-row,
.labour-bottom-bar .button-row,
.reports-bottom-bar .button-row,
.accounts-bottom-bar .button-row,
.invoice-bottom-bar .button-row,
.challan-bottom-bar .button-row,
.eway-bottom-bar .button-row {
    justify-content: stretch;
  }
.builty-bottom-bar .btn,
.collections-bottom-bar .btn,
.staff-bottom-bar .btn,
.labour-bottom-bar .btn,
.reports-bottom-bar .btn,
.accounts-bottom-bar .btn,
.invoice-bottom-bar .btn,
.challan-bottom-bar .btn,
.eway-bottom-bar .btn,
.collection-action-row .btn {
    flex: 1;
  }

  .challan-v2 {
    padding-bottom: 0;
  }

  .challan-header-grid,
  .challan-old-strip,
  .challan-workbench,
  .challan-entry-grid,
  .challan-footer-grid {
    grid-template-columns: 1fr;
  }

  .challan-line-field {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .challan-table-host {
    max-height: 360px;
    overflow: auto;
  }

  .challan-record-table {
    min-width: 980px;
  }

  .challan-summary-strip,
  .challan-bottom-bar .summary-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challan-bottom-bar .summary-chips {
    display: none;
  }

  .challan-old-list {
    min-height: 0;
    max-height: 260px;
  }

  .collection-action-row {
    justify-content: stretch;
  }

  .collections-v2 {
    padding-bottom: 0;
  }

  .collections-v2 input,
  .collections-v2 select,
  .collections-v2 button {
    scroll-margin-top: 120px;
    scroll-margin-bottom: 220px;
  }

  .collections-v2 .collections-bottom-bar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(40, 62, 94, 0.06);
    backdrop-filter: none;
  }

  .collections-v2 .collections-bottom-bar .summary-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collections-v2 .collections-bottom-bar .chip {
    min-width: 0;
    padding: 6px 10px;
  }

  .bottom-bar {
    left: 0;
    bottom: 72px;
    display: grid;
    gap: 10px;
    padding: 10px 12px;
  }

  .field-row {
    grid-template-columns: 96px 1fr;
  }

  .table {
    min-width: 100%;
    table-layout: fixed;
  }

  .table th,
  .table td {
    word-break: break-word;
  }

  .reports-table {
    min-width: 900px;
    table-layout: auto;
  }

  .reports-table th,
  .reports-table td {
    white-space: nowrap;
    word-break: normal;
  }

  .invoice-table {
    min-width: 900px;
    table-layout: auto;
  }

  .invoice-table th,
  .invoice-table td {
    white-space: nowrap;
    word-break: normal;
  }

  .partner-activity-table {
    min-width: 760px;
    table-layout: auto;
  }

  .admin-health-table,
  .admin-legacy-table {
    min-width: 760px;
    table-layout: auto;
  }

  .admin-placeholder-grid,
  .admin-review-grid,
  .admin-review-select-row {
    grid-template-columns: 1fr;
  }
}

/* The Windows-style three-column desk is intentionally fixed on wide screens.
   On tablet and mobile, stack it before the fixed desktop grid can clip fields. */
@media (max-width: 1180px) {
  html:has(.delivery-desktop-parity) {
    overflow: auto;
  }

  body:has(.delivery-desktop-parity) {
    overflow: auto;
  }

  .module-host:has(.delivery-desktop-parity) {
    height: auto;
    min-height: calc(100vh - 56px);
    overflow: visible;
  }

  .delivery-desktop-parity {
    height: auto;
    overflow: visible;
  }

  .delivery-desktop-parity .delivery-workbench {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    overflow: visible;
  }

  .delivery-desktop-parity .delivery-list-panel {
    height: auto;
    min-height: 360px;
    max-height: 480px;
  }

  .delivery-desktop-parity .delivery-row-list {
    min-height: 0;
    max-height: none;
  }

  .delivery-desktop-parity .delivery-form-panel,
  .delivery-desktop-parity .delivery-side-stack {
    align-self: auto;
  }

  .delivery-desktop-parity .delivery-side-stack {
    grid-column: auto;
  }

  .delivery-form-footer {
    grid-template-columns: 1fr;
  }

  .delivery-form-actions {
    justify-content: stretch;
  }

  .delivery-form-actions .btn {
    flex: 1;
  }

  html:has(.challan-desktop-parity),
  body:has(.challan-desktop-parity) {
    overflow: auto;
  }

  .module-host:has(.challan-desktop-parity) {
    height: auto;
    min-height: calc(100vh - 56px);
    overflow: visible;
    padding: 14px 12px;
  }

  .challan-desktop-parity {
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto auto;
  }

  .challan-desktop-parity .challan-workbench,
  .challan-desktop-parity .challan-entry-panel,
  .challan-desktop-parity .challan-records-panel {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .delivery-forward-picker {
    --delivery-forward-label-width: 98px;
  }

  .delivery-form-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delivery-old-filter-row {
    grid-template-columns: minmax(98px, 0.85fr) 28px minmax(0, 1.15fr);
  }
}

/* Collection Desk v3 follows the WinUI desktop workbench: only the staged
   grid and pending list scroll, never the surrounding browser page. */
.collections-v3 {
  min-width: 0;
}

.collection-v3-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.52fr);
  gap: 12px;
  min-width: 0;
}

.collection-v3-workbench,
.collection-v3-pending {
  min-width: 0;
  padding: 12px;
}

.collection-v3-workbench {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.collection-v3-topline.has-partner-filter .collection-v3-lookup { grid-column: 1 / -1; }
#collectionPendingAmount { display: block; margin-top: 3px; font-size: 14px; }
#collectionPartnerField[hidden], #collectionPendingAmount[hidden] { display: none; }

.collection-v3-topline {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.collection-v3-control,
.collection-v3-search {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.collection-v3-control > span,
.collection-v3-search > span {
  color: #405577;
}

.collection-v3-control input,
.collection-v3-control select,
.collection-v3-search input {
  min-width: 0;
  height: 38px;
  border: 1px solid #cfdced;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 10px;
}

.collection-v3-control input[readonly] {
  color: #385274;
  background: #f4f8fc;
}

.collection-v3-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.45fr);
  gap: 12px;
  min-width: 0;
}

.collection-v3-entry,
.collection-v3-loaded {
  min-width: 0;
  border: 1px solid #d9e4f0;
  border-radius: 6px;
  background: #fcfdff;
  padding: 8px;
}

.collection-v3-status {
  min-height: 16px;
  margin: 0 0 6px;
  color: #526985;
  font-size: 13px;
  font-weight: 700;
}

.collection-v3-status.is-error { color: #b42318; }
.collection-v3-status.is-success { color: #087443; }

.collection-v3-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
}

.collection-v3-form .collection-v3-destination {
  grid-column: span 2;
}

.collection-v3-bank {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr);
  gap: 9px 12px;
  align-items: end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dce6f1;
}

.collection-v3-bank[hidden] { display: none; }

.collection-v3-loaded {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px 12px;
  align-self: start;
  line-height: 1.25;
}

.collection-v3-loaded h2 {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 17px;
}

.collection-v3-loaded > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.collection-v3-loaded span {
  color: #66809d;
  font-size: 11px;
  font-weight: 800;
}

.collection-v3-loaded strong {
  min-width: 0;
  color: #1e3858;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-v3-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  min-width: 0;
  border: 1px solid #d9e4f0;
  border-radius: 6px;
  background: #fcfdff;
  overflow: hidden;
}

.collection-v3-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.collection-v3-savebar > span {
  color: #5e7694;
  font-size: 12px;
  font-weight: 650;
}

.collection-v3-stage-table {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.collection-v3-grid-head,
.collection-v3-grid-row {
  display: grid;
  grid-template-columns: minmax(50px, 0.52fr) minmax(120px, 1.35fr) repeat(4, minmax(72px, 0.68fr)) 68px;
  gap: 8px;
  align-items: center;
  min-width: 700px;
  padding: 9px 12px;
}

.collection-v3-grid-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #516b89;
  background: #f5f9fd;
  border-bottom: 1px solid #dce6f1;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.collection-v3-grid-row {
  color: #213a59;
  border-bottom: 1px solid #e6edf5;
  font-size: 13px;
  font-weight: 700;
}

.collection-v3-grid-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-v3-grid-row.is-editing {
  background: #edf7ff;
  box-shadow: inset 3px 0 #2563eb;
}

.collection-v3-row-actions {
  display: flex;
  gap: 4px;
  justify-content: end;
}

.collection-v3-icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cfdced;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.collection-v3-icon-button img { display: block; }
.collection-v3-icon-button:hover { background: #eaf2ff; }
.collection-v3-icon-button[data-remove-queue]:hover { background: #fff0ee; border-color: #d89b92; }
.collection-v3-icon-button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.collection-v3-icon-button:disabled { opacity: 0.45; cursor: default; }

.collection-v3-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 9px 12px;
  background: #eef6fe;
  border-top: 1px solid #d7e4f2;
}

.collection-v3-summary > div {
  min-width: 0;
}

.collection-v3-summary span {
  display: block;
  color: #5f7895;
  font-size: 10px;
  font-weight: 800;
}

.collection-v3-summary strong {
  display: block;
  margin-top: 2px;
  color: #142a47;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-v3-savebar {
  border-top: 1px solid #dce6f1;
  background: #fff;
}

.collection-v3-pending {
  display: grid;
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
  gap: 10px;
}

.collection-v3-pending-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.collection-v3-pending-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.collection-v3-pending-head > div > span {
  display: block;
  margin-top: 3px;
  color: #5c7695;
  font-size: 12px;
  font-weight: 700;
}

.collection-v3-pending-head .tab-strip { flex-shrink: 0; }

.collection-v3-date-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.collection-v3-pending-list {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  border-top: 1px solid #e0e9f2;
  border-bottom: 1px solid #e0e9f2;
}

.collection-v3-pending-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) minmax(102px, 0.75fr) auto;
  gap: 8px;
  width: 100%;
  min-height: 76px;
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid #e4edf6;
  border-radius: 0;
  background: transparent;
  color: #1b3554;
  text-align: left;
}

.collection-v3-pending-row:hover,
.collection-v3-pending-row.is-selected {
  background: #eff6ff;
}

.collection-v3-pending-row span:not(.collection-v3-history-action) {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.collection-v3-pending-row strong {
  overflow: hidden;
  color: #142a47;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-v3-pending-row small {
  overflow: hidden;
  color: #607997;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-v3-pending-amount {
  text-align: right;
}

.collection-v3-history-action {
  align-self: center;
  color: #2c6bb2;
  font-size: 11px;
  font-weight: 800;
}

.collection-v3-pager { margin: 0; }

@media (min-width: 1350px) and (min-height: 800px) {
  html:has(.collections-v3),
  body:has(.collections-v3) {
    overflow: hidden;
  }

  .workspace:has(.collections-v3) {
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .module-host:has(.collections-v3) {
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 12px 24px;
  }

  .collections-v3,
  .collection-v3-layout {
    height: 100%;
    min-height: 0;
  }

  .collection-v3-workbench,
  .collection-v3-pending {
    min-height: 0;
    overflow: hidden;
  }
}

@media (max-width: 1240px) and (min-width: 721px) {
  .collection-v3-layout { grid-template-columns: minmax(0, 1fr); }
  .collection-v3-body { grid-template-columns: minmax(0, 1fr) minmax(210px, 0.38fr); }
  .collection-v3-pending-list { max-height: 480px; }
  .collection-v3-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1241px) and (max-width: 1599px) {
  .collection-v3-form { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .collection-v3-form .collection-v3-destination { grid-column: auto; }
  .collection-v3-control input, .collection-v3-control select { height: 34px; padding: 5px 7px; }
  .collection-v3-entry { padding: 8px; }
  .collection-v3-savebar { padding: 8px; }
}

@media (max-width: 920px) and (min-width: 721px) {
  .collection-v3-layout { grid-template-columns: minmax(0, 1fr); }
  .collection-v3-body { grid-template-columns: minmax(0, 1fr); }
  .collection-v3-loaded { display: none; }
  .collection-v3-topline { grid-template-columns: 1fr 1.3fr; }
}

@media (max-width: 720px) {
  .collection-v3-savebar,
  .collection-v3-pending-head { flex-wrap: wrap; }
  .collection-v3-layout,
  .collection-v3-body { grid-template-columns: 1fr; }
  .collection-v3-topline,
  .collection-v3-form,
  .collection-v3-bank,
  .collection-v3-date-filters { grid-template-columns: 1fr; }
  .collection-v3-form .collection-v3-destination { grid-column: auto; }
  .collection-v3-workbench,
  .collection-v3-pending { overflow: visible; }
  .collection-v3-pending-list { max-height: 500px; }
  .collection-v3-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-v3-pending-head { align-items: start; }
  .collection-v3-pending-head h2 { font-size: 18px; }
}

@media (min-width: 1600px) {
  .collection-v3-topline { grid-template-columns: 210px minmax(0, 1fr); }
  .collection-v3-body { grid-template-columns: minmax(0, 1fr) 270px; }
  .collection-v3-entry { align-self: start; padding: 0; border: 0; background: transparent; }
  .collection-v3-form { grid-template-columns: 70px 62px minmax(100px, 1fr) 72px 53px 53px 72px; gap: 6px; align-items: end; }
  .collection-v3-form .collection-v3-destination { grid-column: auto; }
  .collection-v3-form input, .collection-v3-form select { padding: 5px; }
  .collection-v3-control { font-size: 11px; font-weight: 600; }
}
/* Local Delivery: saved receipt tools and audited collection history. */
.delivery-old-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.delivery-old-actions .delivery-icon-action { min-width: 0; width: 100%; height: 34px; min-height: 34px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.delivery-icon-action img { display: block; width: 19px; height: 19px; }
.delivery-icon-action:disabled img { opacity: .4; }
.delivery-form-actions[hidden] { display: none; }
.delivery-history-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 18px; border: 1px solid #cbd5e1; border-radius: 8px; color: #172033; background: white; overflow: auto; box-shadow: 0 16px 48px #0003; }
.delivery-history-dialog::backdrop { background: #15202e66; }
.delivery-history-dialog header, .delivery-history-dialog footer { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.delivery-history-dialog h2 { margin: 0; font-size: 19px; line-height: 1.35; }
.delivery-history-dialog header .delivery-icon-action { min-width: 32px; width: 32px; height: 32px; padding: 6px; }
.delivery-history-dialog p { margin: 10px 0; font-size: 13px; overflow-wrap: anywhere; }
.delivery-history-dialog .message:empty { display: none; }
.delivery-history-dialog > footer, .delivery-history-form > footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid #d8e0eb; flex-wrap: wrap; }
.delivery-history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 10px 0; border-block: 1px solid #d8e0eb; }
.delivery-history-summary span, .delivery-history-summary strong { display: block; font-size: 13px; }
.delivery-history-summary span { color: #54657b; margin-bottom: 4px; }
.delivery-history-entry { padding: 12px 0; border-bottom: 1px solid #d8e0eb; }
.delivery-history-entry-head { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.delivery-history-reference { color: #54657b; line-height: 1.55; }
.delivery-history-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin: 12px 0; }
.delivery-history-values dt { font-size: 12px; color: #54657b; }
.delivery-history-values dd { margin: 3px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.delivery-history-entry footer > span { color: #54657b; font-size: 12px; overflow-wrap: anywhere; }
.delivery-history-entry.is-reversed { border-left: 3px solid #aa6573; padding-left: 10px; }
.delivery-history-fields, .history-bank-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.delivery-history-fields label { display: flex; min-width: 0; flex-direction: column; gap: 6px; font-size: 13px; color: #294b70; }
.delivery-history-fields input, .delivery-history-fields select { box-sizing: border-box; width: 100%; min-width: 0; height: 36px; padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 4px; background: white; color: #172033; font-size: 14px; }
.delivery-history-fields .history-wide { grid-column: 1 / -1; }
.history-bank-fields[hidden] { display: none; }
@media (max-width: 600px) {
  .delivery-history-dialog { padding: 12px; }
  .delivery-history-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-history-entry footer { align-items: flex-start; flex-direction: column; }
  .delivery-history-summary strong { font-size: 12px; }
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.36);
}

.app-modal-backdrop[hidden] {
  display: none;
}

.app-modal {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  padding: 18px;
}

.app-modal h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.app-modal .message {
  margin: 0;
  color: var(--muted);
}

.app-modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}



.staff-selection-toolbar {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: -4px 0 8px;
}

.staff-selection-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.staff-selection-toolbar input {
  width: 18px;
  height: 18px;
}

.staff-batch-references {
  display: grid;
  gap: 3px;
  padding: 4px 0;
}

.staff-batch-references span {
  color: var(--text);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
