:root {
  --ink: #182026;
  --muted: #66717b;
  --line: #d9dee5;
  --panel: #ffffff;
  --page: #f2f2f2;
  --nav: #1e9fff;
  --nav-2: #24b8e8;
  --teal: #1e9fff;
  --teal-dark: #147ce5;
  --theme-soft: #eaf5ff;
  --sidebar-width: 90px;
  --green: #34815e;
  --amber: #bf7d16;
  --red: #b84a48;
  --blue: #3b6e91;
  --violet: #67588a;
  --shadow: 0 18px 45px rgba(17, 32, 38, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f2f2f2;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 13px;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 20;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  color: #fff;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand {
  height: 79px;
  display: grid;
  place-items: center;
  align-content: start;
  gap: 1px;
  padding: 7px 2px 4px;
}

.brand-logo {
  width: 84px;
  max-height: 44px;
  display: block;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.brand-erp-badge {
  min-width: 46px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #ef2029;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  font-family: "Arial Black", "DIN Alternate", "Helvetica Neue", sans-serif;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-rendering: geometricprecision;
}

.sidebar .brand-mark {
  width: 54px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
  border: 0;
  font-size: 43px;
  line-height: 1;
}

.sidebar .brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar .brand-subtitle {
  min-height: 18px;
  padding: 1px 8px;
  border-radius: 99px;
  background: #fff;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.main-nav {
  display: grid;
  gap: 0;
}

.nav-item {
  width: 100%;
  min-height: 59px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 17px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  text-align: left;
  flex-direction: row;
  position: relative;
  font-size: 16px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: 0;
}

.nav-item.active,
.nav-item.menu-open {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
}

.nav-item.active::after,
.nav-item.menu-open::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  margin-top: -8px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #fff;
}

.nav-item.menu-open .nav-icon {
  transform: translateX(1px);
}

.nav-icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.sidebar-card {
  margin-top: auto;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  text-align: center;
}

.sidebar-card-title {
  font-size: 12px;
  color: #b7c4c1;
}

.deadline {
  margin: 6px 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  color: #f3f7f6;
}

.workspace {
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 0;
  min-height: 100vh;
}

.topbar {
  height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 0;
  padding: 0 12px 0 22px;
  background: #fff;
  border-bottom: 1px solid #e6e9ee;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 42px;
  min-width: 0;
}

.top-refresh,
.company-switch,
.top-link {
  border: 0;
  background: transparent;
  color: #333;
  min-height: 30px;
  padding: 0 6px;
}

.top-refresh {
  width: 32px;
  font-size: 20px;
  color: #2e3b43;
}

.company-switch {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.top-divider,
.expire-text {
  color: #4c5963;
  font-size: 13px;
}

.global-search-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.work-tabs {
  height: 38px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  background: #fff;
  border-bottom: 1px solid #e5e9ef;
}

.work-tab-list {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.work-tab {
  min-width: 138px;
  max-width: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-top: 2px solid transparent;
  border-right: 1px solid #e5e9ef;
  color: #222;
  font-weight: 700;
  font-size: 14px;
}

.work-tab.active {
  border-top-color: #20262c;
  background: #fff;
}

.work-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-tab button {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #a2aab2;
}

.work-tab-tools {
  width: 58px;
  border: 0;
  border-left: 1px solid #e5e9ef;
  background: #fff;
  display: grid;
  place-items: center;
  color: #66717b;
}

.work-tab-nav,
.work-tab-home {
  width: 42px;
  border: 0;
  border-right: 1px solid #e5e9ef;
  background: #fff;
  display: grid;
  place-items: center;
  color: #66717b;
  font-size: 16px;
  font-weight: 700;
}

.work-tab-nav:hover,
.work-tab-home:hover,
.work-tab-tools:hover {
  background: #f7f9fc;
  color: var(--teal);
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
  min-width: 0;
  height: 42px;
}

.top-link {
  font-size: 13px;
  white-space: nowrap;
}

.search-box {
  width: min(360px, 32vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.search-box span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--teal-dark);
  border: 1px solid #bedbd6;
  font-size: 12px;
  font-weight: 800;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.operator {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.operator span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #17302f;
  color: #fff;
  font-weight: 800;
}

.view {
  display: grid;
  gap: 12px;
  padding: 12px;
  overflow-x: hidden;
}

.view > *,
.sales-layout,
.sales-stage,
.sales-form-shell,
.sales-report-shell {
  min-width: 0;
}

.home-page {
  display: grid;
  grid-template-columns: minmax(0, 5fr) 210px;
  gap: 0;
  align-items: start;
  color: #333;
}

.home-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.home-card {
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 2px;
}

.home-card-title {
  height: 43px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  border-bottom: 1px solid #eef1f4;
  color: #333;
  font-size: 14px;
  font-weight: 700;
}

.home-sales-cards {
  height: 92px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border: 1px solid #e6e9ef;
}

.home-sales-card {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 0 20px;
  border-right: 1px solid #edf0f4;
  color: inherit;
  text-decoration: none;
}

.home-sales-card:last-child {
  border-right: 0;
}

.home-sales-card p {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.home-sales-card strong {
  font-size: 22px;
  font-weight: 500;
  color: #222;
}

.home-sales-card span {
  font-size: 12px;
  color: #999;
}

.home-sales-card em {
  color: #999;
  font-style: normal;
}

.quick-operation {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 266px;
  overflow: hidden;
}

.home-quick {
  min-height: 133px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 0;
  border-right: 1px solid #edf0f4;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  color: #333;
}

.home-quick:hover {
  background: #f7fbff;
}

.home-quick i {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.home-quick.sale i,
.home-quick.receivable i {
  background: var(--teal);
}

.home-quick.purchase i,
.home-quick.payable i {
  background: #58bd62;
}

.home-quick.stock i,
.home-quick.supplier i {
  background: #ff9f40;
}

.home-quick.product i,
.home-quick.customer i {
  background: #7b8cff;
}

.home-quick span {
  font-size: 16px;
}

.nums-overview {
  min-height: 110px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  padding: 10px 15px;
}

.home-num {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 0 10px;
  border-right: 1px solid #edf0f4;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.home-num:last-child {
  border-right: 0;
}

.home-num strong {
  min-height: 24px;
  display: block;
  color: #333;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  word-break: break-word;
}

.home-num span {
  color: #888;
}

.data-overview {
  min-height: 293px;
}

.overview-chart {
  display: grid;
  gap: 18px;
  padding: 24px 30px;
}

.overview-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 120px;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}

.overview-row div {
  height: 12px;
  border-radius: 99px;
  background: #edf1f5;
  overflow: hidden;
}

.overview-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.overview-row strong {
  text-align: right;
  font-weight: 500;
}

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

.asset-card,
.cashflow-card {
  min-height: 283px;
}

.asset-total {
  display: grid;
  gap: 8px;
  padding: 18px 35px 8px;
}

.asset-total span {
  color: #999;
}

.asset-total em {
  margin-left: 2px;
  color: #999;
  font-size: 12px;
  font-style: normal;
}

.asset-total strong {
  font-size: 22px;
  font-weight: 500;
}

.asset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px 35px 20px;
}

.asset-line {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #f0f2f5;
}

.asset-line span {
  color: #999;
}

.asset-line strong {
  font-weight: 500;
}

.cashflow-lines {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 18px;
  padding: 28px 34px 36px;
}

.cashflow-lines span {
  position: relative;
  display: block;
  min-height: 22px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--teal), #78c5ff);
}

.cashflow-lines b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -25px;
  color: #999;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
}

.home-side {
  display: grid;
  gap: 15px;
  padding-left: 7px;
}

.side-card {
  min-height: 107px;
}

.side-card p {
  padding: 10px 15px 0;
  color: #666;
  line-height: 1.65;
}

.side-card .button,
.side-card .ghost-button {
  margin: 10px 15px 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reference-toolbar {
  align-items: center;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  color: var(--ink);
  font-size: 13px;
}

.reference-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.reference-filter-row.compact {
  max-width: 420px;
}

.reference-filter-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.reference-filter-row input {
  min-width: 190px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 8px;
  color: var(--ink);
}

.master-thumb,
.master-thumb-placeholder {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f8fafc;
  color: var(--teal);
  font-weight: 800;
  object-fit: cover;
}

.reference-master-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
}

.reference-category-tree {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 260px;
  padding: 10px;
}

.category-tree-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.category-node {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.category-node.active,
.category-node:hover {
  background: var(--theme-soft);
  color: var(--teal);
}

.account-summary-band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #ffd9a8;
  background: #fff8ed;
  color: #7a4b00;
}

.goods-class-page {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 320px;
  gap: 12px;
}

.goods-class-tree,
.goods-class-form {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.goods-class-root {
  margin-bottom: 8px;
  font-weight: 800;
}

.goods-class-node {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 8px 6px 22px;
  border-bottom: 1px solid #f1f5f9;
}

.goods-class-actions {
  display: inline-flex;
  gap: 6px;
}

.goods-class-form {
  display: grid;
  gap: 10px;
  align-content: start;
}

.goods-class-form h3 {
  margin: 0;
}

.goods-class-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.goods-class-form input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 8px;
}

.compact-strip {
  align-items: stretch;
  max-width: none;
}

.compact-strip .category-node {
  width: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.active-soft {
  border-color: var(--teal);
  background: var(--theme-soft);
  color: var(--teal);
}

.report-filter-toolbar {
  justify-content: flex-end;
}

.report-chart-panel {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 130px;
  margin-top: 10px;
}

.mini-bars span {
  width: 28px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
}

@media (max-width: 980px) {
  .reference-master-layout,
  .goods-class-page {
    grid-template-columns: 1fr;
  }
}

.settings-tip {
  margin-bottom: 8px;
  color: #ff7a00;
  font-size: 13px;
  line-height: 1.7;
}

.attribute-page,
.customer-grade-page {
  display: grid;
  gap: 12px;
}

.attribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.attribute-block {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 12px;
}

.attribute-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.attribute-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attribute-values em {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 4px 8px;
  font-style: normal;
  background: #f8fafc;
}

.link-button {
  border: 0;
  min-height: auto;
  padding: 0 4px;
  background: transparent;
  color: var(--teal);
}

.danger-link {
  color: #d84242;
}

.customer-grade-config,
.customer-grade-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.customer-grade-hint {
  color: var(--muted);
  margin: 0;
}

.inline-table-input {
  width: 100%;
  min-width: 90px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 8px;
}

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

.discount-inline .inline-table-input {
  width: 80px;
}

.table-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.customer-grade-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.button,
.icon-button,
.ghost-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: 15px;
  min-height: 30px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  line-height: 1;
}

.button {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--teal);
  background: var(--theme-soft);
  color: var(--teal);
}

.icon-button {
  min-width: 30px;
  padding: 0 8px;
}

.danger-button {
  color: var(--red);
}

.danger-button:hover {
  border-color: #d9a5a3;
  background: #fff4f3;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #dde6e4;
  border-radius: 8px;
}

.feature-tabs {
  max-width: 100%;
  overflow-x: auto;
  justify-content: flex-start;
}

.feature-tabs .tab-button {
  white-space: nowrap;
}

.tab-button {
  min-height: 32px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #526068;
  padding: 0 12px;
  font-weight: 700;
}

.tab-button.active {
  background: #fff;
  color: var(--teal);
  box-shadow: 0 1px 8px rgba(28, 43, 48, 0.08);
}

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

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

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

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

.panel,
.metric,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(20, 31, 36, 0.03);
}

