:root {
  color-scheme: light;
  --page: #f5f7f4;
  --sidebar: #1f2f27;
  --sidebar-soft: #2c4438;
  --accent: #2f8f5b;
  --accent-dark: #1f7245;
  --accent-soft: #e8f5ee;
  --ink: #202820;
  --muted: #667268;
  --line: #dfe6dd;
  --panel: #ffffff;
  --warning: #9d6612;
  --warning-bg: #fff5df;
  --danger: #a83b32;
  --danger-bg: #fff0ee;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  background: var(--page);
  color: var(--ink);
}

body:has(.inline-business-form) {
  height: 100vh;
  overflow: hidden;
}

body:has(.master-page-workbench),
body:has(.master-data-grid) {
  height: 100vh;
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-shell:has(.inline-business-form) {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.app-shell:has(.master-page-workbench),
.app-shell:has(.master-data-grid) {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--sidebar);
  color: #f4faf5;
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #f3c95f;
  color: #243327;
  font-size: 22px;
  font-weight: 800;
}

.brand h1,
.brand p,
.workspace h2,
.workspace h3,
.workspace p {
  margin: 0;
}

.brand h1 {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.brand p {
  margin-top: 8px;
  color: #b9cabe;
  font-size: 12px;
  line-height: 1.35;
}

.nav {
  display: grid;
  gap: 10px;
  padding-top: 22px;
}

.primary-nav-item {
  display: block;
  padding: 16px 14px;
  border-radius: 8px;
  color: #eef7ef;
  text-decoration: none;
  border: 1px solid transparent;
}

.primary-nav-item:hover,
.primary-nav-item.active {
  background: var(--sidebar-soft);
}

.primary-nav-item.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 #f3c95f;
}

.primary-nav-item span,
.primary-nav-item small {
  display: block;
}

.primary-nav-item span {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.primary-nav-item small {
  margin-top: 7px;
  color: #b9cabe;
  font-size: 13px;
  line-height: 1.35;
}

.workspace {
  flex: 1;
  padding: 24px 28px 32px;
  overflow: auto;
}

.workspace:has(.master-page-workbench),
.workspace:has(.master-data-grid) {
  height: 100vh;
  overflow: hidden;
}

.workbench-tabs {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -6px 0 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 6px 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--page);
  border-bottom: 1px solid #cfdcd3;
  scrollbar-width: thin;
}

.workbench-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 148px;
  width: 148px;
  min-width: 148px;
  max-width: 148px;
  min-height: 36px;
  margin-bottom: -1px;
  padding: 0 7px 0 12px;
  border: 1px solid #cfdcd3;
  border-bottom-color: #cfdcd3;
  border-radius: 8px 8px 0 0;
  background: #edf3ef;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.7);
}

.workbench-tab + .workbench-tab {
  margin-left: -1px;
}

.workbench-tab.active {
  border-color: var(--accent);
  border-bottom-color: #ffffff;
  background: #ffffff;
  color: var(--accent-dark);
  position: relative;
  z-index: 1;
  box-shadow: inset 0 3px 0 var(--accent);
}

.workbench-tab span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-tab b {
  flex: 0 0 auto;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: inherit;
  font-size: 16px;
  line-height: 1;
}

.workbench-tab b:hover {
  background: rgba(32, 40, 32, 0.12);
}

.workbench-tab::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
}

.workbench-tab.dirty::after {
  background: #d99b1d;
}

.workbench-stage {
  min-height: 0;
}

.workbench-stage:has(.master-page-workbench),
.workbench-stage:has(.master-data-grid) {
  height: calc(100vh - 82px);
  overflow: hidden;
}

.workspace-tab-panel {
  display: none;
}

.workspace-tab-panel.is-active {
  display: block;
}

.workspace-tab-panel.is-active:has(.master-page-workbench),
.workspace-tab-panel.is-active:has(.master-data-grid) {
  height: calc(100vh - 92px);
  overflow: hidden;
}

.topbar,
.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.sell-page .workspace {
  padding-top: 18px;
  padding-bottom: 20px;
}

.sell-page .workspace:has(.inline-business-form) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.sell-page .topbar {
  margin-bottom: 12px;
}

.sell-page .topbar h2 {
  font-size: 22px;
}

.sell-page .section-heading {
  margin-bottom: 10px;
}

.sell-page .section-heading p {
  display: none;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 26px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.role-switcher select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
  color: var(--ink);
  font: inherit;
}

.plain-button,
.primary-button,
.text-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.plain-button {
  padding: 11px 16px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
}

.primary-button {
  padding: 12px 18px;
  background: var(--accent);
  color: #ffffff;
}

.text-button {
  background: transparent;
  color: var(--accent-dark);
}

.home-nav {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(31, 47, 39, 0.04);
}

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

.home-stat {
  min-height: 68px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7faf6;
  border: 1px solid var(--line);
}

.home-stat span,
.home-stat strong {
  display: block;
}

.home-stat span {
  color: var(--muted);
  font-size: 13px;
}

.home-stat strong {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.1;
}

.home-stat.alert {
  background: var(--danger-bg);
  border-color: #f1bbb6;
}

.home-stat.alert strong {
  color: var(--danger);
}

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

.home-shortcuts button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.home-shortcuts button:hover {
  border-color: var(--accent);
  background: #dff1e7;
}

.owner-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(31, 47, 39, 0.04);
}

.summary-card p {
  color: var(--muted);
  font-size: 14px;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1.1;
}

.summary-trace-link {
  color: inherit;
  text-decoration: none;
}

.summary-trace-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.summary-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.summary-card.warning {
  background: var(--warning-bg);
  border-color: #f0d59d;
}

.summary-card.warning strong {
  color: var(--warning);
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

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

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

.money {
  font-weight: 800;
}

.danger-text {
  color: var(--danger);
  font-weight: 800;
}

.warning-text {
  color: var(--warning);
  font-weight: 800;
}

.good-text {
  color: var(--accent-dark);
  font-weight: 800;
}

.period-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.period-tabs button {
  min-width: 40px;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.period-tabs button.active {
  background: var(--accent);
  color: #ffffff;
}

.quick-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quick-strip button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.module-section,
.partner-section,
.quick-section,
.data-section,
.work-panel {
  margin-bottom: 24px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h3,
.panel-heading h3 {
  font-size: 19px;
}

.section-heading p {
  color: var(--muted);
  font-size: 14px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.module-action {
  min-height: 158px;
  padding: 26px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 4px 14px rgba(31, 47, 39, 0.06);
}

.module-action span,
.module-action small {
  display: block;
}

.module-action small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}

.module-action:hover,
.module-action.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(31, 47, 39, 0.1);
}

.module-action.disabled-action,
.document-entry-button.disabled-action {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.module-action:hover small,
.module-action.active small {
  color: var(--accent-dark);
}

.sub-module {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sub-module h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.first-sub-module {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.partner-section + .partner-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.partner-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.add-action {
  border-style: dashed;
  background: #fbfdfb;
  color: var(--accent-dark);
}

.sell-grid {
  grid-auto-flow: row;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(82px, auto));
  row-gap: 8px;
}

.sell-grid .module-action {
  min-height: 82px;
  padding: 12px;
  font-size: 20px;
}

.sell-grid .module-action small {
  margin-top: 5px;
  font-size: 12px;
}

.sell-grid > .module-action:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.sell-grid > .module-action:nth-child(3) {
  grid-column: 1;
  grid-row: 4;
  margin-top: 0;
  min-height: 74px;
  padding: 10px 12px;
  font-size: 18px;
}

.sell-grid > .module-action:nth-child(4) {
  grid-column: 2;
  grid-row: 1;
}

.sell-grid > .module-action:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
}

.sell-grid > .module-action:nth-child(6) {
  grid-column: 2;
  grid-row: 4;
  margin-top: 0;
  min-height: 74px;
  padding: 10px 12px;
  font-size: 18px;
}

.sell-grid > .module-action:nth-child(7) {
  grid-column: 3;
  grid-row: 1;
}

.sell-grid > .module-action:nth-child(8) {
  grid-column: 3;
  grid-row: 2;
}

.sell-grid > .module-action:nth-child(9) {
  grid-column: 3;
  grid-row: 3;
  margin-top: 0;
}

.sell-grid .guarantee-split {
  grid-column: 3;
  grid-row: 4;
  margin-top: 0;
}

.module-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 74px;
}

.sell-grid .guarantee-split .module-action {
  grid-column: auto;
  grid-row: auto;
  min-height: 74px;
  padding: 10px 12px;
  font-size: 18px;
}

.sell-grid .guarantee-split .module-action span {
  font-size: 17px;
  line-height: 1.15;
}

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

.sell-data-grid .module-action {
  min-height: 58px;
  padding: 10px;
  font-size: 18px;
}

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

.sell-settle-grid .module-action {
  min-height: 58px;
  padding: 10px;
  font-size: 18px;
}

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

.peer-transfer-grid .module-action {
  min-height: 58px;
  padding: 10px;
  font-size: 18px;
}

.inline-business-topbar {
  align-items: center;
}

.inline-business-topbar h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 1000;
}

.sell-page .inline-business-topbar h2 {
  font-size: 34px;
}

.sell-page:has(.inline-return-form) .inline-business-topbar h2 {
  color: #a84f12;
}

.sell-page:has(.inline-retail-form) .inline-business-topbar h2 {
  color: #1768a8;
}

.sell-page:has(.inline-retail-return-form) .inline-business-topbar h2 {
  color: #9a315d;
}

.inline-business-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: stretch;
  height: calc(100dvh - 174px);
  min-height: 0;
  overflow: hidden;
}

.workspace-tab-panel .inline-business-topbar {
  min-height: 0;
  padding-block: 4px;
}

.workspace-tab-panel .inline-business-topbar h2,
.workspace-tab-panel.sell-page .inline-business-topbar h2 {
  font-size: 28px;
}

.workspace-tab-panel .inline-business-form {
  height: calc(100dvh - 204px);
  gap: 10px;
}

.inline-customer-money-form {
  height: calc(100dvh - 174px);
}

.workspace-tab-panel .inline-customer-money-form {
  height: calc(100dvh - 204px);
}

.inline-sale-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.inline-sale-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  position: relative;
  top: auto;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.workspace-tab-panel .inline-sale-side {
  height: 100%;
  max-height: 100%;
}

.inline-customer-money-form .inline-sale-side {
  height: 100%;
  max-height: 100%;
}

.workspace-tab-panel .inline-customer-money-form .inline-sale-side {
  height: 100%;
  max-height: 100%;
}

.inline-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe8dd;
  border-radius: 8px;
  background: #fbfdf9;
}

.customer-panel {
  border-color: #bddfcb;
  background: #f1faf5;
}

.inline-return-form .customer-panel {
  border-color: #f1c08f;
  background: #fff7ee;
}

.goods-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border-color: #bddfcb;
  background: #f7fcf8;
}

.inline-return-form .goods-panel {
  border-color: #f1c08f;
  background: #fffaf4;
}

.inline-retail-form .customer-panel {
  border-color: #a9cdec;
  background: #f3f9ff;
}

.inline-retail-return-form .customer-panel {
  border-color: #e7a9c1;
  background: #fff4f8;
}

.inline-retail-form .goods-panel {
  border-color: #a9cdec;
  background: #f8fbff;
}

.inline-retail-return-form .goods-panel {
  border-color: #e7a9c1;
  background: #fff8fa;
}