.panel {
  padding: 16px;
}

.metric {
  min-height: 112px;
  padding: 16px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.metric-foot {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.split-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.table-panel {
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.compact-table table {
  min-width: 520px;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f1;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 13px;
}

th {
  color: #526068;
  background: #f7f9f9;
  font-size: 12px;
  font-weight: 800;
}

tbody tr:hover {
  background: #fbfdfc;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.draft {
  background: #eef2f2;
  color: #5d6971;
}

.status.pending {
  background: #fff0d7;
  color: #8b5c10;
}

.status.approved,
.status.done,
.status.enabled {
  background: #e0f1e8;
  color: #226b4d;
}

.status.warning {
  background: #ffe6e1;
  color: #a23e36;
}

.status.route {
  background: #e1eef5;
  color: #315f80;
}

.flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 8px;
}

.flow-step {
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-index {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #17302f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.flow-step strong {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.flow-step span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 52px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 99px;
  background: #e8eeee;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.bar-fill.amber {
  background: var(--amber);
}

.bar-fill.blue {
  background: var(--blue);
}

.bar-fill.red {
  background: var(--red);
}

.kpi-list {
  display: grid;
  gap: 8px;
}

.kpi-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f1;
}

.kpi-item:last-child {
  border-bottom: 0;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  color: #526068;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.filter-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 8px 10px;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.12);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 30, 35, 0.34);
}

.modal {
  width: min(760px, 100%);
  max-height: min(86vh, 780px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-form {
  padding: 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  grid-column: 1 / -1;
  padding-top: 6px;
}

.confirm-box {
  display: grid;
  gap: 16px;
}

.confirm-box p {
  padding: 12px;
  border: 1px solid #f0c6c1;
  border-radius: 8px;
  background: #fff7f5;
  color: #7a322d;
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #17302f;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 32, 37, 0.92), rgba(15, 48, 47, 0.9)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 16px);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.login-card .brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.login-card .button {
  min-height: 42px;
}

.login-hint {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
}

.inventory-card {
  display: grid;
  gap: 10px;
}

.sales-layout {
  position: relative;
  display: block;
}

#module-menu-root {
  position: relative;
  z-index: 45;
}

.sales-menu-popover {
  position: fixed;
  left: var(--sidebar-width);
  top: 104px;
  z-index: 45;
  width: 174px;
  animation: menu-pop 140ms ease-out;
}

.module-menu-shield {
  position: fixed;
  inset: 0 0 0 var(--sidebar-width);
  z-index: 24;
  border: 0;
  background: rgba(12, 22, 30, 0.03);
  cursor: default;
}

.module-menu-popover.wide {
  width: 360px;
}

.sales-menu-panel {
  position: relative;
  background: #fff;
  border: 1px solid #dfe5e7;
  box-shadow: 0 12px 30px rgba(18, 31, 38, 0.16);
  border-radius: 4px;
  overflow: hidden;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}

.module-menu-panel.wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  align-items: start;
}

.module-menu-group {
  min-width: 0;
  border-right: 1px solid #edf1f1;
}

.module-menu-group:last-child {
  border-right: 0;
}

.sales-menu-title {
  height: 42px;
  display: grid;
  place-items: center;
  border-top: 3px solid var(--teal);
  border-bottom: 1px solid #edf1f1;
  font-weight: 800;
}

.sales-menu-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  min-height: 34px;
  padding: 3px 9px;
}

.sales-menu-row:hover {
  background: var(--theme-soft);
}

.sales-menu-row.active .sales-menu-link {
  color: #ff5722;
  font-weight: 800;
}

.sales-menu-link,
.sales-menu-more {
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
  font-weight: 600;
  min-height: 28px;
}

.sales-menu-report {
  min-height: 24px;
  border: 0;
  border-radius: 4px;
  background: #58bd62;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sales-menu-group {
  padding: 8px 12px 4px;
  text-align: center;
  font-weight: 800;
}

.sales-menu-more {
  width: 100%;
  padding: 12px;
  text-align: center;
}

@keyframes menu-pop {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sales-stage {
  min-width: 0;
}

.sales-form-shell,
.sales-report-shell,
.document-form-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.sales-form-shell,
.document-form-shell {
  padding: 12px;
  width: 100%;
}

.sales-page-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #e7ecec;
  background: #fbfcfc;
}

.sales-page-head h2 {
  font-size: 16px;
}

.sales-subtabs,
.sales-report-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: #e9eef0;
  border-radius: 7px;
}