.inline-field-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(150px, 1.1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr);
  gap: 10px;
}

.inline-customer-money-form .customer-panel .inline-field-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-business-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.inline-business-form input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.inline-customer-money-form .inline-sale-main {
  grid-template-rows: auto minmax(0, 1fr);
}

.customer-money-focus-panel {
  min-height: 0;
  align-content: start;
  border-color: #bddfcb;
  background: #f7fcf8;
  overflow: hidden;
}

.customer-money-focus-panel label {
  max-width: 360px;
}

.customer-money-focus-panel input {
  height: 46px;
  font-size: 21px;
  font-weight: 1000;
}

.workspace-tab-panel .inline-panel {
  gap: 10px;
  padding: 12px;
}

.workspace-tab-panel .customer-money-focus-panel input {
  height: 42px;
  font-size: 20px;
}

.customer-money-preview {
  display: grid;
  gap: 6px;
  max-width: 360px;
  padding: 16px;
  border: 1px solid #bddfcb;
  border-radius: 8px;
  background: #eef8f2;
}

.customer-money-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.customer-money-preview strong {
  color: var(--accent-dark);
  font-size: 34px;
  line-height: 1;
}

.inline-customer-refund-form .customer-panel,
.inline-customer-refund-form .customer-money-focus-panel,
.inline-customer-refund-form .payment-panel,
.inline-customer-refund-form .total-panel {
  border-color: #f1c08f;
  background: #fff7ee;
}

.inline-customer-refund-form .business-section-title > span,
.inline-customer-refund-form .inline-save-button {
  background: #d56b1f;
  border-color: #d56b1f;
}

.inline-customer-refund-form .total-panel strong,
.inline-customer-refund-form .customer-money-preview strong {
  color: #a84f12;
}

.inline-customer-deposit-form .customer-panel,
.inline-customer-deposit-form .customer-money-focus-panel,
.inline-customer-deposit-form .payment-panel,
.inline-customer-deposit-form .total-panel {
  border-color: #c4b3e8;
  background: #f8f5ff;
}

.inline-customer-deposit-form .business-section-title > span,
.inline-customer-deposit-form .inline-save-button {
  background: #6f4bb6;
  border-color: #6f4bb6;
}

.inline-customer-deposit-form .total-panel strong,
.inline-customer-deposit-form .customer-money-preview strong {
  color: #5d3e9d;
}

.inline-supplier-prepay-form .customer-panel,
.inline-supplier-prepay-form .customer-money-focus-panel,
.inline-supplier-prepay-form .payment-panel,
.inline-supplier-prepay-form .total-panel,
.inline-supplier-payment-form .customer-panel,
.inline-supplier-payment-form .customer-money-focus-panel,
.inline-supplier-payment-form .payment-panel,
.inline-supplier-payment-form .total-panel {
  border-color: #efc08f;
  background: #fff8ef;
}

.inline-supplier-prepay-form .business-section-title > span,
.inline-supplier-prepay-form .inline-save-button,
.inline-supplier-payment-form .business-section-title > span,
.inline-supplier-payment-form .inline-save-button {
  background: #b86118;
  border-color: #b86118;
}

.inline-supplier-prepay-form .total-panel strong,
.inline-supplier-payment-form .total-panel strong {
  color: #9b4b10;
}

.inline-supplier-refund-form .customer-panel,
.inline-supplier-refund-form .customer-money-focus-panel,
.inline-supplier-refund-form .payment-panel,
.inline-supplier-refund-form .total-panel {
  border-color: #93cfc5;
  background: #f0fbf8;
}

.inline-supplier-refund-form .business-section-title > span,
.inline-supplier-refund-form .inline-save-button {
  background: #168371;
  border-color: #168371;
}

.inline-supplier-refund-form .total-panel strong {
  color: #0f6f60;
}

.inline-supplier-deposit-form .customer-panel,
.inline-supplier-deposit-form .customer-money-focus-panel,
.inline-supplier-deposit-form .payment-panel,
.inline-supplier-deposit-form .total-panel {
  border-color: #c8b5ea;
  background: #f8f4ff;
}

.inline-supplier-deposit-form .business-section-title > span,
.inline-supplier-deposit-form .inline-save-button {
  background: #6b4bb3;
  border-color: #6b4bb3;
}

.inline-supplier-deposit-form .total-panel strong {
  color: #5d3e9d;
}

.inline-purchase-form .customer-panel,
.inline-purchase-form .goods-panel,
.inline-purchase-form .payment-panel,
.inline-purchase-form .total-panel {
  border-color: #9fc5e8;
  background: #f3f9ff;
}

.inline-purchase-form .business-section-title > span,
.inline-purchase-form .inline-save-button {
  background: #2b72b8;
  border-color: #2b72b8;
}

.inline-purchase-form .inline-sale-head,
.inline-purchase-form .inline-goods-total {
  border-color: #9fc5e8;
  background: #edf6ff;
  color: #185d9f;
}

.inline-purchase-form .inline-sale-row {
  border-color: #c5ddf2;
}

.inline-purchase-form .inline-sale-row:nth-child(even) {
  background: #f8fbff;
}

.inline-purchase-form .inline-sale-row output {
  border-color: #9fc5e8;
  background: #f3f9ff;
  color: #185d9f;
}

.inline-purchase-form .inline-add-row,
.inline-purchase-form .inline-multi-account-button {
  border-color: #2b72b8;
  background: #edf6ff;
  color: #185d9f;
}

.inline-purchase-form .total-panel strong,
.inline-purchase-form .inline-goods-total strong {
  color: #185d9f;
}

.inline-purchase-form .payment-choice.active {
  border-color: #2b72b8;
  background: #e5f2ff;
  color: #185d9f;
}

.inline-stock-move-form .customer-panel,
.inline-stock-move-form .goods-panel,
.inline-stock-move-form .payment-panel,
.inline-stock-move-form .total-panel {
  border-color: #9ccfc8;
  background: #f1fbf8;
}

.inline-stock-move-form .business-section-title > span,
.inline-stock-move-form .inline-save-button {
  background: #258071;
  border-color: #258071;
}

.inline-stock-move-form .inline-sale-head,
.inline-stock-move-form .inline-goods-total {
  border-color: #9ccfc8;
  background: #eaf8f4;
  color: #126557;
}

.inline-stock-move-form .inline-sale-row {
  border-color: #bfded9;
}

.inline-stock-move-form .inline-sale-row:nth-child(even) {
  background: #f7fcfb;
}

.inline-stock-move-form .inline-sale-row output {
  border-color: #9ccfc8;
  background: #f1fbf8;
  color: #126557;
}

.inline-stock-move-form .inline-add-row,
.inline-stock-move-form .inline-multi-account-button {
  border-color: #258071;
  background: #eaf8f4;
  color: #126557;
}

.inline-stock-move-form .total-panel strong,
.inline-stock-move-form .inline-goods-total strong {
  color: #126557;
}

.inline-stock-unload-form .customer-panel,
.inline-stock-unload-form .goods-panel,
.inline-stock-unload-form .payment-panel,
.inline-stock-unload-form .total-panel {
  border-color: #c1bbdf;
  background: #f7f5ff;
}

.inline-stock-unload-form .business-section-title > span,
.inline-stock-unload-form .inline-save-button {
  background: #6b5aa8;
  border-color: #6b5aa8;
}

.inline-stock-unload-form .inline-sale-head,
.inline-stock-unload-form .inline-goods-total {
  border-color: #c1bbdf;
  background: #f0edfb;
  color: #51438c;
}

.inline-stock-unload-form .inline-sale-row {
  border-color: #d7d2ec;
}

.inline-stock-unload-form .inline-sale-row:nth-child(even) {
  background: #fbfaff;
}

.inline-stock-unload-form .inline-sale-row output {
  border-color: #c1bbdf;
  background: #f7f5ff;
  color: #51438c;
}

.inline-stock-unload-form .inline-add-row {
  border-color: #6b5aa8;
  background: #f0edfb;
  color: #51438c;
}

.inline-stock-unload-form .total-panel strong,
.inline-stock-unload-form .inline-goods-total strong {
  color: #51438c;
}

.inline-warehouse-move-form .customer-panel,
.inline-warehouse-move-form .goods-panel,
.inline-warehouse-move-form .payment-panel,
.inline-warehouse-move-form .total-panel {
  border-color: #d5c18b;
  background: #fffaf0;
}

.inline-warehouse-move-form .business-section-title > span,
.inline-warehouse-move-form .inline-save-button {
  background: #98712a;
  border-color: #98712a;
}

.inline-warehouse-move-form .inline-sale-head,
.inline-warehouse-move-form .inline-goods-total {
  border-color: #d5c18b;
  background: #fff4d8;
  color: #765418;
}

.inline-warehouse-move-form .inline-sale-row {
  border-color: #e3d3a8;
}

.inline-warehouse-move-form .inline-sale-row:nth-child(even) {
  background: #fffdf7;
}

.inline-warehouse-move-form .inline-sale-row output {
  border-color: #d5c18b;
  background: #fffaf0;
  color: #765418;
}

.inline-warehouse-move-form .inline-add-row {
  border-color: #98712a;
  background: #fff4d8;
  color: #765418;
}

.inline-warehouse-move-form .total-panel strong,
.inline-warehouse-move-form .inline-goods-total strong {
  color: #765418;
}

.inventory-search-card .customer-sales-summary strong {
  color: #126557;
}

.inventory-status {
  display: inline-grid;
  min-width: 46px;
  height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.inventory-status.is-normal {
  background: #e9f8ef;
  color: #14733e;
}

.inventory-status.is-low {
  background: #fff4d8;
  color: #8a5a00;
}

.inventory-status.is-empty {
  background: #ffe8e4;
  color: #a33322;
}

.inline-purchase-return-form .customer-panel,
.inline-purchase-return-form .goods-panel,
.inline-purchase-return-form .payment-panel,
.inline-purchase-return-form .total-panel {
  border-color: #e2aa96;
  background: #fff6f2;
}

.inline-purchase-return-form .business-section-title > span,
.inline-purchase-return-form .inline-save-button {
  background: #a94d2a;
  border-color: #a94d2a;
}

.inline-purchase-return-form .inline-sale-head,
.inline-purchase-return-form .inline-goods-total {
  border-color: #e2aa96;
  background: #fff0e8;
  color: #8f3e1f;
}

.inline-purchase-return-form .inline-sale-row {
  border-color: #efcabc;
}

.inline-purchase-return-form .inline-sale-row:nth-child(even) {
  background: #fffaf7;
}

.inline-purchase-return-form .inline-sale-row output {
  border-color: #e2aa96;
  background: #fff6f2;
  color: #8f3e1f;
}

.inline-purchase-return-form .inline-add-row,
.inline-purchase-return-form .inline-multi-account-button {
  border-color: #a94d2a;
  background: #fff0e8;
  color: #8f3e1f;
}

.inline-purchase-return-form .total-panel strong,
.inline-purchase-return-form .inline-goods-total strong {
  color: #8f3e1f;
}

.inline-purchase-return-form .payment-choice.active {
  border-color: #a94d2a;
  background: #ffe9dd;
  color: #8f3e1f;
}

.single-account-row {
  grid-template-columns: minmax(0, 1fr);
}

.prepay-money-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 0.9fr) minmax(140px, 0.9fr) minmax(180px, 1.15fr) 112px;
  gap: 10px;
  align-items: end;
}

.inline-customer-refund-form .prepay-money-grid {
  grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) minmax(220px, 1.35fr);
}

.supplier-prepay-money-grid {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(220px, 1.3fr);
}

.supplier-payment-money-grid {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(220px, 1.3fr);
}

.supplier-prepay-money-grid [data-supplier-prepay-amount] {
  font-size: 22px;
  font-weight: 1000;
}

.supplier-payment-money-grid [data-supplier-payment-amount] {
  font-size: 22px;
  font-weight: 1000;
}

.prepay-money-grid label,
.prepay-money-grid .prepay-remark-field {
  max-width: none;
}

.prepay-money-grid input {
  height: 56px;
  font-size: 16px;
  font-weight: 900;
}

.prepay-money-grid [data-customer-money-amount] {
  font-size: 22px;
  font-weight: 1000;
}

.prepay-multi-button,
.inline-lock-product-button {
  height: 56px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.prepay-multi-button {
  min-width: 140px;
  width: 100%;
  align-self: end;
}

.prepay-multi-summary {
  align-self: end;
  height: 56px;
  font-size: 14px;
}

.inline-lock-product-button {
  width: 100%;
  align-self: end;
  border: 1px solid #8fcf9f;
  background: #ffffff;
  color: var(--accent-dark);
}

.inline-lock-product-button.active {
  background: #e7f6eb;
  border-color: var(--accent);
}

.prepay-policy-panel {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 34px;
  padding: 13px;
  border: 1px solid #ead7a5;
  border-top: 5px solid #d8a63b;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 8px 18px rgba(144, 98, 16, 0.08);
  font-size: 13px;
}

.prepay-policy-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.prepay-policy-title strong {
  color: #7a4d05;
  font-size: 16px;
}

.prepay-policy-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prepay-policy-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.prepay-policy-options button {
  height: 40px;
  border: 1px solid #e2c879;
  border-radius: 8px;
  background: #fffdf7;
  color: #7a4d05;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 1000;
}

.prepay-policy-options button.active {
  border-color: #c78c18;
  background: #f7e7bd;
  box-shadow: inset 0 0 0 2px #c78c18;
}

.prepay-policy-options button.is-saved {
  border-color: #2f8f5b;
  background: #eef8f2;
  color: var(--accent-dark);
}

.prepay-policy-detail {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #ead7a5;
}

.prepay-policy-detail[hidden] {
  display: none;
}

.prepay-interest-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 0.8fr) minmax(140px, 1fr) 84px;
  gap: 8px;
  align-items: end;
}

.prepay-interest-grid select,
.prepay-interest-grid input,
.policy-gift-money-field input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.policy-long-button {
  height: 38px;
  border: 1px solid #e2c879;
  border-radius: 8px;
  background: #fffdf7;
  color: #7a4d05;
  cursor: pointer;
  font-size: 13px;
  font-weight: 1000;
}

.policy-long-button.active {
  border-color: #c78c18;
  background: #f7e7bd;
  box-shadow: inset 0 0 0 2px #c78c18;
}

.policy-gift-table {
  display: grid;
  gap: 5px;
  max-height: 170px;
  overflow-y: auto;
  padding-right: 4px;
}

.policy-gift-head,
.policy-gift-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 54px 66px 76px 88px 40px;
  gap: 6px;
  align-items: center;
}

.policy-gift-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 2px 0;
  background: #fffaf0;
  color: #7a4d05;
  font-size: 11px;
  font-weight: 900;
}

.policy-gift-row {
  padding: 5px;
  border: 1px solid #ead7a5;
  border-radius: 8px;
  background: #fffdf7;
}

.policy-gift-row input {
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.policy-gift-row output {
  display: grid;
  align-items: center;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e2c879;
  border-radius: 8px;
  background: #ffffff;
  color: #7a4d05;
  font-size: 12px;
  font-weight: 900;
}

.policy-add-row {
  justify-self: start;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.policy-save-button {
  justify-self: end;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #c78c18;
  border-radius: 8px;
  background: #f7e7bd;
  color: #7a4d05;
  cursor: pointer;
  font-size: 13px;
  font-weight: 1000;
}

.policy-gift-money-field {
  max-width: 260px;
}

.receipt-settlement-panel {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  min-height: 0;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid #b9d3ef;
  border-top: 5px solid #2d86c9;
  border-radius: 8px;
  background: #f3f9ff;
  box-shadow: 0 8px 18px rgba(45, 134, 201, 0.08);
}

.receipt-settlement-panel .prepay-policy-title strong {
  color: #1768a8;
}

.receipt-settlement-actions {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.receipt-selected-list {
  display: block;
  max-height: clamp(120px, calc(100vh - 570px), 220px);
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.workspace-tab-panel .receipt-settlement-panel {
  margin-top: 16px;
}

.workspace-tab-panel .receipt-selected-list {
  max-height: clamp(110px, calc(100vh - 620px), 190px);
}

.receipt-settlement-table {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfe3f5;
  border-radius: 8px;
  background: #ffffff;
}

.receipt-settlement-head,
.receipt-settlement-row,
.receipt-settlement-foot {
  display: grid;
  grid-template-columns: 104px minmax(130px, 1fr) 76px 76px 76px 88px 122px;
  gap: 6px;
  align-items: center;
}

.receipt-settlement-head {
  padding: 9px 10px;
  background: #eaf5ff;
  color: #1768a8;
  font-size: 13px;
  font-weight: 900;
}

.receipt-settlement-row {
  padding: 9px 10px;
  border-top: 1px solid #e4eff8;
  color: #27322d;
  font-weight: 800;
}

.receipt-settlement-row > * {
  min-width: 0;
}

.receipt-settlement-row span {
  overflow-wrap: anywhere;
}

.receipt-settlement-row strong,
.receipt-settlement-row b,
.receipt-settlement-foot strong {
  color: #1768a8;
}

.receipt-settlement-row input {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
}

.receipt-settlement-row button {
  width: 100%;
  min-height: 34px;
  padding: 0 4px;
  border: 1px solid #2d86c9;
  border-radius: 8px;
  background: #ffffff;
  color: #1768a8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  white-space: normal;
}

.receipt-row-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.receipt-row-actions button {
  flex: 1 1 0;
  min-width: 0;
}

.receipt-row-actions button[data-main-remove-settlement] {
  border-color: #e3b4ad;
  background: #fff4f1;
  color: #ad3a24;
}

.receipt-settlement-foot {
  padding: 9px 10px;
  border-top: 1px solid #cfe3f5;
  background: #f1f8ff;
  font-weight: 900;
}

.inline-business-form .settlement-discount-confirm,
.settlement-discount-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid #e0a23b;
  border-radius: 8px;
  background: #fff7e8;
  color: #8a4b00;
  font-weight: 900;
  white-space: nowrap;
}

.inline-business-form .settlement-discount-confirm input,
.settlement-discount-confirm input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
}

.settlement-explain {
  flex: 0 1 auto;
  max-height: 112px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  scrollbar-width: thin;
}

.payment-panel:has(.settlement-right-panel) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.settlement-right-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.settlement-current-doc {
  flex: 1 1 auto;
  min-height: 118px;
  max-height: min(245px, 34vh);
  padding: 10px 12px;
  border: 1px solid #b9d3ef;
  border-radius: 8px;
  background: #f3f9ff;
  color: #27322d;
  overflow-y: auto;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.48;
  white-space: pre-line;
  scrollbar-width: thin;
}

.settlement-discount-confirm-side {
  width: 100%;
  flex: 0 0 auto;
  justify-content: flex-start;
  margin-top: auto;
  padding: 10px 12px;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(224, 162, 59, 0.18);
}

.unpaid-doc-card {
  width: min(980px, calc(100vw - 44px));
  max-width: none;
}

.unpaid-doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: stretch;
}

.unpaid-doc-table {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfe3f5;
  border-radius: 8px;
  background: #ffffff;
}

.unpaid-doc-head,
.unpaid-doc-row,
.unpaid-doc-total-row {
  display: grid;
  grid-template-columns: 34px 126px minmax(180px, 1fr) 96px 96px 96px 118px 110px;
  gap: 8px;
  align-items: center;
}

.unpaid-doc-pick-table .unpaid-doc-head,
.unpaid-doc-pick-table .unpaid-doc-row,
.unpaid-doc-pick-table .unpaid-doc-total-row {
  grid-template-columns: 34px 126px 150px minmax(220px, 1fr) 110px 110px;
}

.unpaid-doc-head {
  padding: 10px;
  background: #eaf5ff;
  color: #1768a8;
  font-size: 13px;
  font-weight: 900;
}

.unpaid-doc-list {
  display: grid;
  max-height: 420px;
  overflow-y: auto;
}

.unpaid-doc-row {
  padding: 10px;
  border-top: 1px solid #e4eff8;
  background: #f8fbff;
}

.unpaid-doc-row strong,
.unpaid-doc-row b,
.unpaid-doc-total-row strong {
  color: #1768a8;
}

.unpaid-doc-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.unpaid-doc-row input[type="number"] {
  min-width: 0;
  height: 36px;
  padding: 0 8px;
}

.unpaid-doc-row button {
  height: 34px;
  border: 1px solid #2d86c9;
  border-radius: 8px;
  background: #ffffff;
  color: #1768a8;
  font-weight: 900;
}

.unpaid-doc-total-row {
  padding: 10px;
  border-top: 1px solid #cfe3f5;
  background: #f1f8ff;
  font-weight: 900;
}

.unpaid-doc-side {
  min-height: 260px;
  max-height: 500px;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid #f0d18d;
  border-radius: 8px;
  background: #fffaf0;
  color: #4f4030;
  font-weight: 800;
  line-height: 1.75;
  white-space: pre-line;
}

.prepay-product-field {
  grid-column: 1 / -1;
}

.policy-explain-field {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 100%;
}

.policy-explain-field strong {
  color: var(--ink);
  font-size: 16px;
}

.policy-explain-text {
  min-height: 168px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.65;
  white-space: pre-line;
}

.saved-policy-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #b9d3ef;
  border-left: 5px solid #2d86c9;
  border-radius: 8px;
  background: #f3f9ff;
  color: #24445f;
  font-size: 13px;
  font-weight: 800;
}

.saved-policy-box.has-policy {
  border-color: #b9dec6;
  border-left-color: var(--accent);
  background: #f1faf5;
  color: #254a35;
}

.saved-policy-box > strong {
  color: inherit;
  font-size: 14px;
}

.saved-policy-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid rgba(47, 143, 91, 0.18);
}

.saved-policy-item:first-child {
  border-top: 0;
}

.saved-policy-item span {
  min-width: 0;
  line-height: 1.45;
}

.saved-policy-item b {
  margin-right: 6px;
  color: var(--accent-dark);
}

.saved-policy-item button {
  min-height: 28px;
  border: 1px solid #e3b4ad;
  border-radius: 8px;
  background: #fff4f1;
  color: #ad3a24;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.lock-product-card {
  max-width: 520px;
}

.lock-product-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.lock-product-field input {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
}

.retail-face-customer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 6px;
}

.retail-face-customer-row button {
  height: 38px;
  border: 1px solid #2d86c9;
  border-radius: 8px;
  background: #e8f4ff;
  color: #1768a8;
  cursor: pointer;
  font-weight: 900;
}

.retail-face-customer-row button:hover {
  background: #d9edff;
}