.sales-subtabs button,
.sales-report-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 12px;
  background: transparent;
  color: #526068;
  font-weight: 800;
}

.sales-subtabs button.active,
.sales-report-tabs button.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 1px 7px rgba(27, 39, 45, 0.09);
}

.sales-report-tabs {
  margin: 12px 14px 0;
}

.sales-form-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 51px;
  padding: 10px 0;
  border-bottom: 0;
}

.sales-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sales-bill-title {
  min-width: 78px;
  font-size: 15px;
}

.sales-price-mode,
.radio-pill {
  color: #526068;
  font-size: 13px;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sales-basic-grid {
  display: grid;
  grid-template-columns: minmax(360px, 5fr) minmax(190px, 2fr) minmax(190px, 2fr) 300px;
  gap: 3px;
  padding: 5px 0 8px;
  border-bottom: 0;
}

.sales-basic-grid label,
.sales-left-form label,
.sales-settle-form label,
.sales-settle-row label,
.sales-remark-row label {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
}

.sales-basic-grid span,
.sales-left-form span,
.sales-settle-form span,
.sales-settle-row label > span,
.sales-remark-row label > span {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: #f8faf9;
  color: #526068;
  font-size: 13px;
  font-weight: 700;
}

.sales-basic-grid input,
.sales-basic-grid select,
.sales-left-form input,
.sales-left-form select,
.sales-settle-form input,
.sales-settle-form select,
.sales-settle-row input,
.sales-settle-row select,
.sales-remark-row input {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: #fff;
}

.sales-mini-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 38px;
}