.inline-retail-return-form .retail-face-customer-row button {
  border-color: #ba4778;
  background: #ffeaf2;
  color: #9a315d;
}

.inline-retail-return-form .retail-face-customer-row button:hover {
  background: #ffdce9;
}

.inline-sale-table {
  display: grid;
  align-content: start;
  gap: 7px;
  height: 100%;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.inline-sale-head,
.inline-sale-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 58px 72px 82px 94px minmax(120px, 0.9fr) 40px;
  gap: 6px;
  align-items: center;
}

.inline-stock-head,
.inline-stock-row {
  grid-template-columns: minmax(150px, 1fr) 58px 92px 92px minmax(130px, 0.9fr) 40px;
}

.inline-sale-head {
  position: sticky;
  top: 0;
  z-index: 1;
  align-items: center;
  padding: 4px 0;
  background: #f1faf5;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.inline-return-form .inline-sale-head {
  background: #fff4e8;
  color: #a84f12;
}

.inline-retail-form .inline-sale-head {
  background: #eef7ff;
  color: #1768a8;
}

.inline-retail-return-form .inline-sale-head {
  background: #fff0f5;
  color: #9a315d;
}

.inline-sale-row {
  padding: 6px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #ffffff;
}

.inline-return-form .inline-sale-row {
  border-color: #f7d9ba;
}

.inline-return-form .inline-sale-row:nth-child(even) {
  background: #fffaf4;
}

.inline-retail-form .inline-sale-row {
  border-color: #cfe3f5;
}

.inline-retail-return-form .inline-sale-row {
  border-color: #f0c7d7;
}

.inline-retail-form .inline-sale-row:nth-child(even) {
  background: #f8fbff;
}

.inline-retail-return-form .inline-sale-row:nth-child(even) {
  background: #fff8fa;
}

.inline-sale-row:nth-child(even) {
  background: #fbfdf9;
}

.inline-sale-row input {
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.inline-sale-row output {
  display: grid;
  align-items: center;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #bddfcb;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.inline-return-form .inline-sale-row output {
  border-color: #f1c08f;
  background: #fff7ee;
  color: #a84f12;
}

.inline-retail-form .inline-sale-row output {
  border-color: #a9cdec;
  background: #f3f9ff;
  color: #1768a8;
}

.inline-retail-return-form .inline-sale-row output {
  border-color: #e7a9c1;
  background: #fff4f8;
  color: #9a315d;
}

.inline-delete-row {
  display: grid;
  place-items: center;
  height: 34px;
  border: 1px solid #f0c0b6;
  border-radius: 8px;
  background: #fff4f1;
  color: #ad3a24;
  cursor: pointer;
  font-weight: 900;
}

.inline-delete-row:hover {
  background: #ffe7df;
}

.inline-add-row {
  justify-self: start;
  min-height: 36px;
  padding: 0 14px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: #f1faf5;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 900;
}

.inline-return-form .inline-add-row {
  border-color: #d56b1f;
  background: #fff4e8;
  color: #a84f12;
}

.inline-retail-form .inline-add-row {
  border-color: #2d86c9;
  background: #eef7ff;
  color: #1768a8;
}

.inline-retail-return-form .inline-add-row {
  border-color: #ba4778;
  background: #fff0f5;
  color: #9a315d;
}

.inline-goods-total {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f1faf5;
  color: var(--muted);
  font-weight: 900;
}

.inline-return-form .inline-goods-total {
  border-color: #f1c08f;
  background: #fff4e8;
}

.inline-retail-form .inline-goods-total {
  border-color: #a9cdec;
  background: #eef7ff;
}

.inline-retail-return-form .inline-goods-total {
  border-color: #e7a9c1;
  background: #fff0f5;
}

.inline-goods-total strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.inline-return-form .inline-goods-total strong {
  color: #a84f12;
}

.inline-retail-form .inline-goods-total strong {
  color: #1768a8;
}

.inline-retail-return-form .inline-goods-total strong {
  color: #9a315d;
}

.inline-business-form .unit-input {
  background: #f3f7f0;
  color: var(--muted);
  font-weight: 900;
}

.total-panel {
  gap: 4px;
  border-color: #bddfcb;
  background: #eef8f2;
}

.inline-return-form .total-panel {
  border-color: #f1c08f;
  background: #fff4e8;
}

.inline-retail-form .total-panel {
  border-color: #a9cdec;
  background: #eef7ff;
}

.inline-retail-return-form .total-panel {
  border-color: #e7a9c1;
  background: #fff0f5;
}

.total-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.total-panel strong {
  color: var(--accent-dark);
  font-size: 30px;
  line-height: 1.1;
}

.inline-return-form .total-panel strong {
  color: #a84f12;
}

.inline-retail-form .total-panel strong {
  color: #1768a8;
}

.inline-retail-return-form .total-panel strong {
  color: #9a315d;
}

.payment-panel {
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  padding: 10px;
  border-color: #bddfcb;
  background: #f1faf5;
}

.inline-return-form .payment-panel {
  border-color: #f1c08f;
  background: #fff7ee;
}

.inline-retail-form .payment-panel {
  border-color: #a9cdec;
  background: #f3f9ff;
}

.inline-retail-return-form .payment-panel {
  border-color: #e7a9c1;
  background: #fff4f8;
}

.payment-panel .business-section-title {
  box-sizing: border-box;
  height: 34px;
  padding-bottom: 6px;
}

.payment-panel .business-section-title > span {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.inline-return-form .payment-panel .business-section-title > span {
  background: #a84f12;
}

.inline-retail-form .payment-panel .business-section-title > span {
  background: #1768a8;
}

.inline-retail-return-form .payment-panel .business-section-title > span {
  background: #9a315d;
}

.inline-return-form .payment-choice.active {
  border-color: #d56b1f;
  background: #fff0df;
  color: #a84f12;
}

.inline-retail-form .payment-choice.active {
  border-color: #2d86c9;
  background: #e8f4ff;
  color: #1768a8;
}

.inline-retail-return-form .payment-choice.active {
  border-color: #ba4778;
  background: #ffeaf2;
  color: #9a315d;
}

.inline-return-form .inline-multi-account-button {
  border-color: #d56b1f;
  color: #a84f12;
}

.inline-retail-form .inline-multi-account-button {
  border-color: #2d86c9;
  color: #1768a8;
}

.inline-retail-return-form .inline-multi-account-button {
  border-color: #ba4778;
  color: #9a315d;
}

.inline-return-form .inline-multi-account-button:hover {
  background: #fff0df;
}

.inline-retail-form .inline-multi-account-button:hover {
  background: #e8f4ff;
}

.inline-retail-return-form .inline-multi-account-button:hover {
  background: #ffeaf2;
}

.inline-return-form .inline-save-button {
  background: #d56b1f;
  border-color: #d56b1f;
}

.inline-retail-form .inline-save-button {
  background: #2d86c9;
  border-color: #2d86c9;
}

.inline-retail-return-form .inline-save-button {
  background: #ba4778;
  border-color: #ba4778;
}

.payment-panel .business-section-title strong {
  font-size: 15px;
}

.payment-panel .business-section-title small {
  display: none;
}

.payment-choice-grid.compact-payment-choice {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 90px;
  gap: 6px;
}

.inline-retail-form .payment-choice-grid.compact-payment-choice {
  grid-template-columns: 86px minmax(0, 1fr);
  height: 92px;
  align-content: start;
}

.inline-retail-form .payment-choice-grid.compact-payment-choice [data-inline-payment-mode="full"] {
  grid-column: 1 / -1;
}

.inline-retail-form .payment-choice-grid.compact-payment-choice .payment-choice-free {
  width: 76px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 6px 4px;
  justify-self: start;
  border-color: #88bfe8;
  background: #ffffff;
}

.inline-wholesale-sale-form .payment-choice-grid.compact-payment-choice .payment-choice-free {
  grid-column: 1 / span 2;
  width: auto;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 6px 4px;
  justify-self: stretch;
  border-color: #8fcf9f;
  background: #ffffff;
}

.inline-wholesale-sale-form .payment-choice-grid.compact-payment-choice [data-inline-payment-mode="prepayCredit"] {
  grid-column: 3 / span 4;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 6px 4px;
}

.inline-wholesale-sale-form .payment-choice-grid.compact-payment-choice [data-inline-payment-mode="unknownDraft"] {
  grid-column: 7 / -1;
}

.inline-wholesale-sale-form .payment-choice-grid.compact-payment-choice {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.inline-wholesale-sale-form .payment-choice-grid.compact-payment-choice [data-inline-payment-mode="full"] {
  grid-column: 1 / span 4;
}

.inline-wholesale-sale-form .payment-choice-grid.compact-payment-choice [data-inline-payment-mode="partial"] {
  grid-column: 5 / span 4;
}

.inline-wholesale-sale-form .payment-choice-grid.compact-payment-choice [data-inline-payment-mode="debt"] {
  grid-column: 9 / span 4;
}

.inline-retail-return-form .payment-choice-grid.compact-payment-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 42px;
}

.payment-choice-grid.compact-payment-choice [data-inline-payment-mode="unknownDraft"] {
  grid-column: 1 / -1;
}

.payment-choice-grid.compact-payment-choice .payment-choice {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 6px 4px;
  border-width: 2px;
  text-align: center;
}

.payment-choice-grid.compact-payment-choice .payment-choice strong {
  font-size: 12px;
  line-height: 1.15;
}

.payment-choice-grid.compact-payment-choice .payment-choice small {
  display: none;
}

.inline-payment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.inline-payment-fields .inline-account-field {
  grid-column: 1 / -1;
}

.inline-account-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.inline-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 6px;
}

.inline-account-summary {
  display: grid;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #b7dcc6;
  border-radius: 8px;
  background: #edf8f1;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 1000;
}

.inline-account-summary[hidden] {
  display: none;
}

.inline-return-form .inline-account-summary {
  border-color: #f1c08f;
  background: #fff0df;
  color: #a84f12;
}

.inline-retail-form .inline-account-summary {
  border-color: #a9cdec;
  background: #e8f4ff;
  color: #1768a8;
}

.inline-retail-return-form .inline-account-summary {
  border-color: #e7a9c1;
  background: #ffeaf2;
  color: #9a315d;
}

.inline-multi-account-button {
  height: 34px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.prepay-money-grid .prepay-multi-button {
  height: 56px;
  font-size: 16px;
}

.workspace-tab-panel .prepay-money-grid .prepay-multi-button,
.workspace-tab-panel .prepay-money-grid .inline-lock-product-button {
  height: 42px;
  font-size: 14px;
}

.inline-multi-account-button:hover {
  background: #e9f7ef;
}

.inline-payment-fields .is-hidden {
  display: none;
}

.inline-payment-fields.is-debt-mode [data-inline-payment-term] {
  grid-column: 1 / -1;
}

.inline-payment-fields.is-prepay-credit-mode .inline-account-row {
  grid-template-columns: minmax(0, 1fr);
}

.inline-payment-fields.is-prepay-credit-mode [data-open-multi-account] {
  display: none;
}

.inline-payment-fields input {
  height: 34px;
}

.payment-panel .payment-hint {
  display: none;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
}

.multi-account-card {
  width: min(560px, 100%);
}

.multi-account-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.multi-account-list label {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 0.8fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf9;
  color: var(--ink);
  font-weight: 900;
}

.multi-account-list input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.multi-account-total {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 900;
}

.multi-account-total strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.prepay-credit-card {
  width: min(700px, calc(100vw - 48px));
  max-height: none;
  overflow: visible;
  padding: 18px;
}

.prepay-credit-judge {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.prepay-credit-judge span {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid #b9dec6;
  border-radius: 8px;
  background: #f1faf5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.prepay-credit-judge strong {
  color: var(--accent-dark);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.prepay-credit-judge.is-short span {
  border-color: #f0d18d;
  background: #fffaf0;
}

.prepay-credit-note {
  padding: 10px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #fbfdf9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.prepay-credit-error {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #f0c0b6;
  border-radius: 8px;
  background: #fff4f1;
  color: #ad3a24;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
  min-height: 58px;
  transition: none;
}

.prepay-credit-error[aria-hidden="true"] {
  visibility: hidden;
}

.prepay-credit-error > strong {
  color: #ad3a24;
}

.prepay-credit-error p {
  margin: 2px 0 0;
}

.prepay-credit-main-input,
.prepay-credit-term {
  margin-top: 10px;
}

.prepay-credit-main-input {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 10px;
}

.prepay-credit-main-input input,
.prepay-credit-term input {
  height: 40px;
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.prepay-credit-card [data-fill-credit] {
  margin-top: 0;
  margin-bottom: 12px;
  width: 180px;
  height: 36px;
}

.prepay-credit-shortage {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #f0d18d;
  border-left: 5px solid #d8a63b;
  border-radius: 8px;
  background: #fffaf0;
  color: #7a4d05;
  font-weight: 900;
}

.prepay-credit-shortage[hidden] {
  display: none;
}

.prepay-credit-shortage > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.prepay-credit-shortage button {
  min-height: 38px;
  border: 1px solid #d8a63b;
  border-radius: 8px;
  background: #ffffff;
  color: #7a4d05;
  cursor: pointer;
  font-weight: 900;
}

.prepay-credit-accounts {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.prepay-credit-accounts[hidden],
.prepay-credit-debt[hidden],
.prepay-credit-plan-result[hidden] {
  display: none;
}

.prepay-credit-accounts > strong {
  color: var(--ink);
}

.prepay-account-rows {
  display: grid;
  gap: 8px;
}

.prepay-account-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.8fr) 42px;
  gap: 8px;
  align-items: center;
}

.prepay-account-row input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.prepay-account-row button {
  height: 36px;
  border: 1px solid #e3b4ad;
  border-radius: 8px;
  background: #fff4f1;
  color: #ad3a24;
  cursor: pointer;
  font-weight: 900;
}

.prepay-credit-debt,
.prepay-credit-plan-result {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #fbfdf9;
  font-weight: 800;
}

.prepay-auto-debt {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.prepay-auto-debt strong {
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.prepay-credit-plan-result strong {
  color: var(--ink);
}

.prepay-plan-debt {
  display: inline-block;
  margin-left: 6px;
  padding: 5px 9px;
  border: 1px solid #e3a39b;
  border-radius: 8px;
  background: #fff0ee;
  color: #ad3a24;
  font-weight: 1000;
  line-height: 1.25;
}

.prepay-credit-plan-result {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.prepay-credit-plan-result button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.prepay-debt-confirm-card {
  width: min(520px, calc(100vw - 48px));
  overflow: visible;
}

.prepay-debt-confirm-lines {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.prepay-debt-confirm-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 10px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #fbfdf9;
  color: var(--muted);
  font-weight: 900;
}

.prepay-debt-confirm-lines strong {
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.prepay-debt-confirm-lines .is-debt {
  border-color: #f0c0b6;
  background: #fff4f1;
  color: #ad3a24;
}

.prepay-debt-confirm-lines .is-debt strong {
  color: #ad3a24;
}

.remark-panel {
  padding: 10px;
  background: #ffffff;
}

.remark-panel label {
  gap: 5px;
}

.remark-panel input {
  height: 34px;
}

.inline-save-panel {
  display: grid;
  gap: 8px;
  align-self: end;
}

.inline-save-panel .business-form-result {
  max-height: none;
  padding: 8px 10px;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.32;
}

.inline-save-panel .business-form-result.is-empty {
  display: none;
}

.inline-save-button {
  width: 100%;
  min-height: 42px;
  font-size: 18px;
}

.workspace-tab-panel .inline-save-button {
  min-height: 40px;
  font-size: 17px;
}

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

.documents-grid .module-action {
  min-height: 118px;
  padding: 18px;
  font-size: 22px;
}

.document-workspace {
  padding-bottom: 24px;
}

.document-entry[hidden],
.document-result[hidden] {
  display: none;
}

.document-result {
  width: 100%;
}

.document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.document-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-filter-group button,
.document-search button,
.doc-view,
.doc-modal-heading button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.document-filter-group button.active,
.doc-view {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.trace-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.document-search {
  display: flex;
  gap: 8px;
  min-width: 360px;
}

.document-search input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

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

.document-summary article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.document-summary span,
.document-summary strong {
  display: block;
}

.document-summary span {
  color: var(--muted);
  font-size: 13px;
}

.document-summary strong {
  margin-top: 8px;
  font-size: 24px;
}

.document-panel {
  overflow: hidden;
}

.document-panel .panel-heading {
  align-items: flex-start;
}

.document-panel .panel-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.document-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.page-size-control select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.document-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.document-pagination button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.document-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.active-condition {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f1faf5;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.document-table-wrap {
  overflow-x: auto;
}

.document-table {
  min-width: 1320px;
}

.doc-modal[hidden],
.condition-modal[hidden],
.business-modal[hidden] {
  display: none;
}

.doc-modal,
.condition-modal,
.business-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 30, 24, 0.52);
}

.workspace > .business-modal.inline-workspace-modal,
.workspace-tab-panel > .business-modal.inline-workspace-modal {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  place-items: initial;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.workspace > .business-modal.inline-workspace-modal .business-card,
.workspace > .business-modal.inline-workspace-modal .condition-card,
.workspace-tab-panel > .business-modal.inline-workspace-modal .business-card,
.workspace-tab-panel > .business-modal.inline-workspace-modal .condition-card {
  width: 100%;
  max-height: none;
  min-height: calc(100vh - 96px);
  overflow: auto;
  box-shadow: none;
}

.workspace > .business-modal.inline-workspace-modal .doc-modal-heading button[data-close],
.workspace > .business-modal.inline-workspace-modal .doc-modal-heading button[data-master-home],
.workspace-tab-panel > .business-modal.inline-workspace-modal .doc-modal-heading button[data-close],
.workspace-tab-panel > .business-modal.inline-workspace-modal .doc-modal-heading button[data-master-home] {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.condition-modal {
  z-index: 29;
}

.doc-modal-card {
  width: min(960px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(20, 30, 24, 0.24);
}

.condition-card {
  width: min(820px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(20, 30, 24, 0.24);
}

.condition-card.unpaid-doc-card {
  width: min(980px, calc(100vw - 44px));
}

.business-card.retail-history-card {
  width: min(1280px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
}

.retail-history-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.retail-history-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.retail-history-filters input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.retail-history-filter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.retail-history-filter-actions button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.retail-history-filter-actions .condition-confirm {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.retail-history-summary {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #cfe7d6;
  border-radius: 8px;
  background: #f0faf3;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.retail-history-table-wrap {
  max-height: min(68vh, 680px);
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.retail-history-table {
  min-width: 1120px;
  margin-top: 0;
}

.retail-history-table th,
.retail-history-table td {
  padding: 8px 7px;
  font-size: 13px;
}

.retail-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef7f0;
}

.retail-history-table td:nth-child(6) {
  max-width: 280px;
  white-space: normal;
  line-height: 1.35;
}

.business-card.policy-search-card {
  width: min(1280px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
}

.policy-search-filters {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.policy-search-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.policy-search-filters input,
.policy-search-filters select {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.policy-search-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.policy-search-actions button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.policy-search-actions .condition-confirm {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.policy-search-summary {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #cfe7d6;
  border-radius: 8px;
  background: #f0faf3;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.policy-search-table-wrap {
  max-height: min(68vh, 680px);
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.policy-search-table {
  min-width: 1180px;
  margin-top: 0;
}

.policy-search-table th,
.policy-search-table td {
  padding: 8px 7px;
  font-size: 13px;
}

.policy-search-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef7f0;
}

.policy-search-table td:nth-child(6) {
  max-width: 320px;
  white-space: normal;
  line-height: 1.35;
}

.retail-history-doc-button {
  font: inherit;
  cursor: pointer;
}

.policy-detail-button {
  font: inherit;
  cursor: pointer;
}

.retail-history-detail-modal {
  z-index: 35;
}

.business-card.retail-history-detail-card {
  width: min(960px, calc(100vw - 44px));
}

.business-card.policy-detail-card {
  width: min(980px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
}

.business-card.customer-sales-card {
  width: min(1280px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
}

.customer-sales-filters {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr 1fr 1fr 1fr;
  gap: 6px 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.customer-sales-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.customer-sales-filters input,
.customer-sales-filters select {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.customer-sales-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.customer-sales-product-picker {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-sales-actions button,
.customer-sales-summary button,
.customer-sales-docs-title button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.customer-sales-actions .condition-confirm,
.customer-sales-summary button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.customer-sales-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #cfe7d6;
  border-radius: 8px;
  background: #f0faf3;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.customer-sales-table-wrap,
.customer-sales-docs-table-wrap {
  max-height: min(50vh, 520px);
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.customer-sales-docs-table-wrap {
  max-height: min(34vh, 360px);
}

.customer-sales-table,
.customer-sales-docs-table {
  min-width: 980px;
  margin-top: 0;
}

.customer-sales-docs-table {
  min-width: 1180px;
}

.customer-sales-table th,
.customer-sales-table td,
.customer-sales-docs-table th,
.customer-sales-docs-table td {
  padding: 8px 7px;
  font-size: 13px;
}

.customer-sales-table th,
.customer-sales-docs-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef7f0;
}

.customer-sales-total-row {
  background: #f3faf5;
  color: var(--accent-dark);
}

.customer-sales-docs {
  margin-top: 10px;
}

.customer-sales-docs-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-sales-product-card {
  width: min(720px, calc(100vw - 44px));
}

.customer-sales-product-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: min(56vh, 460px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.customer-sales-product-list label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #dfe8dd;
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.business-card {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(20, 30, 24, 0.24);
}

.doc-modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.doc-modal-heading h2 {
  margin: 4px 0 0;
}

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

.condition-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.condition-grid input,
.condition-grid select,
.business-form input,
.business-form select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.business-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.business-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.business-form-wide,
.business-form-result,
.business-form-actions,
.business-items,
.business-section,
.posted-message {
  grid-column: 1 / -1;
}

.business-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe8dd;
  border-radius: 8px;
  background: #fbfdf9;
}

.business-section:nth-of-type(even) {
  background: #f6faf7;
}

.business-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5eee3;
}

.business-section-title > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.business-section-title strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.business-section-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.business-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.business-items {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(82px, 0.55fr) minmax(90px, 0.55fr) minmax(110px, 0.75fr) minmax(120px, 0.8fr);
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.business-items-head {
  display: contents;
}

.business-items-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.business-items label {
  display: block;
}

.business-items .unit-input {
  background: #f3f7f0;
  color: var(--muted);
  font-weight: 900;
}

.line-total {
  display: grid;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #dfe8dd;
  border-radius: 8px;
  background: #f7faf6;
  color: var(--accent-dark);
  font-weight: 900;
}

.business-items-total {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 0;
  border-top: 1px solid #e5eee3;
  color: var(--muted);
  font-weight: 900;
}

.business-items-total strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.payment-section {
  border-color: #bddfcb;
  background: #f1faf5;
}

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

.payment-choice {
  min-height: 82px;
  padding: 12px;
  border: 2px solid #d8e8dc;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.payment-choice strong,
.payment-choice small {
  display: block;
}

.payment-choice strong {
  font-size: 18px;
}

.payment-choice small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payment-choice.active {
  border-color: var(--accent);
  background: #e8f6ed;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.payment-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.payment-detail-grid .is-hidden {
  display: none;
}

.payment-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  font-weight: 900;
}

.business-form-result {
  padding: 10px 12px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f1faf5;
  color: var(--accent-dark);
  font-weight: 800;
}

.business-form-result.business-form-error {
  border-color: #f0c0b6;
  background: #fff4f1;
  color: #ad3a24;
}

.posted-message {
  padding: 18px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f1faf5;
}

.posted-message strong {
  display: block;
  color: var(--accent-dark);
  font-size: 22px;
}

.posted-message p {
  margin-top: 8px;
  color: var(--muted);
}

.save-success-card {
  width: min(460px, calc(100vw - 36px));
}

.save-success-message {
  border-color: #b9dfc4;
  background: #f1faf5;
}

.save-success-message strong {
  color: #167145;
  font-size: 26px;
}

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

.condition-actions button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.condition-actions .condition-confirm {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

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

.doc-detail-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.doc-detail-grid span,
.doc-detail-grid strong {
  display: block;
}

.doc-detail-grid span {
  color: var(--muted);
  font-size: 13px;
}

.doc-detail-grid strong {
  margin-top: 6px;
}

.entry-replay {
  display: grid;
  gap: 12px;
}

.entry-replay-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.entry-replay-title h2 {
  margin: 2px 0 0;
  color: var(--ink);
}

.entry-replay-title strong {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.entry-replay-panel {
  padding: 14px;
  border: 1px solid #dfe8dd;
  border-radius: 8px;
  background: #fbfdf9;
}

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

.entry-replay-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.entry-replay-value {
  min-height: 40px;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-replay-value.strong {
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 1000;
}

.entry-replay-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entry-replay-table {
  min-width: 720px;
  margin-top: 0;
}

.entry-replay-table th,
.entry-replay-table td {
  padding: 9px 8px;
  font-size: 13px;
}

.entry-replay-table th {
  background: #eef7f0;
}

.entry-replay-remark {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.doc-detail-section {
  margin-top: 16px;
}

.doc-detail-section h3 {
  margin: 0 0 10px;
}

.doc-detail-section p {
  margin: 0;
  color: var(--muted);
}

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

.fees-grid .module-action {
  min-height: 112px;
  padding: 18px;
  font-size: 22px;
}

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

.warehouse-stock-grid .module-action {
  min-height: 86px;
  padding: 14px;
  font-size: 20px;
}

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

.purchase-data-grid .module-action {
  min-height: 68px;
  padding: 10px 12px;
  font-size: 18px;
}

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

.purchase-settle-grid .module-action {
  min-height: 68px;
  padding: 10px 12px;
  font-size: 18px;
}

.purchase-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(88px, auto));
  row-gap: 10px;
}

.purchase-grid .module-action {
  min-height: 88px;
  padding: 14px;
  font-size: 20px;
}

.purchase-grid .module-action:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.purchase-grid .module-action:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.purchase-grid .module-action:nth-child(3) {
  grid-column: 1;
  grid-row: 3;
}

.purchase-grid .module-action:nth-child(4) {
  grid-column: 2;
  grid-row: 1;
}

.purchase-grid .module-action:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
}

.purchase-grid .module-action:nth-child(6) {
  grid-column: 1;
  grid-row: 4;
  margin-top: 0;
  min-height: 76px;
  padding: 12px 14px;
  font-size: 18px;
}

.master-data-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.master-data-grid .module-action {
  min-height: 112px;
  padding: 18px;
  font-size: 22px;
}

.master-workbench-card {
  width: min(1500px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 36px));
  overflow: hidden;
}

.master-page-loading {
  display: grid;
  min-height: calc(100vh - 80px);
  align-content: center;
  gap: 8px;
  padding: 32px;
  border: 1px solid #d7e5dd;
  border-radius: 10px;
  background: #fbfefc;
}

.master-page-loading h2 {
  margin: 0;
  font-size: 30px;
}

.workspace > .business-modal.inline-workspace-modal.master-page-workbench .master-workbench-card,
.workspace-tab-panel > .business-modal.inline-workspace-modal.master-page-workbench .master-workbench-card {
  width: 100%;
  height: calc(100vh - 118px);
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
}

.workspace-tab-panel > .business-modal.inline-workspace-modal.master-page-workbench .master-workbench-card {
  height: calc(100vh - 164px);
}

.workspace > .business-modal.inline-workspace-modal.master-page-workbench .business-card,
.workspace-tab-panel > .business-modal.inline-workspace-modal.master-page-workbench .business-card {
  min-height: 0;
  overflow: hidden;
}

.master-page-workbench .master-workbench-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid #e3eee7;
}

.master-page-workbench .master-workbench-heading h2 {
  font-size: 30px;
}

.master-workbench-heading {
  margin-bottom: 12px;
}

.master-workbench {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  height: calc(100% - 72px);
  min-height: 0;
  min-width: 0;
}

.master-type-panel,
.master-category-panel,
.master-list-panel {
  min-height: 0;
  min-width: 0;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #fbfefc;
}

.master-type-panel,
.master-category-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

.master-type-panel > strong,
.master-category-panel > strong,
.master-directory-head strong {
  color: #24352b;
  font-size: 16px;
}

.master-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.master-directory-head small {
  display: block;
  margin-top: 3px;
  max-width: 120px;
  overflow: hidden;
  color: #6b7b71;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-directory-head button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cbdad1;
  border-radius: 8px;
  background: #fff;
  color: #2d503c;
  font-weight: 900;
  white-space: nowrap;
}

.master-directory-head button:disabled {
  opacity: 0.38;
}

.master-type-list,
.master-category-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.master-type-list button,
.master-category-list button,
.master-directory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #2c3b32;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.master-directory-row {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  padding: 6px;
}

.master-directory-row > button {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.master-directory-row > button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-directory-row .master-directory-more {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  align-self: center;
  padding: 0;
  border: 1px solid #d8e4dd;
  border-radius: 7px;
  background: #f8fbf9;
  color: #52645a;
  font-size: 20px;
  line-height: 0;
  text-align: center;
}

.master-directory-menu {
  position: absolute;
  top: 34px;
  right: 6px;
  z-index: 4;
  display: none;
  min-width: 92px;
  padding: 6px;
  border: 1px solid #e7c3ba;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgb(32 49 39 / 14%);
}

.master-directory-row.menu-open .master-directory-menu {
  display: block;
}

.master-directory-menu button {
  width: 100%;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: #fff4f1;
  color: #b84225;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.master-type-list button.active,
.master-category-list button.active {
  border-color: #2f8f5b;
  background: #eaf8ef;
  color: #176339;
}

.master-category-list button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.master-category-list small {
  min-width: 26px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4f0;
  color: #5c7065;
}

.master-empty-directory {
  padding: 14px 12px;
  border: 1px dashed #c6d8ce;
  border-radius: 8px;
  background: #f8fbf9;
  color: #728178;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.master-empty-directory.is-leaf {
  display: grid;
  align-content: space-evenly;
  justify-items: center;
  gap: 18px;
  min-height: 220px;
  padding: 22px 12px;
  border-color: #9ac7ad;
  background: #eff9f3;
  color: #1f5f38;
  font-size: 18px;
  text-align: center;
}

.master-empty-directory.is-leaf span {
  display: block;
  line-height: 1.35;
  text-align: center;
}

.master-empty-directory.is-leaf span:first-child {
  font-size: 22px;
  font-weight: 1000;
}

.master-category-list.slide-forward {
  animation: masterSlideForward 170ms ease-out;
}

.master-category-list.slide-back {
  animation: masterSlideBack 170ms ease-out;
}

.master-category-list.slide-refresh {
  animation: masterSlideRefresh 150ms ease-out;
}

@keyframes masterSlideForward {
  from {
    opacity: 0.35;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes masterSlideBack {
  from {
    opacity: 0.35;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes masterSlideRefresh {
  from {
    opacity: 0.5;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.master-add-category {
  display: grid;
  gap: 8px;
}

.master-category-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.master-add-category input,
.master-list-toolbar input {
  height: 38px;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  padding: 0 10px;
  font-weight: 800;
}

.master-add-category button {
  height: 38px;
  border: 1px solid #2f8f5b;
  border-radius: 8px;
  background: #eaf8ef;
  color: #176339;
  font-weight: 900;
}

.master-list-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
}

.master-record-workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

.master-record-workspace[hidden] {
  display: none;
}

.master-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.master-list-toolbar strong {
  display: block;
  font-size: 20px;
}

.master-list-toolbar small {
  color: #6c7a71;
  font-weight: 800;
}

.master-list-toolbar input {
  flex: 0 1 260px;
  width: min(260px, 34%);
  min-width: 150px;
}

.master-show-disabled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #52665b;
  font-size: 13px;
  font-weight: 900;
}

.master-show-disabled input {
  width: 16px;
  height: 16px;
  accent-color: #2f8f5b;
}

.master-inline-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(100px, auto);
  align-items: center;
  gap: 7px 10px;
  padding: 7px 9px;
  min-width: 0;
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: #fbfdfc;
}

.master-inline-form label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  color: #52645a;
}

.master-inline-form input,
.master-inline-form select {
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  border-color: #d6e2db;
  background: #ffffff;
}

.master-inline-form .business-form-wide {
  grid-column: 1 / -1;
}

.master-inline-form .business-form-result {
  grid-column: 1 / -2;
  min-height: 26px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  color: #53665b;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  background: #eef7f2;
}

.master-inline-form .business-form-result.business-form-error {
  border: 1px solid #f0c0b6;
  background: #fff4f1;
  color: #ad3a24;
}

.master-inline-form .business-form-actions {
  grid-column: auto;
  align-self: stretch;
  margin-top: 0;
}

.master-inline-form .business-form-actions button {
  height: 30px;
  min-width: 94px;
  padding: 0 12px;
}

.customer-region-picker {
  display: grid;
  grid-template-columns: max-content repeat(auto-fit, minmax(96px, 1fr));
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: #f7fbf9;
}

.customer-region-title {
  grid-column: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
  color: #26382d;
  font-weight: 1000;
}

.customer-region-title strong {
  white-space: nowrap;
}

.customer-region-title small {
  color: #6d7b72;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-region-picker label[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .master-inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(100px, auto);
  }

  .customer-region-picker {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .customer-region-title {
    align-items: flex-start;
  }
}

.master-form-placeholder {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed #c9d9d0;
  border-radius: 8px;
  background: #f8fbf9;
  color: #52645a;
}

.master-panel-placeholder {
  align-content: center;
  justify-items: center;
  min-height: 100%;
  text-align: center;
}

.master-form-placeholder[hidden] {
  display: none;
}

.master-form-placeholder strong {
  color: #26382d;
  font-size: 16px;
}

.master-form-placeholder span {
  font-size: 13px;
  font-weight: 800;
}

.master-table-wrap {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
}

.master-table-wrap table {
  min-width: 900px;
  margin: 0;
}

.master-table-wrap th,
.master-table-wrap td {
  padding-left: 9px;
  padding-right: 9px;
  font-size: 14px;
}

.master-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef8f2;
}

.master-table-wrap thead th:last-child,
.master-table-wrap tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 124px;
  background: #ffffff;
  box-shadow: -8px 0 14px rgba(31, 47, 39, 0.08);
}

.master-table-wrap thead th:last-child {
  z-index: 3;
  background: #eef8f2;
}

.master-table-wrap tr[draggable="true"] {
  cursor: grab;
}

.master-table-wrap tr.is-dragging,
.master-category-list button.is-dragging {
  opacity: 0.45;
}

.master-table-wrap tr.is-disabled {
  color: #87938c;
  background: #f6f7f6;
}

.master-table-wrap tr.is-disabled td:last-child {
  background: #f6f7f6;
}

.master-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.master-status.is-normal {
  background: #e8f8ee;
  color: #176339;
}

.master-status.is-disabled {
  background: #ecefed;
  color: #69756d;
}

.master-row-actions {
  white-space: nowrap;
}

.master-row-actions button {
  min-width: 54px;
  height: 30px;
  margin-right: 6px;
  border: 1px solid #cad9d1;
  border-radius: 7px;
  background: #ffffff;
  color: #284335;
  font-weight: 900;
}

.master-row-actions [data-delete-master-record] {
  border-color: #f2b8aa;
  background: #fff4f1;
  color: #b84225;
}

.face-capture-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #a9cdec;
  border-radius: 8px;
  background: #f3f9ff;
}

.face-capture-panel strong,
.face-capture-panel small {
  display: block;
}

.face-capture-panel strong {
  color: #1768a8;
  font-size: 18px;
}

.face-capture-panel small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.region-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.region-panel {
  display: grid;
  grid-template-rows: auto auto minmax(92px, 1fr) minmax(52px, auto) 34px;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 8px;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #fbfefc;
}

.region-panel-head,
.region-actions,
.region-scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.region-panel-head strong {
  display: block;
  color: #24352b;
  font-size: 18px;
}

.region-panel-head small {
  color: #627469;
  font-size: 12px;
  font-weight: 800;
}

.region-panel-head small.is-error {
  color: #b84225;
}

.region-panel button,
.region-add-row input {
  height: 32px;
  border: 1px solid #cfded5;
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}

.region-panel button {
  padding: 0 10px;
  color: #236640;
}

.region-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.region-scope-row {
  justify-content: flex-start;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #e0ece5;
  border-radius: 8px;
  background: #f6fbf8;
}

.region-scope-row strong {
  color: #405247;
  font-size: 14px;
  font-weight: 900;
}

.region-scope-row span {
  color: #68786f;
  font-size: 12px;
  font-weight: 800;
}

.region-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 8px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.region-columns.no-village {
  grid-template-columns: repeat(5, minmax(118px, 1fr));
}

.region-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
  padding: 6px;
  border: 1px solid #dbe8e0;
  border-radius: 8px;
  background: #ffffff;
}

.region-selected-panel {
  display: grid;
  gap: 6px;
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid #dbe8e0;
  border-radius: 8px;
  background: #f8fbf9;
}

.region-selected-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #26382d;
  font-weight: 1000;
}

.region-selected-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  max-height: 48px;
  overflow-y: auto;
}

.region-selected-list > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  height: 28px;
  padding: 0 10px;
  border-color: #bdd6c8;
  background: #ffffff;
  color: #236640;
}

.region-actions {
  min-height: 34px;
}

.region-actions button {
  height: 32px;
}

.product-master-card {
  overflow: hidden;
}

.product-catalog-workbench {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: calc(100% - 72px);
  min-height: 0;
  min-width: 0;
}

.product-catalog-create,
.product-catalog-list-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #fbfefc;
}

.product-catalog-create {
  grid-template-rows: auto auto;
}

.product-catalog-list-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.product-catalog-form {
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(118px, auto) minmax(0, 1.2fr);
  align-items: end;
}

.product-catalog-form .business-form-result {
  min-height: 32px;
}

.product-catalog-table-wrap {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #ffffff;
}

.product-catalog-table-wrap table {
  min-width: 860px;
  margin: 0;
}

.product-catalog-table-wrap th,
.product-catalog-table-wrap td {
  padding-left: 10px;
  padding-right: 10px;
  font-size: 15px;
}

.product-catalog-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef8f2;
}

.product-catalog-table-wrap thead th:last-child,
.product-catalog-table-wrap tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 170px;
  background: #ffffff;
  box-shadow: -8px 0 14px rgba(31, 47, 39, 0.08);
}

.product-catalog-table-wrap thead th:last-child {
  z-index: 3;
  background: #eef8f2;
}

.product-catalog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.product-catalog-actions button {
  min-width: 72px;
}

.product-spec-workbench {
  display: grid;
  height: calc(100% - 72px);
  min-height: 0;
  min-width: 0;
}

.product-master-workbench {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  height: calc(100% - 72px);
  min-height: 0;
  min-width: 0;
}

.product-master-products,
.product-master-specs {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #fbfefc;
}

.product-master-products {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

.product-master-specs {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

.product-master-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.product-master-head strong {
  color: #24352b;
  font-size: 18px;
}

.product-master-head small {
  color: #6c7a71;
  font-size: 12px;
  font-weight: 800;
}

.product-master-form,
.product-spec-form {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: #ffffff;
}

.product-master-form label,
.product-spec-form label {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #52645a;
  font-size: 13px;
  font-weight: 900;
}

.product-master-form input,
.product-master-form select,
.product-spec-form input,
.product-spec-form select {
  min-width: 0;
  height: 30px;
  padding: 4px 8px;
  border: 1px solid #d6e2db;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 900;
}

.product-master-form button,
.product-spec-form button {
  height: 32px;
  border: 1px solid #2f8f5b;
  border-radius: 8px;
  background: #eaf8ef;
  color: #176339;
  font-weight: 900;
}

.product-master-form .business-form-result,
.product-spec-form .business-form-result {
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #eef7f2;
  color: #53665b;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.product-master-form .business-form-result.business-form-error,
.product-spec-form .business-form-result.business-form-error {
  border: 1px solid #f0c0b6;
  background: #fff4f1;
  color: #ad3a24;
}

.product-master-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
}

.product-master-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #2c3b32;
  text-align: left;
}

.product-master-list button.active {
  border-color: #2f8f5b;
  background: #eaf8ef;
}

.product-master-list b,
.product-master-list small {
  display: block;
}

.product-master-list b {
  font-weight: 1000;
}

.product-master-list small {
  margin-top: 3px;
  color: #65766c;
  font-size: 12px;
  font-weight: 800;
}

.product-master-list em {
  flex: 0 0 auto;
  font-style: normal;
  color: #176339;
  font-size: 12px;
  font-weight: 900;
}

.product-spec-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(94px, auto);
  align-items: center;
}

.product-spec-form .spec-name,
.product-spec-form .spec-remark {
  grid-column: span 2;
}

.product-spec-form .business-form-result {
  grid-column: 1 / -2;
}

.product-spec-table-wrap {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
}

.product-spec-table-wrap table {
  min-width: 1280px;
  margin: 0;
}

.product-spec-table-wrap th,
.product-spec-table-wrap td {
  padding-left: 9px;
  padding-right: 9px;
  font-size: 14px;
}

.product-spec-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef8f2;
}

.product-spec-table-wrap thead th:last-child,
.product-spec-table-wrap tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 92px;
  background: #ffffff;
  box-shadow: -8px 0 14px rgba(31, 47, 39, 0.08);
}

.product-spec-table-wrap thead th:last-child {
  z-index: 3;
  background: #eef8f2;
}

.region-selected-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-selected-list b {
  color: #b84225;
  font-size: 12px;
}

.region-column > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #26382d;
  font-weight: 1000;
}

.region-column small {
  color: #718178;
}

.region-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.region-list > button,
.region-choice-row > button:first-child {
  display: grid;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  overflow: hidden;
  color: #2c3b32;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 5px;
}

.region-choice-row > button:first-child span,
.region-list > button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-choice-row.active > button:first-child,
.region-list > button.active {
  border-color: #2f8f5b;
  background: #eaf8ef;
  color: #176339;
}

.region-choice-row.is-selected > button:first-child,
.region-list > button.is-selected {
  border-color: #1f74c9;
  background: #eef7ff;
  color: #155a9c;
}

.region-choice-row > button:last-child {
  height: 34px;
  padding: 0;
  color: #236640;
  font-size: 12px;
}

.region-choice-row.is-selected > button:last-child {
  border-color: #1f74c9;
  background: #eef7ff;
  color: #155a9c;
}

.region-town-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  align-items: center;
  gap: 5px;
}

.region-town-row > button:first-child {
  display: grid;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  overflow: hidden;
  color: #2c3b32;
  text-align: left;
}

.region-town-row > button:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-town-row.active > button:first-child {
  border-color: #2f8f5b;
  background: #eaf8ef;
  color: #176339;
}

.region-town-row.is-selected > button:first-child {
  border-color: #1f74c9;
  background: #eef7ff;
  color: #155a9c;
}

.region-town-row > button:not(:first-child),
.region-village-row button {
  width: 30px;
  height: 28px;
  padding: 0;
  font-size: 12px;
}

.region-town-row > button:nth-child(2) {
  width: 30px;
  height: 28px;
  color: #236640;
}

.region-town-row.is-selected > button:nth-child(2) {
  border-color: #1f74c9;
  background: #eef7ff;
  color: #155a9c;
}

.region-town-row [data-delete-region-street],
.region-village-row [data-delete-region-village] {
  border-color: #f2b8aa;
  background: #fff4f1;
  color: #b84225;
}

.region-empty {
  padding: 12px;
  border: 1px dashed #cbdad1;
  border-radius: 8px;
  color: #78877f;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.region-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 6px;
}

.region-add-row input {
  min-width: 0;
  padding: 0 8px;
}

.region-village-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid #e1ece5;
  border-radius: 8px;
  background: #fbfefc;
  font-weight: 900;
}

.region-village-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.face-capture-panel button {
  min-width: 132px;
  min-height: 42px;
  border: 1px solid #2d86c9;
  border-radius: 8px;
  background: #e8f4ff;
  color: #1768a8;
  cursor: pointer;
  font-weight: 900;
}

.face-camera-card {
  width: min(860px, 100%);
}

.face-camera-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.face-video-box {
  overflow: hidden;
  border: 1px solid #a9cdec;
  border-radius: 8px;
  background: #101820;
  aspect-ratio: 4 / 3;
}

.face-video-box video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.face-camera-side {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d7e5f0;
  border-radius: 8px;
  background: #f3f9ff;
}

.face-camera-side strong {
  color: #1768a8;
  font-size: 20px;
  line-height: 1.35;
}

.face-camera-side small {
  color: var(--muted);
  line-height: 1.6;
}

.face-camera-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.face-camera-actions button {
  min-height: 42px;
}

.accounts-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.accounts-grid .module-action {
  min-height: 112px;
  padding: 18px;
  font-size: 22px;
}

.accounts-grid .module-action:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.accounts-grid .module-action:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.accounts-grid .module-action:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.accounts-grid .module-action:nth-child(4) {
  grid-column: 1;
  grid-row: 3;
}

.accounts-grid .module-action:nth-child(5) {
  grid-column: 2;
  grid-row: 3;
}

.accounts-grid .module-action:nth-child(6) {
  grid-column: 3;
  grid-row: 3;
}

.account-section-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.account-section-grid .module-action {
  min-height: 92px;
  padding: 14px;
  font-size: 20px;
}

.work-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(31, 47, 39, 0.04);
}

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

.form-preview label {
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
  font-weight: 800;
}

.form-preview span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

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

.quick-action {
  min-height: 98px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(31, 47, 39, 0.04);
}

.quick-action:hover {
  border-color: #b9d4c3;
  box-shadow: 0 8px 20px rgba(31, 47, 39, 0.08);
}

.quick-action.hot {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.quick-action span {
  display: block;
  font-size: 20px;
  font-weight: 800;
}

.quick-action small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
}

.quick-action.hot small {
  color: #dff2e6;
}

.logic-page .topbar {
  align-items: flex-start;
}

.logic-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.logic-hero article,
.logic-card,
.logic-model-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(31, 47, 39, 0.04);
}

.logic-hero article {
  min-height: 134px;
  padding: 18px;
}

.logic-hero span,
.logic-hero strong,
.logic-hero p {
  display: block;
}

.logic-hero span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.logic-hero strong {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.1;
}

.logic-hero p,
.logic-card p,
.logic-model-grid p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.logic-section {
  margin-top: 18px;
}

.logic-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.logic-card,
.logic-model-grid article {
  padding: 16px;
}

.logic-card h4,
.logic-model-grid h4 {
  margin: 0;
  font-size: 18px;
}

.logic-table {
  min-width: 1120px;
}

.logic-table td:nth-child(2),
.logic-table td:nth-child(3),
.logic-table td:nth-child(4) {
  white-space: normal;
  line-height: 1.5;
}

.logic-model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.logic-section.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.print-customer-header {
  display: none;
}

.print-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
}

.print-company-line {
  display: none;
}

@media print {
  body {
    min-width: 0;
    background: #ffffff;
  }

  .app-shell,
  .condition-modal,
  .doc-modal-heading button,
  .document-result-actions,
  .doc-internal-section {
    display: none !important;
  }

  .doc-modal[hidden] {
    display: none !important;
  }

  .doc-modal {
    position: static;
    display: block;
    padding: 0;
    background: #ffffff;
  }

  .doc-modal-card {
    width: 100%;
    max-height: none;
    padding: 0;
    box-shadow: none;
  }

  .doc-modal-heading {
    display: none;
  }

  .print-customer-header {
    display: block;
    border-bottom: 2px solid #222;
    padding-bottom: 14px;
    margin-bottom: 16px;
    color: #111;
  }

  .print-customer-header h1 {
    margin: 0;
    text-align: center;
    font-size: 24px;
  }

  .print-customer-header p {
    margin: 6px 0 14px;
    text-align: center;
    color: #444;
  }

  .print-company-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-bottom: 12px;
    color: #222;
    font-size: 13px;
  }

  .print-summary-grid span {
    font-size: 13px;
  }

  .doc-detail-grid {
    display: none;
  }

  .doc-detail-section h3 {
    font-size: 16px;
    margin: 12px 0 0;
  }

  th,
  td {
    color: #111;
  }

  .print-sign-section {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 28px;
    color: #111;
    font-size: 14px;
  }
}

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

.metric-card,
.table-panel,
.reminder-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(31, 47, 39, 0.04);
}

.metric-card {
  min-height: 128px;
  padding: 18px;
}

.metric-card p {
  color: var(--muted);
  font-size: 14px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.1;
}

.metric-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.metric-card.warning {
  background: var(--warning-bg);
  border-color: #f0d59d;
}

.metric-card.warning strong {
  color: var(--warning);
}

.metric-card.danger {
  background: var(--danger-bg);
  border-color: #f1bbb6;
}

.metric-card.danger strong {
  color: var(--danger);
}

.list-section {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 14px;
}

.table-panel,
.reminder-panel {
  padding: 18px;
}

table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.status {
  display: inline-block;
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.status.paid {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status.unpaid {
  background: var(--warning-bg);
  color: var(--warning);
}

.status.overdue {
  background: var(--danger-bg);
  color: var(--danger);
}

.status.due-soon {
  background: var(--warning-bg);
  color: var(--warning);
}

.overdue-panel {
  border-color: #f0d59d;
  background: #fffdf8;
}

.reminder-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.reminder-item {
  padding: 13px 14px;
  border-radius: 8px;
  background: #f7faf6;
  border: 1px solid var(--line);
}

.reminder-item strong,
.reminder-item span {
  display: block;
}

.reminder-item strong {
  font-size: 15px;
}

.reminder-item span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    padding-bottom: 12px;
  }

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

  .workspace {
    padding: 18px;
  }

  .opening-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar,
  .section-heading,
  .list-section {
    display: block;
  }

  .top-actions {
    margin-top: 14px;
  }

  .home-nav,
  .home-stats,
  .owner-summary,
  .dashboard-grid.two-columns,
  .dashboard-grid.three-columns {
    grid-template-columns: 1fr;
  }

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

  .reminder-panel {
    margin-top: 14px;
  }
}

.login-body {
  min-width: 0;
  min-height: 100vh;
  background: #eef4ed;
  color: var(--ink);
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(360px, 440px);
  gap: 26px;
  align-items: center;
  min-height: 100vh;
  padding: 34px;
}

.login-brand-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-height: 650px;
  padding: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #1b3528 url("assets/login-agri-hero.png") center / cover no-repeat;
  color: #ffffff;
  box-shadow: 0 22px 56px rgba(31, 47, 39, 0.18);
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(16, 34, 25, 0.78) 0%, rgba(16, 34, 25, 0.56) 42%, rgba(16, 34, 25, 0.14) 100%);
  pointer-events: none;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  pointer-events: none;
}

.login-brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #dfece4;
  font-size: 16px;
  font-weight: 900;
}

.login-logo {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 8px;
  background: #f3c95f;
  color: #243327;
  font-size: 32px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(10, 18, 12, 0.18);
}

.login-brand-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 760px;
}

.login-brand-panel h1 {
  margin: 0;
  text-shadow: 0 8px 24px rgba(9, 20, 14, 0.3);
  font-size: 82px;
  line-height: 1;
  letter-spacing: 0;
}

.login-product-name {
  margin: 18px 0 0;
  color: #ffffff;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.2;
}

.login-slogan {
  margin: 22px 0 0;
  color: #f3c95f;
  font-size: 31px;
  font-weight: 900;
  line-height: 1.3;
  text-shadow: 0 6px 18px rgba(9, 20, 14, 0.28);
}

.login-feature-copy {
  max-width: 600px;
  margin: 20px 0 0;
  color: #eef7ef;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.65;
}

.login-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.login-points span {
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 44, 31, 0.72);
  backdrop-filter: blur(8px);
  color: #edf7ef;
  font-size: 15px;
  font-weight: 800;
}