.sales-mini-actions .ghost-button {
  min-height: 34px;
  padding: 0 10px;
}

.sales-delivery {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 8px;
  align-items: center;
  border: 0 !important;
  justify-content: flex-end;
  min-height: 38px;
}

.invoice-check {
  min-height: auto !important;
  display: inline-flex !important;
  place-items: initial !important;
  align-items: center;
  gap: 5px;
  border: 0 !important;
  background: transparent !important;
  color: #333 !important;
  font-weight: 400 !important;
}

.mini-green {
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  background: #4caf62;
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
}

.sales-expand-link {
  border: 0;
  background: transparent;
  color: #8a949a;
  font-weight: 700;
}

.sales-delivery-panel {
  display: grid;
  grid-template-columns: 210px 220px minmax(260px, 1fr) 190px 220px auto;
  gap: 6px;
  align-items: center;
  padding: 6px 0 10px;
}

.sales-delivery-panel label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: #fff;
}

.sales-delivery-panel label.wide {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sales-delivery-panel span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: #f8faf9;
  color: #526068;
  font-size: 13px;
  font-weight: 700;
}

.sales-delivery-panel input,
.sales-delivery-panel select {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 0;
  padding: 0 10px;
  outline: 0;
}

.sales-table-wrap {
  width: 100%;
  max-height: 371px;
  overflow: auto;
  border: 1px solid #dfe4e5;
}