.login-preview-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.login-preview-strip div {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(18, 40, 28, 0.72);
  backdrop-filter: blur(8px);
}

.login-preview-strip b {
  color: #c8d9cc;
  font-size: 14px;
  line-height: 1.2;
}

.login-preview-strip strong {
  color: #ffffff;
  font-size: 24px;
  line-height: 1.1;
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border: 1px solid #d4e3d9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(31, 47, 39, 0.12);
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: #2f8f5b;
}

.login-card-heading p {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
}

.login-card-heading h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.login-card-heading span {
  display: block;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-value-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.login-value-list span {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 6px 8px;
  border: 1px solid #d8e8df;
  border-radius: 8px;
  background: #f3faf6;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  line-height: 1.25;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 91, 0.12);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.remember-me {
  display: flex !important;
  grid-template-columns: auto;
  align-items: center;
  gap: 8px !important;
  font-weight: 400 !important;
}

.login-row a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.login-submit {
  height: 52px;
  border: 0;
  border-radius: 8px;
  background: #237a4b;
  color: #ffffff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(35, 122, 75, 0.2);
}

.login-submit:hover {
  background: #1f6d43;
}

.login-message {
  margin: 0;
  color: #5f6f66;
  font-size: 13px;
  line-height: 1.6;
}

.login-help {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: #fbfdf9;
  color: var(--muted);
  font-size: 14px;
}

.login-help strong {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .login-page {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
    gap: 18px;
    padding: 24px;
  }

  .login-brand-panel {
    min-height: 620px;
    padding: 34px;
  }

  .login-brand-panel h1 {
    font-size: 62px;
  }

  .login-product-name {
    font-size: 30px;
  }

  .login-slogan {
    font-size: 25px;
  }

  .login-feature-copy {
    font-size: 16px;
  }

  .login-points {
    gap: 8px;
  }

  .login-points span {
    padding: 8px 10px;
    font-size: 13px;
  }

  .login-preview-strip strong {
    font-size: 20px;
  }
}

.opening-banner[hidden] {
  display: none;
}

.opening-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 2px solid #d83f31;
  border-left-width: 7px;
  border-radius: 8px;
  background: #fff0ee;
  color: #8f2118;
}