.sales-entry-table {
  min-width: 1220px;
  border-collapse: collapse;
}

.sales-entry-table th,
.sales-entry-table td {
  border: 1px solid #dfe4e5;
  padding: 0;
  height: 39px;
}

.sales-entry-table th {
  text-align: center;
  background: #f6f6f6;
  color: #333;
  font-size: 13px;
}

.sales-entry-table input {
  width: 100%;
  height: 39px;
  border: 0;
  outline: 0;
  padding: 0 8px;
  background: transparent;
}

.gear-cell,
.line-index {
  width: 40px;
  text-align: center;
}

.line-tools {
  width: 64px;
  text-align: center;
  white-space: nowrap;
}

.line-tools button {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  line-height: 18px;
}

.line-tools button:first-of-type {
  background: #31c989;
}

.line-tools button:last-of-type {
  background: #ff5c57;
}

.sales-total-label {
  text-align: center;
  color: var(--teal-dark);
  font-weight: 800;
}

.sales-bottom-panel {
  display: grid;
  gap: 6px;
  padding-top: 12px;
}

.sales-settle-row {
  display: grid;
  gap: 6px;
  align-items: center;
}

.sales-settle-row.top {
  grid-template-columns: minmax(188px, 200px) minmax(168px, 180px) minmax(168px, 180px) minmax(280px, 380px);
  justify-content: end;
}

.sales-settle-row.summary {
  grid-template-columns: 300px minmax(0, 692px);
  justify-content: space-between;
}

.discount-type {
  grid-template-columns: 110px minmax(0, 1fr) 48px !important;
}

.discount-type button {
  border: 0;
  border-left: 1px solid var(--line);
  background: #f8faf9;
  color: var(--teal);
  font-weight: 800;
}

.account-field {
  grid-template-columns: 110px minmax(0, 1fr) !important;
}

.owner-field {
  grid-template-columns: 110px minmax(0, 1fr) !important;
}

.sales-left-form,
.sales-settle-form {
  display: grid;
  gap: 8px;
  align-content: start;
}

.sales-settle-form {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  align-items: center;
}

.sales-total {
  text-align: right;
  font-weight: 800;
}

.sales-total strong {
  font-size: 18px;
}

.print-check {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 6px;
  border: 0 !important;
  align-items: center;
  justify-content: flex-end;
  min-width: 110px;
}

.sales-save-bottom {
  min-height: 50px;
  width: 380px;
}

.sales-summary-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 38px;
  white-space: nowrap;
}

.sales-summary-strip b {
  color: #111;
}

.sales-summary-strip label {
  width: 180px;
  grid-template-columns: 78px minmax(0, 1fr) !important;
}

.sales-remark-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 380px;
  gap: 0;
  align-items: center;
  min-height: 50px;
}

.sales-remark-row label {
  grid-template-columns: 110px minmax(0, 1fr) !important;
  min-height: 50px;
}

.sales-remark-row label span,
.sales-remark-row label input {
  min-height: 50px;
}

.sales-upload-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 95px;
  padding-top: 10px;
  color: #8a949a;
  font-size: 12px;
}

.upload-box {
  width: 80px;
  min-height: 80px;
  border: 1px dashed #d9e0e2;
  background: #fff;
  color: #8a949a;
  font-size: 15px;
}

.sales-list-shell {
  padding: 0 18px 12px;
}

.sales-list-shell .sales-report-tabs {
  margin: 0;
  padding: 0;
  height: 40px;
  background: transparent;
  border-radius: 0;
}

.sales-list-shell .sales-report-tabs button {
  min-width: 74px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}

.sales-list-shell .sales-report-tabs button.active {
  color: var(--teal);
  box-shadow: none;
  border-bottom-color: var(--teal);
}

.sales-list-toolbar {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
}

.sales-list-actions,
.sales-list-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sales-list-filter label {
  display: grid;
  grid-template-columns: 62px 260px;
  align-items: center;
  border: 1px solid var(--line);
}

.sales-list-filter label span {
  min-height: 36px;
  display: grid;
  place-items: center;
  background: #f7f7f7;
  border-right: 1px solid var(--line);
}

.sales-list-filter .filter-input {
  border: 0;
  border-radius: 0;
}

.sales-advanced-filter {
  display: grid;
  grid-template-columns: 190px minmax(260px, 1fr) 180px 160px 160px auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: #fbfcfc;
}

.sales-advanced-filter label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
}

.sales-advanced-filter label span {
  min-height: 34px;
  display: grid;
  place-items: center;
  background: #f7f7f7;
  border-right: 1px solid var(--line);
  color: #526068;
  font-size: 12px;
  font-weight: 700;
}

.sales-advanced-filter input,
.sales-advanced-filter select {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 0;
  outline: 0;
  padding: 0 8px;
  background: #fff;
}

.document-basic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 8px;
  padding: 8px 0 12px;
}

.document-basic-grid label {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: #fff;
}