.opening-banner strong,
.opening-banner span {
  display: block;
}

.opening-banner strong {
  font-size: 18px;
  font-weight: 1000;
}

.opening-banner span {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.opening-banner-link,
.opening-banner button,
.opening-footer button {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  padding: 0 16px;
  border: 1px solid #d83f31;
  border-radius: 8px;
  background: #ffffff;
  color: #8f2118;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.opening-banner-link,
.opening-footer .opening-confirm {
  border-color: #d83f31;
  background: #d83f31;
  color: #ffffff;
}

.opening-body {
  min-width: 0;
  background: var(--page);
}

.opening-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.opening-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.opening-header a {
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
}

.opening-brand {
  padding: 0;
  border-bottom: 0;
  color: var(--ink);
}

.opening-brand p {
  color: var(--muted);
}

.opening-hero,
.opening-section,
.opening-footer {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.opening-hero h2 {
  margin: 4px 0 0;
  font-size: 30px;
}

.opening-hero p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.opening-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.opening-step {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.opening-step.done {
  background: var(--accent-soft);
  border-color: #b9d4c3;
}

.opening-step strong,
.opening-step span {
  display: block;
}

.opening-step span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.opening-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.opening-repeat {
  display: grid;
  gap: 12px;
}

.opening-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf9;
}

.opening-add-row {
  margin-top: 12px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 900;
}

.opening-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.opening-link-grid a {
  display: grid;
  min-height: 72px;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.opening-link-grid a:hover {
  border-color: var(--accent);
  background: #dff1e7;
}

.opening-form-grid.compact {
  grid-template-columns: 1fr;
}

.opening-form-grid label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.opening-form-grid input,
.opening-form-grid select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.opening-section.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.opening-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .login-brand-panel {
    min-height: 480px;
    padding: 32px;
  }

  .login-brand-panel h1 {
    font-size: 46px;
  }

  .login-product-name {
    font-size: 26px;
  }

  .login-slogan {
    font-size: 24px;
  }

  .login-preview-strip {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 26px;
  }

  .opening-steps,
  .opening-link-grid,
  .opening-form-grid,
  .opening-section.two-columns {
    grid-template-columns: 1fr;
  }
}