.document-basic-grid label.wide {
  grid-column: span 2;
}

.document-basic-grid span {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: #f8faf9;
  color: #526068;
  font-size: 13px;
  font-weight: 700;
}

.document-basic-grid input,
.document-basic-grid select {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: #fff;
}

.document-line-panel {
  border: 1px solid var(--line);
  margin-top: 2px;
}

.document-line-panel .table-header {
  border-bottom: 1px solid var(--line);
}

.document-lines {
  width: 100%;
  min-width: 760px;
}

.document-settlement-panel {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  padding: 12px 0 4px;
  border-bottom: 1px solid var(--line);
}

.document-settlement-panel label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.document-settlement-panel span {
  color: var(--muted);
  font-size: 12px;
}

.document-settlement-panel input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 9px;
  background: #fff;
}

.document-settlement-panel input:disabled {
  background: #f7f9fa;
  color: #34404a;
}

.line-actions {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.line-actions button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  line-height: 20px;
}

.line-actions button:first-child {
  background: #35c978;
}

.line-actions button:last-child {
  background: #ff5b55;
}

.document-form-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}

.document-total {
  color: #172027;
  font-weight: 700;
}

.document-total strong {
  color: #111;
  font-size: 17px;
}

.quick-action-list {
  display: grid;
  gap: 10px;
  padding: 4px 0 12px;
}

.sales-list-shell .table-panel {
  border-radius: 0;
  box-shadow: none;
}

.sales-list-shell th:first-child,
.sales-list-shell td:first-child {
  width: 38px;
  text-align: center;
}

.sales-row-check,
[data-sales-select-all],
[data-feature-select-all],
[data-master-select-all] {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
}

.master-advanced-filter {
  grid-template-columns: 190px minmax(260px, 1fr) 160px 240px auto auto;
}

.system-page {
  display: grid;
  gap: 12px;
}

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

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

.system-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.system-config-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}

.system-config-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.system-value-row strong {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  word-break: break-word;
}

.system-setting-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.system-setting-row:last-child {
  margin-bottom: 0;
}

.system-setting-row > span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: #f8faf9;
  color: #526068;
  font-size: 12px;
  font-weight: 700;
}

.system-setting-row > input,
.system-setting-row > select,
.system-setting-row > textarea {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: #fff;
}

.system-setting-row textarea {
  min-height: 74px;
  padding-top: 9px;
  resize: vertical;
}

.system-setting-row.textarea-row {
  align-items: stretch;
}

.system-setting-row.switch-row {
  grid-template-columns: 1fr 58px;
}

.system-setting-row.switch-row > span {
  justify-content: start;
  place-items: center start;
  padding-left: 12px;
}

.system-setting-row.switch-row > input {
  width: 18px;
  min-height: 18px;
  justify-self: center;
  accent-color: var(--teal);
}

.theme-setting-row {
  align-items: stretch;
}

.theme-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px;
  background: #fff;
}

.theme-swatch-option {
  position: relative;
}

.theme-swatch-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: auto;
  min-height: 0;
}

.theme-swatch-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: #33404a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.theme-swatch-chip i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--swatch-a), var(--swatch-b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.theme-swatch-option input:checked + .theme-swatch-chip {
  border-color: var(--teal);
  background: var(--theme-soft);
  color: var(--teal);
}

.system-action-row,
.system-inline-action {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.system-inline-action {
  grid-template-columns: minmax(0, 1fr) auto;
}

.sales-pager {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 0;
  padding: 0 10px;
  background: #fff;
  color: #555;
  font-size: 13px;
}

.sales-pager input {
  width: 42px;
  height: 28px;
  margin: 0 4px;
  border: 1px solid var(--line);
  text-align: center;
}

.sales-pager button,
.sales-pager select {
  min-height: 28px;
  border: 1px solid var(--line);
  background: #fff;
}

.stock-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f1;
}

.stock-line:last-child {
  border-bottom: 0;
}

.mobile-menu-hint {
  display: none;
}

.print-template-page .toolbar {
  align-items: flex-start;
}

.print-template-page .toolbar-right {
  gap: 8px;
  justify-content: flex-end;
  max-width: 980px;
}

.print-template-page .toolbar-right select {
  min-width: 112px;
}

.print-template-check {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.print-template-check input {
  margin: 0;
}

.print-template-page .row-actions {
  min-width: 260px;
}

.print-designer {
  display: grid;
  gap: 14px;
}

.print-designer-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(260px, 0.72fr);
  gap: 14px;
}

.print-designer-control,
.print-designer-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.print-designer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.print-designer .field.full textarea {
  min-height: 210px;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

.print-preview-paper {
  min-height: 306px;
  border: 1px solid #cdd7e2;
  border-radius: 4px;
  background: #fbfdff;
  box-shadow: inset 0 0 0 8px #fff;
  padding: 18px;
}

.print-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #aeb9c6;
  color: var(--muted);
  font-size: 13px;
}

.print-preview-paper pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

.system-bottom-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
}

.compact-date {
  max-width: 132px;
}

@media (max-width: 1100px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: repeat(4, minmax(96px, 1fr));
  }

  .home-page {
    grid-template-columns: 1fr;
  }

  .home-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-left: 0;
  }

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

  .sales-menu-popover {
    left: var(--sidebar-width);
    top: 104px;
  }

  .sales-basic-grid,
  .sales-delivery-panel,
  .sales-advanced-filter,
  .document-settlement-panel,
  .sales-settle-row.top,
  .sales-settle-row.summary,
  .sales-remark-row {
    grid-template-columns: 1fr;
  }

  .sales-summary-strip,
  .sales-list-filter {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

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

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 0;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand > div:not(.brand-mark),
  .nav-item span:last-child {
    display: block;
  }

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

  .nav-item {
    min-height: 62px;
    flex-direction: column;
    justify-content: center;
    font-size: 12px;
  }

  .workspace {
    margin-left: 0;
    padding: 0;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding: 8px 12px;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
  }

  .search-box {
    width: 100%;
  }

  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .home-sales-cards,
  .quick-operation,
  .home-bottom-grid,
  .home-side {
    grid-template-columns: 1fr;
  }

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

  .flow {
    grid-template-columns: 1fr;
  }

  .sales-menu-popover {
    position: static;
    width: 100%;
    margin-bottom: 12px;
  }

  .sales-page-head,
  .sales-form-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-subtabs,
  .sales-report-tabs {
    width: 100%;
  }

  .sales-subtabs button,
  .sales-report-tabs button {
    flex: 1;
  }

  .sales-save-bottom {
    width: 100%;
  }

  .sales-summary-strip {
    display: grid;
    gap: 8px;
  }

  .sales-summary-strip label,
  .sales-list-filter label {
    width: 100%;
    grid-template-columns: 90px minmax(0, 1fr) !important;
  }

table {
  min-width: 760px;
}
}

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

.auth-resource-block,
.field-setting-modal .field.full {
  grid-column: 1 / -1;
}

.auth-resource-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

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

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

.permission-resource-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.permission-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.permission-scope-summary {
  color: var(--primary);
  display: inline-block;
  max-width: 340px;
  white-space: normal;
}

.number-rule-modal .field.full {
  grid-column: 1 / -1;
}

.number-rule-options {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px 12px;
}

.number-rule-options label {
  align-items: center;
  display: flex;
  gap: 6px;
}

.auth-resource-options label,
.auth-resource-title label {
  align-items: center;
  display: flex;
  gap: 6px;
}

.settings-mini-table {
  width: 100%;
}

.settings-mini-table textarea {
  min-height: 42px;
  resize: vertical;
  width: 100%;
}

.settings-mini-table button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  height: 28px;
  margin-right: 4px;
  min-width: 28px;
}

@media (max-width: 820px) {
  .print-designer-grid {
    grid-template-columns: 1fr;
  }

  .print-designer-bar .ghost-button,
  .print-designer-bar .button {
    flex: 1 1 82px;
  }
}
