:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #f7faf5;
  --text: #061b16;
  --muted: #61716d;
  --line: #d7dfda;
  --primary: #11745f;
  --primary-strong: #0a5d4d;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c2410c;
  --green: #15803d;
  --sidebar: #13231b;
  --sidebar-soft: #2d3c33;
  --sidebar-expanded-width: 260px;
  --sidebar-collapsed-width: 76px;
  --cream: #ffd166;
  --shadow: 0 18px 50px rgba(37, 52, 44, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--sidebar);
}

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

.login-card h1 {
  margin: 4px 0 0;
  font-size: 26px;
}

.login-card p {
  margin: 0 0 6px;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 6px;
  color: #405469;
  font-size: 14px;
}

.login-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  outline: 0;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-expanded-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .18s ease;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--sidebar);
  color: #eff7ef;
  padding: 24px 18px;
  width: var(--sidebar-expanded-width);
  transition: width .18s ease, padding .18s ease, box-shadow .18s ease;
  z-index: 12;
}

.brand {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  min-height: 42px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--cream);
  color: #102016;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.brand p {
  margin: 5px 0 0;
  color: #d5e4d8;
  font-size: 13px;
}

.sidebar-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #e2eee4;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.sidebar-toggle span {
  font-size: 22px;
  line-height: 1;
}

.module-nav {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.module-nav::-webkit-scrollbar {
  width: 6px;
}

.module-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #e2eee4;
  text-align: left;
  padding: 12px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.nav-btn.dragging {
  opacity: .48;
}

.nav-btn:hover,
.nav-btn.active {
  color: #fff;
  border-color: rgba(255, 255, 255, .14);
  background: var(--sidebar-soft);
}

.nav-icon {
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  color: #d9efe2;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.user-side-card {
  padding: 14px;
}

.side-card span {
  font-size: 13px;
}

.side-card strong {
  font-size: 34px;
  line-height: 1;
}

.side-card-btn {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
}

.side-user-readonly {
  display: grid;
  gap: 4px;
}

.side-user-readonly span,
.side-user-readonly em {
  color: #d5e4d8;
  font-size: 12px;
  font-style: normal;
}

.side-user-readonly strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.workspace {
  min-width: 0;
  padding: 28px 28px 46px;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

body.sidebar-collapsed .side-nav {
  width: var(--sidebar-collapsed-width);
  padding: 24px 12px;
  overflow: visible;
}

body.sidebar-collapsed .side-nav:hover {
  width: var(--sidebar-expanded-width);
  padding: 24px 18px;
  box-shadow: 18px 0 42px rgba(6, 27, 22, .18);
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand > div:not(.brand-mark),
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .side-card {
  display: none;
}

body.sidebar-collapsed .side-nav:hover .brand > div:not(.brand-mark),
body.sidebar-collapsed .side-nav:hover .nav-label,
body.sidebar-collapsed .side-nav:hover .side-card {
  display: grid;
}

body.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

body.sidebar-collapsed .sidebar-toggle span {
  font-size: 16px;
}

body.sidebar-collapsed .side-nav:hover .sidebar-toggle {
  position: static;
  width: 34px;
  height: 34px;
}

body.sidebar-collapsed .side-nav:hover .sidebar-toggle span {
  font-size: 22px;
}

body.sidebar-collapsed .nav-btn {
  justify-content: center;
  min-height: 44px;
  padding: 10px 0;
}

body.sidebar-collapsed .side-nav:hover .nav-btn {
  justify-content: flex-start;
  padding: 12px 13px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
}

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

.display-scale {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.display-scale span {
  font-size: 13px;
  white-space: nowrap;
}

.display-scale select {
  min-width: 74px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

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

.user-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.user-switch span {
  white-space: nowrap;
  font-size: 13px;
}

.user-switch select {
  min-width: 132px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.user-side-card .user-switch {
  width: 100%;
  height: auto;
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d5e4d8;
}

.user-side-card .user-switch select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

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

.btn,
.icon-btn {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.btn {
  padding: 0 16px;
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

.btn.secondary:hover,
.icon-btn:hover {
  border-color: #b8c7d2;
  background: #f4f8fa;
}

.icon-btn {
  width: 42px;
  font-size: 24px;
}

.notice-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #c4dfd4;
  border-radius: 8px;
  background: #e4f1ea;
  color: #164e48;
}

.tab-bar {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin: -4px 0 18px;
  padding: 0 0 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.work-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 108px;
  max-width: 188px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

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

.work-tab b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: var(--muted);
  font-style: normal;
  font-size: 15px;
  line-height: 1;
}

.work-tab b:hover {
  background: #f1e5df;
  color: var(--red);
}

.work-tab.active {
  position: relative;
  margin-bottom: -1px;
  background: var(--panel);
  color: var(--primary);
  border-bottom-color: var(--panel);
  font-weight: 800;
}

.notice-band strong {
  display: block;
  margin-bottom: 4px;
}

.notice-band span {
  color: #42665f;
  font-size: 13px;
}

.route-crumbs {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-weight: 800;
}

.route-crumbs b {
  color: var(--primary);
}

.route-crumbs i {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

.kpi-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.kpi-filter-title {
  display: grid;
  gap: 3px;
}

.kpi-filter-title strong {
  color: var(--ink);
  font-size: 16px;
}

.kpi-filter-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.kpi-filter-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi-filter-actions input {
  min-height: 36px;
  max-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 6px 9px;
  font: inherit;
}

.kpi-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.kpi-hero h3 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.kpi-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.kpi-score {
  min-width: 168px;
  padding: 16px;
  border: 1px solid #c4dfd4;
  border-radius: 8px;
  background: #e4f1ea;
  text-align: center;
}

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

.kpi-score strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-strong);
  font-size: 34px;
}

.kpi-currency-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  min-width: min(620px, 100%);
  max-width: 760px;
}

.kpi-currency-card {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid #c4dfd4;
  border-radius: 8px;
  background: #e4f1ea;
}

.kpi-currency-card span,
.kpi-currency-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.kpi-currency-card strong {
  color: var(--primary-strong);
  font-size: 22px;
}

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

.metric-grid.kpi-metrics {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.metric {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

.metric.compact {
  min-height: 96px;
}

.metric.compact strong {
  font-size: 28px;
}

.metric span {
  color: var(--muted);
  font-size: 14px;
}

.metric-sub {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.metric-sub span {
  display: block;
  line-height: 1.35;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr);
  gap: 18px;
}

.dashboard-grid.three {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) minmax(280px, 1fr);
}

.dashboard-widget-layout {
  display: grid;
  gap: 18px;
}

.dashboard-widget {
  display: grid;
  gap: 8px;
  transition: transform .16s ease, opacity .16s ease;
}

.dashboard-widget.dragging {
  opacity: .58;
}

.dashboard-widget.drag-over {
  transform: translateY(2px);
}

.dashboard-drag-handle {
  justify-self: start;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: grab;
}

.dashboard-drag-handle:active {
  cursor: grabbing;
}

.dashboard-drag-handle span {
  color: var(--primary);
  letter-spacing: -3px;
}

.order-performance-panel {
  margin-top: 0;
}

.order-performance-grid {
  padding: 16px;
  box-shadow: none;
}

.currency-summary-list {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.currency-summary-item {
  display: grid;
  grid-template-columns: 70px repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.monthly-order-panel {
  margin-top: 0;
}

.monthly-order-head h3,
.monthly-order-head p {
  margin: 0;
}

.monthly-order-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.year-select {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.year-select select {
  height: 38px;
  min-width: 104px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.monthly-order-summary {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #f4f8f5);
}

.monthly-order-summary div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.monthly-order-summary span {
  color: var(--muted);
  font-size: 12px;
}

.monthly-order-summary strong {
  font-size: 22px;
}

.monthly-order-chart-v2 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 280px;
  padding: 20px 16px 18px;
}

.monthly-order-column {
  display: grid;
  grid-template-rows: minmax(170px, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.monthly-order-bar-v2 {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 170px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f2f7f4, #e8f1ed);
  overflow: hidden;
}

.monthly-order-bar-v2::before {
  content: "";
  position: absolute;
  inset: 33.33% 0 auto;
  height: 1px;
  background: rgba(19, 35, 27, .08);
  box-shadow: 0 56px 0 rgba(19, 35, 27, .08);
}

.monthly-order-bar-v2 i {
  position: relative;
  z-index: 1;
  display: block;
  width: 54%;
  min-height: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #24a77e, #0f766e);
  box-shadow: 0 10px 22px rgba(15, 118, 110, .22);
}

.monthly-order-column strong {
  font-size: 13px;
}

.monthly-order-column span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.flow-list,
.recent-list,
.status-list,
.lifecycle-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.flow-item,
.recent-item,
.status-item,
.lifecycle-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.flow-top,
.recent-top,
.status-top,
.lifecycle-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  padding: 16px;
  overflow-x: auto;
}

.pipeline-step {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.pipeline-step strong {
  font-size: 26px;
}

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

.bar {
  height: 8px;
  border-radius: 999px;
  background: #e5edf1;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--primary);
}

.kpi-chart,
.ranking-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.kpi-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 2fr) 42px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.kpi-bar-row strong,
.kpi-bar-row span {
  display: block;
}

.kpi-bar-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-bar-row b {
  text-align: right;
}

.ranking-item {
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) minmax(84px, auto) minmax(110px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ranking-item > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #dcefed;
  color: var(--primary-strong);
  font-weight: 800;
}

.kpi-style-scroller {
  display: flex;
  gap: 14px;
  padding: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.kpi-style-scroller::-webkit-scrollbar {
  height: 8px;
}

.kpi-style-scroller::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c4dfd4;
}

.kpi-style-card {
  flex: 0 0 min(360px, 82vw);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faf8 100%);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.kpi-style-card:hover {
  transform: translateY(-2px);
  border-color: #9dd5c1;
  box-shadow: 0 18px 34px rgba(15, 59, 47, .12);
}

.kpi-style-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.kpi-style-top strong,
.kpi-style-top span {
  display: block;
}

.kpi-style-top strong {
  color: var(--ink);
  font-size: 20px;
}

.kpi-style-top span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.kpi-style-meta > div {
  min-height: 72px;
  padding: 11px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.kpi-style-meta span,
.kpi-style-foot span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kpi-style-meta strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-style-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.kpi-style-empty {
  padding: 16px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.status-dot.amber { background: var(--amber); }
.status-dot.red { background: var(--red); }
.status-dot.blue { background: var(--blue); }

.lifecycle-item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.lifecycle-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #dcefed;
  color: #0f5d56;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8eef3;
  color: #294459;
  font-size: 12px;
  white-space: nowrap;
}

.badge.green { background: #dcfce7; color: var(--green); }
.badge.blue { background: #dbeafe; color: var(--blue); }
.badge.amber { background: #fef3c7; color: var(--amber); }
.badge.red { background: #ffedd5; color: var(--red); }

.requirement-qty {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  font-weight: 800;
  white-space: nowrap;
}

.requirement-qty sup {
  color: var(--amber);
  font-size: 13px;
  line-height: 1;
  transform: translateY(-3px);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  justify-content: flex-end;
}

.filter-bar select {
  min-width: 180px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quick-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: auto;
}

.order-search-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(520px, 100%);
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.order-search-group input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.order-search-group .btn {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
}

.order-search-group .text-btn {
  white-space: nowrap;
}

.order-sort-group {
  display: flex;
  gap: 8px;
}

.order-sort-group select:first-child {
  min-width: 150px;
}

.order-sort-group select:last-child {
  min-width: 92px;
}

.quick-filter {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.quick-filter.active,
.quick-filter:hover {
  border-color: #b8d7ca;
  background: #e7f2ed;
  color: var(--primary-strong);
}

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

.list-pager {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.list-pager > div {
  display: flex;
  gap: 8px;
}

.list-pager .btn {
  min-height: 34px;
  padding: 0 12px;
}

.exception-center {
  grid-column: 1 / -1;
  min-width: 0;
}

.exception-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.exception-summary > div {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.exception-summary strong {
  font-size: 24px;
}

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

.exception-table {
  min-width: 960px;
}

.exception-table td:nth-child(4) {
  min-width: 320px;
  white-space: normal;
}

.record-card {
  display: grid;
  gap: 12px;
  min-height: 162px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.record-card.clickable-card {
  cursor: pointer;
}

.record-card.clickable-card:hover {
  border-color: #b8d7ca;
  box-shadow: 0 16px 34px rgba(23, 56, 45, .13);
}

.customer-value-card {
  border-top: 4px solid #9eb8ad;
}

.customer-value-card.healthy {
  border-top-color: var(--green);
}

.customer-value-card.attention {
  border-top-color: var(--amber);
}

.customer-value-card.danger {
  border-top-color: var(--red);
}

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

.customer-money-row.single {
  grid-template-columns: 1fr;
}

.customer-money-row > div,
.customer-stat-grid > div,
.customer-detail-kpi > div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.customer-money-row span,
.customer-stat-grid span,
.customer-detail-kpi span {
  color: var(--muted);
  font-size: 12px;
}

.customer-money-row strong {
  color: var(--primary-strong);
  font-size: 18px;
}

.customer-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.customer-stat-grid strong {
  font-size: 20px;
}

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

.customer-detail-kpi strong {
  font-size: 20px;
}

.record-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.record-card h3 {
  margin: 0;
  font-size: 18px;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-money {
  color: #455b54;
}

.record-track {
  display: grid;
  gap: 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.record-track.text-only {
  color: #455b54;
}

.record-track-bar {
  height: 24px;
  border-radius: 999px;
  background: #fff0e9;
  overflow: hidden;
}

.record-track-bar i {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: #ffd8c9;
}

.sample-track,
.quotation-track,
.feedback-track,
.order-track {
  gap: 8px;
}

.progress-track-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.progress-track-head b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sample-track .record-track-bar,
.quotation-track .record-track-bar,
.feedback-track .record-track-bar,
.order-track .record-track-bar {
  height: 12px;
  background: #eef2f0;
}

.sample-pending {
  color: #8a5b12;
}

.sample-pending .record-track-bar {
  background: #fff6df;
}

.sample-pending .record-track-bar i {
  background: #f5c35b;
}

.sample-making {
  color: #0f5d56;
}

.sample-making .record-track-bar {
  background: #e2f3ee;
}

.sample-making .record-track-bar i {
  background: #34a58e;
}

.sample-sent {
  color: #1d4ed8;
}

.feedback-pending {
  color: #8a5b12;
}

.feedback-pending .record-track-bar {
  background: #fff6df;
}

.feedback-pending .record-track-bar i {
  background: #f5c35b;
}

.feedback-processing {
  color: #0f5d56;
}

.feedback-processing .record-track-bar {
  background: #e2f3ee;
}

.feedback-processing .record-track-bar i {
  background: #34a58e;
}

.feedback-replied {
  color: #166534;
}

.feedback-replied .record-track-bar {
  background: #dcfce7;
}

.feedback-replied .record-track-bar i {
  background: #22c55e;
}

.feedback-workflow-card .record-card-head > div:first-child { min-width: 0; }
.feedback-context-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.feedback-content { margin-top: 12px; color: #1f332e; line-height: 1.6; white-space: pre-wrap; }
.feedback-next-action { margin-top: 10px; padding: 9px 12px; border-left: 3px solid #c69337; background: #fff9ec; color: #6d4f18; }
.feedback-routing-hint,
.feedback-workflow-overview,
.feedback-result-box,
.feedback-action-history { padding: 14px; border: 1px solid #dce6e2; background: #f8fbfa; }
.feedback-routing-hint,
.feedback-workflow-overview > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.feedback-routing-hint span,
.feedback-workflow-overview span,
.feedback-result-box span { color: #667872; }
.feedback-workflow-overview > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.feedback-workflow-overview p,
.feedback-result-box p { margin: 10px 0 0; white-space: pre-wrap; line-height: 1.6; }
.feedback-start-row { display: flex; align-items: center; gap: 12px; }
.feedback-waiting-development,
.feedback-waiting-business { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feedback-action-history > div { display: grid; grid-template-columns: 160px minmax(0, 1fr) 100px; gap: 12px; padding-top: 10px; color: #52635e; }
.feedback-action-history em { font-style: normal; text-align: right; }

.sample-sent .record-track-bar {
  background: #dbeafe;
}

.sample-sent .record-track-bar i {
  background: #3b82f6;
}

.sample-confirmed {
  color: var(--green);
}

.sample-confirmed .record-track-bar {
  background: #dcfce7;
}

.sample-confirmed .record-track-bar i {
  background: #22c55e;
}

.sample-revise {
  color: var(--amber);
}

.sample-revise .record-track-bar {
  background: #fef3c7;
}

.sample-revise .record-track-bar i {
  background: #f59e0b;
}

.sample-void {
  color: var(--red);
}

.sample-void .record-track-bar {
  background: #ffedd5;
}

.sample-void .record-track-bar i {
  background: #ef4444;
}

.quote-draft {
  color: #6b7280;
}

.quote-draft .record-track-bar {
  background: #f3f4f6;
}

.quote-draft .record-track-bar i {
  background: #9ca3af;
}

.quote-submitted {
  color: #0f5d56;
}

.quote-submitted .record-track-bar {
  background: #e2f3ee;
}

.quote-submitted .record-track-bar i {
  background: #34a58e;
}

.quote-sent {
  color: #1d4ed8;
}

.quote-sent .record-track-bar {
  background: #dbeafe;
}

.quote-sent .record-track-bar i {
  background: #3b82f6;
}

.quote-accepted {
  color: var(--green);
}

.quote-accepted .record-track-bar {
  background: #dcfce7;
}

.quote-accepted .record-track-bar i {
  background: #22c55e;
}

.quote-rejected,
.quote-void {
  color: var(--red);
}

.quote-rejected .record-track-bar,
.quote-void .record-track-bar {
  background: #ffedd5;
}

.quote-rejected .record-track-bar i,
.quote-void .record-track-bar i {
  background: #ef4444;
}

.order-confirmed {
  color: #1d4ed8;
}

.order-confirmed .record-track-bar {
  background: #dbeafe;
}

.order-confirmed .record-track-bar i {
  background: #3b82f6;
}

.order-partial {
  color: var(--amber);
}

.order-partial .record-track-bar {
  background: #fef3c7;
}

.order-partial .record-track-bar i {
  background: #f59e0b;
}

.order-completed {
  color: var(--green);
}

.order-completed .record-track-bar {
  background: #dcfce7;
}

.order-completed .record-track-bar i {
  background: #22c55e;
}

.order-cancelled {
  color: var(--red);
}

.order-cancelled .record-track-bar {
  background: #ffedd5;
}

.order-cancelled .record-track-bar i {
  background: #ef4444;
}

.quick-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.order-lines-builder {
  display: grid;
  gap: 12px;
}

.quotation-lines-builder,
.quotation-lines-list {
  display: grid;
  gap: 12px;
}

.quotation-currency-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #b8d7ca;
  border-radius: 8px;
  background: #f0f8f4;
}

.quotation-currency-note strong,
.quotation-currency-note b {
  color: var(--primary-strong);
}

.quotation-currency-note span {
  color: var(--muted);
  font-size: 13px;
}

.quotation-line-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.quotation-line-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.quotation-line-head span {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.quotation-line-grid {
  display: grid;
  gap: 10px;
}

.quotation-line-grid.primary {
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, .8fr) minmax(180px, 1.2fr) minmax(80px, .5fr);
}

.quotation-line-grid.secondary {
  grid-template-columns: minmax(240px, 1.7fr) minmax(90px, .55fr) minmax(100px, .65fr) minmax(110px, .75fr) minmax(140px, 1fr);
  align-items: end;
}

.quotation-line-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.quotation-line-grid label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quotation-line-grid textarea {
  min-height: 42px;
}

.order-number-hints {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfe5dd;
  border-radius: 8px;
  background: #f6fbf8;
}

.order-number-hint-title,
.order-number-hint-note,
.order-number-hint-loading,
.order-number-hint-error {
  grid-column: 1 / -1;
}

.order-number-hint-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.order-number-hint-note,
.order-number-hint-loading,
.order-number-hint-error {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-number-hint-error {
  color: var(--red);
}

.order-number-hint-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid #d7e6e0;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.order-number-hint-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(8, 121, 89, 0.1);
}

.order-number-hint-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.order-number-hint-card strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.order-number-hint-card b {
  color: var(--primary-strong);
  font-size: 14px;
}

.order-default-delivery {
  display: flex;
  gap: 14px;
  align-items: end;
  padding: 12px;
  border: 1px solid #cfe5dd;
  border-radius: 8px;
  background: #f0fbf7;
}

.order-default-delivery .field {
  min-width: 220px;
  margin: 0;
}

.order-default-delivery .sub {
  padding-bottom: 10px;
}

.order-lines-list {
  display: grid;
  gap: 12px;
}

.order-total-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #cfe5dd;
  border-radius: 8px;
  background: #f0fbf7;
}

.order-total-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-total-bar strong {
  color: var(--primary-strong);
  font-size: 20px;
}

.order-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.modal.order-change-modal {
  padding: 16px;
}

.modal.order-change-modal .modal-panel {
  width: min(1360px, 100%);
  height: min(900px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
}

.record-form.order-change-form {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 16px;
  padding: 18px 20px 24px;
}

.record-form.order-change-form > * {
  grid-column: 1 / -1;
  min-width: 0;
}

.order-change-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--primary);
  background: var(--panel-soft);
}

.order-change-intro strong {
  flex: 0 0 auto;
}

.order-change-intro span {
  text-align: right;
}

.order-change-intro span,
.order-change-line-title span,
.order-change-replacement-title span,
.order-change-preview-head span,
.order-change-history-row span {
  color: var(--muted);
  font-size: 12px;
}

.order-change-lines,
.order-change-impact-list,
.order-change-history,
.order-change-replacement-list {
  display: grid;
  gap: 10px;
}

.order-change-line,
.order-change-impact,
.order-change-history-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-change-form .order-change-line {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(640px, 2.1fr);
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
}

.order-change-line-title,
.order-change-replacement-title,
.order-change-replacement-head,
.order-change-impact-title,
.order-change-preview-head,
.order-change-history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.order-change-line-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.order-change-line-name,
.order-change-line-name-row {
  min-width: 0;
}

.order-change-line-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-change-line-name-row .order-change-size-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #b9d9ce;
  border-radius: 999px;
  background: #edf8f4;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.order-change-line-title strong,
.order-change-line-title span,
.order-change-replacement-title strong,
.order-change-replacement-title span,
.order-change-preview-head strong,
.order-change-preview-head span,
.order-change-history-row strong,
.order-change-history-row span {
  display: block;
}

.order-change-replacement-section {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.order-change-replacement-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.order-change-replacement {
  padding: 12px;
  border: 1px solid #b9d9ce;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f8fcfa;
}

.order-change-replacement-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.order-change-replacement-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.order-change-replacement-fields label.wide {
  grid-column: span 2;
}

.order-change-replacement-fields span {
  color: var(--muted);
  font-size: 12px;
}

.order-change-line-fields,
.order-change-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.order-change-form .order-change-line-fields {
  margin-top: 0;
}

.order-change-line-fields label {
  min-width: 0;
}

.order-change-line-fields input,
.order-change-replacement-fields input,
.order-change-replacement-fields select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: 0;
}

.order-change-line-fields input:disabled {
  background: #f3f6f4;
  color: #52615d;
  opacity: 1;
}

.order-change-line-fields label:nth-child(2n) input {
  border-color: #83bca9;
  background: #f7fcfa;
  box-shadow: inset 3px 0 0 rgba(17, 116, 95, .18);
}

.order-change-line-fields label:nth-child(2n) span {
  color: var(--primary-strong);
  font-weight: 800;
}

.order-change-line-fields label,
.order-change-impact-grid span {
  display: grid;
  gap: 5px;
}

.order-change-line-fields span,
.order-change-impact-grid span {
  color: var(--muted);
  font-size: 12px;
}

.order-change-impact-grid strong {
  color: var(--ink);
  font-size: 14px;
}

.order-change-preview {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b9d9ce;
  border-radius: 8px;
  background: #f5fbf8;
}

.order-change-impact.has-risk {
  border-color: #e9c985;
  background: #fffaf0;
}

.order-change-impact p,
.order-change-history-row p {
  margin: 8px 0 0;
  color: #8b5c12;
  font-size: 12px;
}

.order-change-impact p.ok {
  color: var(--primary-strong);
}

.order-change-confirm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #b9d9ce;
  border-radius: 8px;
  background: #f5fbf8;
  font-weight: 700;
}

.order-change-confirm input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.order-change-history {
  padding: 12px;
}

.order-change-history-row > div:first-child {
  min-width: 0;
}

.order-change-history-status {
  display: grid;
  justify-items: end;
  gap: 5px;
  flex: 0 0 auto;
}

.sku-detail-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sku-detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sku-detail-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sku-detail-main h5 {
  margin: 0;
  font-size: 16px;
}

.sku-style-link {
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sku-detail-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sku-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.sku-metrics span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.sku-metrics strong {
  color: var(--ink);
  font-size: 16px;
}

.sku-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.sku-progress div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f0;
}

.sku-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #34a58e;
}

.sku-progress b {
  color: var(--primary-strong);
  font-size: 13px;
}

.order-line-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf8f3;
  display: grid;
  gap: 12px;
}

.order-line-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(120px, .7fr) auto;
  gap: 12px;
  align-items: end;
}

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

.size-choice {
  display: grid;
  grid-template-columns: 32px minmax(86px, .8fr) minmax(90px, .6fr) minmax(90px, .6fr) minmax(130px, .8fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.size-choice.selected {
  border-color: #34a58e;
  background: #f0fbf7;
}

.size-choice.dragging {
  opacity: .55;
}

.size-drag-handle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: grab;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.size-drag-handle:active {
  cursor: grabbing;
}

.size-choice > label:not(.size-choice-field) {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.size-choice-field {
  display: grid;
  gap: 4px;
}

.size-choice-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.size-choice-field input {
  width: 100%;
}

.quantity-unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.quantity-unit-input b {
  min-width: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.order-line-subtotal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d8e9e2;
  border-radius: 8px;
  background: #fff;
}

.order-line-subtotal span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.order-line-subtotal strong {
  color: var(--primary-strong);
  font-size: 18px;
}

.workspace-readonly-date {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  white-space: nowrap;
  color: var(--ink);
}

.finance-original-term > div {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #f6f8f7;
  padding: 10px 12px;
}

.finance-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.finance-plan-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, .7fr) minmax(150px, .8fr) auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 760px) {
  .finance-plan-row { grid-template-columns: 1fr; }
  .order-default-delivery,
  .order-line-grid,
  .quotation-currency-note,
  .quotation-line-grid.primary,
  .quotation-line-grid.secondary,
  .size-choice {
    grid-template-columns: 1fr;
    display: grid;
  }

  .order-default-delivery .field {
    min-width: 0;
  }

  .order-default-delivery .sub {
    padding-bottom: 0;
  }
}

.workspace-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.workspace-summary > div,
.workspace-summary > button {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 13px 16px;
  text-align: left;
}

.workspace-summary > button { cursor: pointer; }
.workspace-summary span { display: block; color: var(--muted); }
.workspace-summary strong { display: block; margin-top: 7px; font-size: 24px; }

.workspace-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.workspace-toolbar label { display: grid; gap: 5px; min-width: 220px; color: var(--muted); }
.workspace-toolbar input { height: 40px; border: 1px solid var(--line); padding: 0 10px; }
.workspace-band { border: 1px solid var(--line); background: #fff; margin-bottom: 14px; }
.workspace-band > header { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.workspace-band > header strong, .workspace-band > header span { display: block; }
.workspace-band > header span { margin-top: 3px; color: var(--muted); }
.workspace-band > header b { min-width: 32px; text-align: center; font-size: 18px; }
.workspace-p0 > header { border-left: 5px solid #cf3d3d; background: #fff7f6; }
.workspace-p1 > header { border-left: 5px solid #d4941d; background: #fffaf0; }
.workspace-p2 > header { border-left: 5px solid #247b61; background: #f3faf7; }
.workspace-table-wrap { overflow-x: auto; }
.workspace-table { min-width: 920px; }
.workspace-table th:nth-child(1) { width: 28%; }
.workspace-table th:nth-child(2) { width: 34%; }
.workspace-table input[type="date"] { min-width: 142px; height: 34px; border: 1px solid var(--line); padding: 0 7px; }
.workspace-link { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.workspace-link strong, .workspace-link span { display: block; }
.workspace-link span { margin-top: 4px; color: var(--muted); }

.performance-panel { margin-top: 14px; }
.performance-modules, .incentive-reference { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px; }
.performance-modules > div, .incentive-reference > div { border: 1px solid var(--line); padding: 11px 12px; }
.performance-modules span, .incentive-reference span { display: block; color: var(--muted); }
.performance-modules strong, .incentive-reference strong { display: block; margin-top: 5px; font-size: 18px; }
.performance-reasons { margin: 12px 0; border-top: 1px solid var(--line); }
.performance-reasons button { display: flex; width: 100%; justify-content: space-between; gap: 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 10px 2px; text-align: left; cursor: pointer; }
.performance-reasons button strong { color: #b43d35; }
.performance-trend { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0; padding-bottom: 4px; }
.performance-trend > div { min-width: 100px; border: 1px solid var(--line); padding: 9px 10px; }
.performance-trend span, .performance-trend strong, .performance-trend b { display: block; }
.performance-trend span { color: var(--muted); }
.performance-trend strong { margin-top: 4px; font-size: 18px; }
.performance-trend b { color: var(--primary-strong); font-weight: 600; }
.kpi-process-block { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.process-score-strip { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.process-score-strip > div { border: 1px solid var(--line); padding: 10px 11px; }
.process-score-strip span { display: block; color: var(--muted); }
.process-score-strip strong { display: block; margin-top: 5px; font-size: 18px; }
.process-trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.process-trend-grid h4 { margin: 0 0 8px; font-size: 14px; }
.mini-trend { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mini-trend > div { min-width: 74px; border: 1px solid var(--line); padding: 8px 9px; }
.mini-trend.wide > div { min-width: 82px; }
.mini-trend span, .mini-trend strong { display: block; }
.mini-trend span { color: var(--muted); }
.mini-trend strong { margin-top: 4px; }

@media (max-width: 760px) {
  .workspace-summary { grid-template-columns: repeat(3, 1fr); }
  .workspace-summary > div { grid-column: 1 / -1; }
  .workspace-summary > button { min-width: 0; padding: 10px; }
  .workspace-summary > button strong { font-size: 20px; }
  .workspace-toolbar { align-items: stretch; flex-direction: column; }
  .workspace-toolbar label { min-width: 0; }
  .performance-modules, .incentive-reference, .process-score-strip { grid-template-columns: repeat(2, 1fr); }
  .process-trend-grid { grid-template-columns: 1fr; }
  .workspace-summary > div,
  .workspace-summary > button,
  .workspace-band,
  .workspace-table tbody,
  .workspace-table tr { background: var(--panel); }
  .workspace-p0 > header { background: rgba(207, 61, 61, .12); }
  .workspace-p1 > header { background: rgba(212, 148, 29, .12); }
  .workspace-p2 > header { background: rgba(36, 123, 97, .16); }
  .workspace-table-wrap { overflow: visible; }
  .workspace-table { display: block; min-width: 0; width: 100%; }
  .workspace-table thead { display: none; }
  .workspace-table tbody { display: grid; }
  .workspace-table tr { display: grid; gap: 7px; padding: 12px; border-bottom: 1px solid var(--line); }
  .workspace-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: center; padding: 0; border: 0; }
  .workspace-table td::before { color: var(--muted); font-size: 12px; }
  .workspace-table td:nth-child(1)::before { content: "客户/事项"; }
  .workspace-table td:nth-child(2)::before { content: "下一步动作"; }
  .workspace-table td:nth-child(3)::before { content: "计划日期"; }
  .workspace-table td:nth-child(4)::before { content: "负责人"; }
  .workspace-table td:nth-child(5)::before { content: "操作"; }
  .workspace-table td:nth-child(5) { display: flex; justify-content: flex-end; }
  .workspace-table input[type="date"] { width: 100%; min-width: 0; color: var(--text); background: var(--panel-soft); }
  .workspace-link { color: var(--text); }
}

.quick-status button {
  min-height: 30px;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: #f7faf5;
  color: #315047;
  padding: 4px 10px;
  cursor: pointer;
}

.quick-status button:hover {
  border-color: #b8d7ca;
  background: #e9f5ef;
  color: var(--primary);
}

.master-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
  align-items: start;
}

.master-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  align-self: start;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.master-card[open] {
  border-color: #b8d7ca;
  box-shadow: 0 14px 34px rgba(12, 42, 32, 0.12);
}

.master-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  cursor: pointer;
  list-style: none;
}

.master-card-head::-webkit-details-marker {
  display: none;
}

.master-card h3 {
  margin: 0;
  font-size: 18px;
}

.master-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.master-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.master-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.18s ease;
}

.master-card[open] .master-chevron {
  transform: rotate(180deg);
}

.master-card-body {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.master-add-btn {
  justify-self: start;
}

.master-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.master-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.master-item strong {
  display: block;
  font-size: 15px;
}

.master-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.master-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
}

.permission-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.permission-card-wide {
  grid-column: 1 / -1;
}

.permission-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.permission-card h3 {
  margin: 0;
  font-size: 18px;
}

.permission-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.permission-block {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.check-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.role-matrix {
  display: grid;
  gap: 12px;
}

.role-row {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 2.2fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.role-row strong {
  display: block;
  font-size: 16px;
}

.role-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.notification-settings {
  display: grid;
  grid-column: 1 / -1;
  gap: 14px;
}

.notification-table {
  min-width: 1180px;
}

.notification-table th:nth-child(1),
.notification-table td:nth-child(1) {
  width: 190px;
}

.notification-table th:nth-child(2),
.notification-table td:nth-child(2) {
  width: 280px;
}

.notification-table th:nth-child(4),
.notification-table td:nth-child(4) {
  width: 150px;
}

.notification-table th:nth-child(5),
.notification-table td:nth-child(5) {
  width: 110px;
}

.notification-table input,
.notification-table select,
.notification-table textarea,
.notification-test input,
.notification-test select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.notification-table textarea {
  resize: vertical;
  min-height: 92px;
  margin-top: 8px;
}

.notification-table select + input,
.notification-table input + .notification-user-add {
  margin-top: 8px;
}

.notification-user-add,
.notification-test {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.notification-test {
  grid-template-columns: minmax(180px, .8fr) minmax(180px, 1fr) minmax(260px, 1.4fr) auto;
}

.notification-log-table {
  min-width: 1040px;
}

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

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

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

th {
  position: sticky;
  top: 0;
  background: #f5f9fb;
  color: #475a6e;
  font-weight: 700;
}

td .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.user-table-wrap {
  width: 100%;
}

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

.user-table th,
.user-table td {
  vertical-align: middle;
  white-space: nowrap;
  padding: 11px 12px;
}

.user-table td:first-child strong {
  font-size: 15px;
}

.order-table {
  min-width: 1180px;
}

.order-row {
  cursor: pointer;
}

.order-row:hover {
  background: #f7faf5;
}

.order-row-danger {
  background: #fff7ed;
}

.order-row-warning {
  background: #fffbeb;
}

.order-row-done {
  background: #f0fdf4;
}

.order-row-cancelled {
  opacity: .72;
}

.table-progress {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.table-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.table-progress-head span {
  font-weight: 800;
  color: var(--primary-strong);
}

.table-progress-head b {
  color: var(--muted);
  font-weight: 700;
}

.mini-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0ec;
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.mini-bar.empty i {
  display: none;
}

.mini-bar.partial i {
  background: #0f8b72;
}

.mini-bar.done i {
  background: var(--green);
}

.mini-bar.payment i {
  background: var(--blue);
}

.payment-order-head {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.payment-order-head strong {
  color: var(--ink);
  font-size: 20px;
}

.payment-order-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.payment-summary-card,
.payment-after-grid > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf7;
}

.payment-summary-card span,
.payment-after-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-summary-card strong,
.payment-after-grid strong {
  color: var(--ink);
  font-size: 18px;
}

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

.zero-progress-line {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e8f0ec;
}

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

.text-ok {
  color: var(--green);
}

body[data-active-module="users"] .record-grid {
  display: block;
  width: 100%;
}

body[data-active-module="users"] .table-wrap {
  width: 100%;
}

body[data-active-module="orders"] .record-grid {
  display: block;
  width: 100%;
}

body[data-active-module="orders"] .table-wrap {
  width: 100%;
}

body[data-active-module="customers"] .record-grid,
body[data-active-module="styles"] .record-grid,
body[data-active-module="samples"] .record-grid,
body[data-active-module="sampleDev"] .record-grid,
body[data-active-module="sampleKanban"] .record-grid,
body[data-active-module="activityLogs"] .record-grid,
body[data-active-module="devCosts"] .record-grid,
body[data-active-module="financeReceivables"] .record-grid,
body[data-active-module="materialReadiness"] .record-grid {
  display: block;
  width: 100%;
}

body[data-active-module="customers"] .table-wrap,
body[data-active-module="styles"] .table-wrap,
body[data-active-module="samples"] .table-wrap,
body[data-active-module="sampleDev"] .table-wrap,
body[data-active-module="activityLogs"] .table-wrap,
body[data-active-module="devCosts"] .table-wrap,
body[data-active-module="financeReceivables"] .table-wrap,
body[data-active-module="materialReadiness"] .table-wrap {
  width: 100%;
}

.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.finance-submodule-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.finance-submodule-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.finance-submodule-tab.active,
.finance-submodule-tab:hover {
  border-color: #b8d7ca;
  background: #e7f2ed;
  color: var(--primary-strong);
}

.purchase-workbench {
  display: grid;
  gap: 14px;
}

.purchase-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.purchase-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.purchase-tabs button.active,
.purchase-tabs button:hover {
  border-color: #b8d7ca;
  background: #e7f2ed;
  color: var(--primary-strong);
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sub-tabs button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.sub-tabs button.active,
.sub-tabs button:hover {
  border-color: #b8d7ca;
  background: #e7f2ed;
  color: var(--primary-strong);
}

.sub-inline {
  margin-left: 5px;
  color: inherit;
  font-size: 12px;
  opacity: .72;
}

.purchase-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #f8fbf7, #eef8f2);
}

.purchase-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.purchase-summary-card strong {
  color: var(--primary-strong);
  font-size: 24px;
}

.purchase-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.purchase-table {
  min-width: 1120px;
}

.purchase-table td:first-child strong {
  display: block;
  font-size: 15px;
}

.purchase-line-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.purchase-line-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(110px, .75fr) minmax(100px, .7fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.finance-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #f8fbf7, #eef8f2);
}

.finance-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.finance-summary-card strong {
  color: var(--primary-strong);
  font-size: 24px;
}

.finance-summary-card.compact strong {
  color: var(--ink);
}

.finance-table {
  min-width: 1180px;
}

.finance-payments-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.finance-payment-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.finance-payment-row strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.finance-payment-row span,
.finance-payment-row p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.business-table {
  min-width: 1060px;
}

.business-table th,
.business-table td {
  vertical-align: middle;
  padding: 12px;
}

.business-table th {
  white-space: nowrap;
}

.business-table td:first-child strong {
  font-size: 15px;
}

.customers-table {
  min-width: 1220px;
  table-layout: fixed;
}

.customers-table th:nth-child(1),
.customers-table td:nth-child(1) {
  width: 20%;
}

.customers-table th:nth-child(2),
.customers-table td:nth-child(2) {
  width: 10%;
}

.customers-table th:nth-child(3),
.customers-table td:nth-child(3) {
  width: 12%;
}

.customers-table th:nth-child(4),
.customers-table td:nth-child(4),
.customers-table th:nth-child(5),
.customers-table td:nth-child(5),
.customers-table th:nth-child(6),
.customers-table td:nth-child(6),
.customers-table th:nth-child(7),
.customers-table td:nth-child(7) {
  width: 6%;
  text-align: center;
}

.customers-table th:nth-child(8),
.customers-table td:nth-child(8) {
  width: 12%;
}

.customers-table th:nth-child(9),
.customers-table td:nth-child(9) {
  width: 9%;
  white-space: nowrap;
}

.customers-table th:nth-child(10),
.customers-table td:nth-child(10) {
  width: 19%;
}

.customer-table-row {
  box-shadow: inset 3px 0 0 #9eb8ad;
}

.customer-table-row.healthy {
  box-shadow: inset 3px 0 0 var(--green);
}

.customer-table-row.attention {
  box-shadow: inset 3px 0 0 var(--amber);
}

.customer-table-row.danger {
  box-shadow: inset 3px 0 0 var(--red);
}

.customer-name-cell,
.customer-status-cell,
.customer-table-actions {
  display: grid;
  gap: 6px;
}

.customer-name-cell > span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
}

.customer-name-cell .badge {
  width: fit-content;
}

.customer-table-money {
  color: var(--primary);
  white-space: nowrap;
}

.customer-table-count {
  font-size: 16px;
}

.customer-table-count.attention {
  color: var(--amber);
}

.customer-status-cell {
  justify-items: start;
}

.customer-table-actions .quick-status {
  padding-top: 0;
}

.customer-table-actions .quick-status button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}

.styles-table {
  min-width: 1280px;
  table-layout: fixed;
}

.styles-table th,
.styles-table td {
  padding: 12px 14px;
}

.styles-table th:nth-child(1),
.styles-table td:nth-child(1) {
  width: 21%;
}

.styles-table th:nth-child(2),
.styles-table td:nth-child(2) {
  width: 17%;
}

.styles-table th:nth-child(3),
.styles-table td:nth-child(3) {
  width: 14%;
}

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

.styles-table th:nth-child(5),
.styles-table td:nth-child(5) {
  width: 13%;
}

.styles-table th:nth-child(6),
.styles-table td:nth-child(6) {
  width: 7%;
}

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

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

.style-record-row {
  transition: background .16s ease;
}

.style-record-row:hover {
  background: #fbfdfb;
}

.style-name-cell,
.style-project-cell {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.style-name-cell strong,
.style-project-cell strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.style-name-cell span,
.style-project-cell span,
.style-date-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.style-spec-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.style-spec-cell span {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: #f3f8f5;
  color: #315047;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 10px;
}

.style-file-cell {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.style-file-cell .file-chip {
  max-width: 150px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.style-file-cell .badge {
  min-height: 30px;
  align-items: center;
}

.style-order-ref-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.style-order-ref-cell strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.style-order-ref-cell span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-order-ref-cell.empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.style-status-cell {
  display: flex;
  align-items: center;
}

.styles-table .table-actions {
  flex-wrap: nowrap;
  gap: 10px;
  white-space: nowrap;
}

.styles-table .table-actions .quick-status {
  flex-wrap: nowrap;
}

.styles-table .table-actions .quick-status button {
  min-height: 30px;
  white-space: nowrap;
}

.samples-table {
  min-width: 1280px;
}

.sample-dev-table {
  min-width: 1120px;
}

.activity-logs-table {
  min-width: 1300px;
}

.activity-logs-table th:nth-child(1),
.activity-logs-table td:nth-child(1) {
  width: 160px;
  white-space: nowrap;
}

.activity-logs-table th:nth-child(2),
.activity-logs-table td:nth-child(2) {
  width: 160px;
  white-space: nowrap;
}

.activity-logs-table th:nth-child(3),
.activity-logs-table td:nth-child(3) {
  width: 150px;
}

.activity-logs-table th:nth-child(4),
.activity-logs-table td:nth-child(4),
.activity-logs-table th:nth-child(5),
.activity-logs-table td:nth-child(5),
.activity-logs-table th:nth-child(6),
.activity-logs-table td:nth-child(6) {
  width: 110px;
  white-space: nowrap;
}

.activity-logs-table th:nth-child(7),
.activity-logs-table td:nth-child(7) {
  min-width: 460px;
}

.samples-table th:nth-child(1),
.samples-table td:nth-child(1) {
  width: 170px;
}

.samples-table th:nth-child(2),
.samples-table td:nth-child(2) {
  width: 200px;
}

.samples-table th:nth-child(3),
.samples-table td:nth-child(3),
.samples-table th:nth-child(5),
.samples-table td:nth-child(5),
.samples-table th:nth-child(7),
.samples-table td:nth-child(7),
.samples-table th:nth-child(8),
.samples-table td:nth-child(8) {
  white-space: nowrap;
}

.samples-table th:nth-child(3),
.samples-table td:nth-child(3) {
  width: 96px;
}

.samples-table th:nth-child(4),
.samples-table td:nth-child(4) {
  width: 96px;
}

.samples-table th:nth-child(5),
.samples-table td:nth-child(5) {
  width: 96px;
}

.samples-table th:nth-child(6),
.samples-table td:nth-child(6) {
  width: 82px;
}

.samples-table th:nth-child(7),
.samples-table td:nth-child(7) {
  width: 118px;
}

.samples-table th:nth-child(8),
.samples-table td:nth-child(8) {
  width: 118px;
}

.samples-table th:nth-child(9),
.samples-table td:nth-child(9) {
  width: 148px;
}

.samples-table th:nth-child(10),
.samples-table td:nth-child(10) {
  width: 250px;
}

.sample-dev-table th:nth-child(8),
.sample-dev-table td:nth-child(8) {
  width: 138px;
}

.sample-dev-table th:nth-child(9),
.sample-dev-table td:nth-child(9) {
  width: 260px;
}

.samples-table td {
  height: 76px;
}

.samples-table .table-actions {
  min-width: 228px;
  max-width: 250px;
}

.samples-table .table-actions > .text-btn {
  white-space: nowrap;
  line-height: 1.4;
}

.samples-table .table-actions .quick-status {
  flex-basis: 100%;
}

.samples-table .table-actions .quick-status button {
  white-space: nowrap;
  min-width: 0;
}

.sample-return-reason {
  max-width: 180px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid #f2c6b8;
  border-radius: 8px;
  background: #fff4ef;
  color: #b43c1d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-return-section {
  border-color: #f2c6b8;
  background: #fffaf7;
}

.table-wrap-text {
  max-width: 220px;
  white-space: normal;
  line-height: 1.5;
}

.table-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.samples-table .table-file-list {
  max-width: 126px;
  flex-wrap: nowrap;
}

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

.table-actions .quick-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 0;
}

.table-actions .quick-status button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}

.sample-kanban-entry {
  width: 100%;
}

.sample-kanban-entry .panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.kanban-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}

.kanban-entry-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.kanban-entry-card.dark {
  background: #10231f;
  color: #eef8f4;
}

.kanban-entry-card strong {
  font-size: 20px;
  line-height: 1.35;
}

.kanban-entry-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.kanban-entry-card.dark p {
  color: #bfd4cd;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 37, 50, .52);
  z-index: 20;
}

.modal.modal-on-top {
  z-index: 50;
}

.modal-panel {
  width: min(960px, 100%);
  max-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.modal-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-panel {
  width: min(1180px, 100%);
  height: min(820px, 92vh);
  grid-template-rows: auto minmax(0, 1fr);
}

.detail-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  overscroll-behavior: contain;
}

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

.detail-summary-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.detail-summary-item strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
}

.link-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: visible;
}

.link-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7faf5;
}

.link-section-head h4 {
  margin: 0;
  font-size: 16px;
}

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

.order-remark-box {
  padding: 12px 14px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.order-remark-box.muted {
  color: var(--muted);
}

.material-readiness-page {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.material-readiness-tabs {
  margin-bottom: 0;
}

.material-readiness-main-table {
  min-width: 980px;
}

.material-readiness-card-list,
.material-readiness-detail-cards {
  display: none;
}

.material-readiness-card,
.material-readiness-item-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.material-readiness-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.material-readiness-card-head strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.material-readiness-card-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.material-readiness-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.material-readiness-card-meta > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.material-readiness-card-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.material-readiness-card-meta strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.material-readiness-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.material-readiness-mini {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.material-readiness-mini.empty-state {
  min-width: 120px;
}

.material-readiness-progress {
  display: grid;
  gap: 5px;
  min-width: 130px;
}

.material-readiness-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.material-readiness-progress strong {
  color: var(--green);
  font-size: 13px;
}

.material-readiness-progress i {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 63, 53, .08);
}

.material-readiness-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f8a66, #5bbf8b);
}

.material-readiness-detail {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
}

.material-readiness-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.material-readiness-summary > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.material-readiness-table-wrap {
  overflow-x: auto;
}

.material-readiness-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.material-readiness-table th,
.material-readiness-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.material-readiness-table th {
  color: var(--muted);
  font-size: 12px;
  background: #f7faf5;
}

.link-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
}

.link-item {
  display: grid;
  width: 100%;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.link-item.clickable {
  cursor: pointer;
}

.link-item.clickable:hover {
  border-color: #b8d7ca;
  background: #f7faf5;
}

.link-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.link-item strong {
  font-size: 15px;
}

.readonly-content {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.record-form {
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

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

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

.project-optional-fields {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--panel-soft);
}

.project-optional-fields summary {
  cursor: pointer;
  font-weight: 700;
}

.project-optional-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
}

.project-detail-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.project-detail-history summary {
  cursor: pointer;
  font-weight: 700;
}

.project-detail-history .detail-summary {
  margin-top: 12px;
}

.sample-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 1000px) {
  .sample-mobile-hero {
    display: none;
  }

  .sample-task-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .sample-task-summary .detail-summary-item {
    padding: 9px 11px;
  }
}

.field label {
  color: #405469;
  font-size: 14px;
}

.field-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

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

.multi-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.check-pill input {
  width: auto;
  min-width: auto;
  padding: 0;
}

.relation-search-field {
  position: relative;
}

.relation-search-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 59, 47, .16);
}

.relation-search-menu button {
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.relation-search-menu button:hover {
  border-color: #aadbc9;
  background: #eefaf5;
}

.relation-search-menu strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-search-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.file-upload-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #bfd1ca;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdfc, #f4f9f6);
}

.paste-upload-zone {
  outline: 0;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.paste-upload-zone:focus,
.paste-upload-zone:focus-within {
  border-color: #7cc9af;
  background: #f3fbf7;
  box-shadow: 0 0 0 3px rgba(17, 116, 95, .1);
}

.paste-upload-zone.uploading {
  border-style: dashed;
  border-color: var(--primary);
  background: #eefaf5;
}

.paste-upload-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.file-upload-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #dce5df;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(18, 46, 36, .06);
}

.file-upload-trigger:hover {
  border-color: #a8cbbd;
  background: #f8fcfa;
}

.file-upload-trigger input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-upload-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: #e4f4ed;
  color: var(--primary);
  font-size: 16px;
  line-height: 1;
}

.file-upload-row a,
.file-upload-row span {
  color: var(--muted);
  font-size: 13px;
}

.file-upload-row a {
  color: var(--primary-strong);
  font-weight: 700;
}

.file-upload-column {
  gap: 10px;
}

.file-chip-list,
.followup-files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.followup-reminder-line {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff4cf;
  color: #9a6700;
  font-size: 12px;
  font-weight: 700;
}

.file-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border: 0;
  border-radius: 9px;
  background: #f3f5f4;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(12, 27, 22, .03);
}

.file-chip-wrap {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
}

.file-remove-btn {
  width: 28px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: #f0f2f1;
  color: #697a74;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.file-chip:hover {
  background: #e9f1ee;
}

.file-remove-btn:hover {
  background: #fee2e2;
  color: #b42318;
}

.file-chip span {
  color: inherit;
  font-size: inherit;
}

.file-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manufacturing-template-builder {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.manufacturing-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manufacturing-template-list {
  display: grid;
  gap: 10px;
}

.manufacturing-template-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dde7e2;
  border-radius: 8px;
  background: #fff;
}

.manufacturing-template-grid {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(140px, 1fr) minmax(160px, 1.2fr);
  gap: 10px;
}

.manufacturing-template-grid label {
  display: grid;
  gap: 5px;
}

.manufacturing-template-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manufacturing-template-file {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.file-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #6b7a76;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.file-icon.excel {
  background: #16834a;
}

.file-icon.word {
  background: #1f64c8;
}

.file-icon.pdf {
  background: #d1433f;
}

.file-icon.image {
  background: #7c5cc4;
}

.file-more-btn {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
}

.sample-file-empty {
  color: var(--muted);
}

.sample-file-dropdown-btn {
  display: inline-flex;
  align-items: center;
  max-width: 126px;
  min-height: 32px;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid #e1ebe6;
  border-radius: 8px;
  background: #f6faf8;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(8, 41, 31, 0.04);
}

.sample-file-dropdown-btn:hover {
  border-color: rgba(16, 128, 96, 0.28);
  background: #eef8f3;
}

.sample-file-dropdown-btn .file-icon {
  flex: 0 0 auto;
}

.sample-file-dropdown-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-file-dropdown-btn b {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #2c64c8;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.sample-file-popover {
  position: fixed;
  z-index: 35;
  width: min(320px, calc(100vw - 24px));
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.sample-file-popover-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.sample-file-popover-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sample-file-group {
  display: grid;
  gap: 6px;
}

.sample-file-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-preview-panel {
  width: min(1080px, 96vw);
  height: min(820px, 92vh);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.file-preview-body {
  min-height: 0;
  padding: 12px;
  overflow: auto;
  background: #f6faf8;
}

.file-preview-body iframe {
  width: 100%;
  height: 100%;
  min-height: 620px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.file-preview-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.file-preview-fallback {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 520px;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.file-preview-fallback strong {
  font-size: 22px;
}

.file-preview-fallback p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.readonly-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 10px 11px;
}

.user-role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.role-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.role-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.role-check span {
  line-height: 1.2;
  white-space: nowrap;
}

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

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #102532;
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.toast-long {
  max-width: min(680px, calc(100vw - 44px));
  white-space: pre-wrap;
  line-height: 1.55;
}

.ai-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 18;
  display: none;
}

.ai-toggle {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.ai-toggle span {
  display: grid;
  place-items: center;
}

.ai-panel {
  width: min(390px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ai-assistant.collapsed .ai-panel {
  display: none;
}

.ai-assistant:not(.collapsed) .ai-toggle {
  display: none;
}

.ai-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: #eef7f2;
}

.ai-head strong,
.ai-head span {
  display: block;
}

.ai-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ai-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 13px;
  overflow: auto;
  background: #f7faf5;
}

.ai-message {
  display: grid;
  gap: 4px;
  max-width: 86%;
}

.ai-message.user {
  justify-self: end;
}

.ai-message span {
  color: var(--muted);
  font-size: 11px;
}

.ai-message p {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-message.user p {
  border-color: #bdd9cc;
  background: #dff0e8;
}

.ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.ai-form textarea {
  min-height: 44px;
  max-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  font: inherit;
}

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

.link-list .empty {
  padding: 12px;
}

.hidden {
  display: none !important;
}

.mobile-tab-bar {
  display: none;
}

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

  .side-nav {
    position: static;
    height: auto;
    max-height: 44vh;
    z-index: 10;
  }

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

  .side-card {
    display: none;
  }

	  .dashboard-grid,
	  .dashboard-grid.three,
	  .metric-grid,
	  .metric-grid.kpi-metrics,
	  .customer-detail-kpi,
	  .record-grid {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }

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

  .monthly-order-chart-v2 {
    grid-template-columns: repeat(12, minmax(62px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .top-actions {
    display: grid;
    justify-content: stretch;
  }

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

  .user-switch {
    width: 100%;
  }

  .display-scale {
    display: none;
  }

	  .module-nav,
	  .dashboard-grid,
	  .dashboard-grid.three,
	  .metric-grid,
	  .metric-grid.kpi-metrics,
	  .record-grid,
	  .master-grid,
	  .permission-grid,
	  .customer-money-row,
	  .customer-stat-grid,
	  .customer-detail-kpi,
	  .record-form {
	    grid-template-columns: 1fr;
	  }

	  .kpi-hero,
	  .kpi-bar-row,
	  .ranking-item {
	    grid-template-columns: 1fr;
	  }

	  .kpi-hero {
	    display: grid;
	  }

	  .kpi-bar-row b {
	    text-align: left;
	  }

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

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

  .notice-band {
    grid-template-columns: 1fr;
  }

  .nav-btn {
    padding: 10px;
  }

  .modal {
    padding: 0;
    align-items: stretch;
  }

  .modal-panel {
    max-height: 100vh;
    border-radius: 0;
  }

  .detail-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root {
    --bg: #07110f;
    --panel: #0d1b17;
    --panel-soft: #132822;
    --text: #f4f8f6;
    --muted: #9cafaa;
    --line: rgba(255, 255, 255, .09);
    --primary: #18a77a;
    --primary-strong: #37d399;
    --sidebar: #081411;
    --sidebar-soft: rgba(255, 255, 255, .08);
    --shadow: 0 18px 42px rgba(0, 0, 0, .34);
  }

  body {
    overflow-x: hidden;
    background:
      radial-gradient(circle at 12% -8%, rgba(24, 167, 122, .24), transparent 32%),
      linear-gradient(180deg, #07110f 0%, #081713 46%, #06100e 100%);
  }

  .app-shell {
    display: block;
  }

  .side-nav {
    position: sticky;
    top: 0;
    height: auto;
    max-height: none;
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 12px;
    z-index: 16;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    background: rgba(8, 20, 17, .92);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
    backdrop-filter: blur(14px);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .brand {
    margin: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .brand p {
    margin-top: 2px;
    font-size: 12px;
  }

  .module-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 4px;
    scrollbar-width: none;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    min-width: 0;
  }

  .module-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex: 0 0 auto;
    min-width: 96px;
    padding: 9px 11px;
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    text-align: center;
    white-space: nowrap;
  }

  .nav-btn.active {
    border-color: rgba(55, 211, 153, .42);
    background: rgba(24, 167, 122, .18);
    color: #eafff6;
  }

  .nav-icon {
    width: auto;
    margin-right: 5px;
  }

  .workspace {
    padding: 14px 12px 104px;
  }

  .topbar {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .eyebrow {
    color: #6ee7b7;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .search-box {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .top-actions .btn {
    width: 100%;
    padding: 0 10px;
  }

  #createBtn {
    grid-column: 1 / -1;
    position: fixed;
    right: 16px;
    bottom: 86px;
    z-index: 17;
    width: 58px;
    height: 58px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    border-color: rgba(55, 211, 153, .58);
    background: linear-gradient(135deg, #18a77a, #0f766e);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .42);
    font-size: 0;
  }

  #createBtn::before {
    content: "+";
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
  }

  .mobile-tab-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 19;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 22px;
    background: rgba(9, 23, 19, .92);
    box-shadow: 0 20px 46px rgba(0, 0, 0, .46);
    backdrop-filter: blur(16px);
  }

  .mobile-tab-btn {
    display: grid;
    place-items: center;
    gap: 3px;
    min-width: 0;
    height: 50px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #8aa19b;
    cursor: pointer;
  }

  .mobile-tab-btn span {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-tab-btn b {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab-btn.active {
    background: rgba(24, 167, 122, .2);
    color: #dcfff2;
  }

  .notice-band,
  .dashboard-grid,
  .dashboard-grid.three,
  .metric-grid,
  .metric-grid.kpi-metrics,
  .record-grid,
  .master-grid,
  .permission-grid,
  .customer-money-row,
  .customer-stat-grid,
  .customer-detail-kpi,
  .record-form {
    grid-template-columns: 1fr;
  }

  .currency-summary-item {
    grid-template-columns: 1fr;
  }

  .monthly-order-summary {
    grid-template-columns: 1fr;
  }

  .monthly-order-head {
    align-items: flex-start;
  }

  .year-select {
    width: 100%;
    justify-content: space-between;
  }

  .year-select select {
    min-width: 130px;
  }

  .monthly-order-chart-v2 {
    grid-template-columns: repeat(12, minmax(70px, 1fr));
    overflow-x: auto;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .filter-bar select,
  .order-sort-group,
  .order-search-group,
  .quick-filter-group,
  .quick-filter {
    width: 100%;
    min-width: 0;
  }

  .order-search-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .order-sort-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .order-sort-group select:first-child,
  .order-sort-group select:last-child {
    min-width: 0;
  }

  .quick-filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-right: 0;
  }

  .record-card {
    min-height: 0;
    padding: 14px;
  }

  .panel,
  .metric,
  .record-card,
  .master-card,
  .permission-card,
  .link-section,
  .detail-summary-item,
  .customer-money-row > div,
  .customer-stat-grid > div,
  .customer-detail-kpi > div,
  .status-item,
  .recent-item,
  .flow-item,
  .pipeline-step,
  .ranking-item,
  .file-upload-row,
  .role-check {
    border-color: rgba(255, 255, 255, .09);
    background: rgba(13, 27, 23, .92);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .24);
  }

  .metric {
    border-radius: 18px;
  }

  .metric strong,
  .customer-money-row strong,
  .detail-summary-item strong {
    color: #eafff6;
  }

  .panel,
  .record-card,
  .master-card,
  .permission-card,
  .link-section {
    border-radius: 18px;
  }

  .notice-band {
    display: none;
  }

  .pipeline-step,
  .status-item,
  .recent-item,
  .flow-item,
  .link-item,
  .master-item {
    background: rgba(255, 255, 255, .045);
  }

  .panel-head,
  .link-section-head,
  th {
    background: rgba(255, 255, 255, .045);
  }

  .badge {
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .08);
    color: #d7e7e2;
  }

  .badge.green { background: rgba(55, 211, 153, .17); color: #7cf1bb; }
  .badge.blue { background: rgba(59, 130, 246, .18); color: #9cc4ff; }
  .badge.amber { background: rgba(251, 191, 36, .18); color: #ffd978; }
  .badge.red { background: rgba(239, 68, 68, .18); color: #ff9a9a; }

  .search-box,
  .filter-bar select,
  .field input,
  .field select,
  .field textarea,
  .readonly-field,
  .multi-check-list {
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
  }

  .field input::placeholder,
  .field textarea::placeholder,
  .search-box input::placeholder {
    color: #687b75;
  }

  .btn.secondary,
  .icon-btn {
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
  }

  .quick-status {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .quick-status button {
    flex: 0 0 auto;
  }

  .table-wrap {
    width: 100%;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table,
  .user-table {
    min-width: 760px;
  }

  .workspace-table {
    width: 100%;
    min-width: 0;
  }

  .table-wrap {
    border-color: rgba(255, 255, 255, .09);
    background: rgba(13, 27, 23, .9);
  }

  th,
  td {
    padding: 11px 10px;
    font-size: 13px;
  }

  .modal {
    align-items: end;
    place-items: end stretch;
    padding: 0;
  }

  .modal-panel,
  .detail-panel,
  .file-preview-panel {
    width: 100%;
    height: min(92vh, 100dvh);
    max-height: 100dvh;
    border-radius: 14px 14px 0 0;
    border: 1px solid rgba(255, 255, 255, .1);
    background: #081411;
  }

  .modal-head,
  .modal-actions {
    padding: 12px;
  }

  .modal-head h3 {
    font-size: 18px;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    background: rgba(8, 20, 17, .96);
  }

  .modal-actions .btn {
    flex: 1;
  }

  .record-form {
    gap: 12px;
    padding: 12px;
  }

  .order-number-hints {
    grid-template-columns: 1fr;
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .04);
  }

  .order-number-hint-card {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .1);
  }

  .order-number-hint-card strong,
  .order-number-hint-title {
    color: #f7fffb;
  }

  .field input,
  .field select,
  .field textarea,
  .readonly-field {
    min-height: 44px;
    font-size: 16px;
  }

  .kpi-filter-bar,
  .kpi-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-filter-actions .quick-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-filter-actions label,
  .kpi-filter-actions input,
  .kpi-filter-actions .btn {
    width: 100%;
    max-width: none;
  }

  .payment-summary-grid,
  .payment-after-grid {
    grid-template-columns: 1fr;
  }

  .link-section-head,
  .link-item-top,
  .master-card-head,
  .permission-card-head {
    align-items: flex-start;
  }

  .link-section-actions,
  .master-summary-meta,
  .permission-actions,
  .master-actions {
    flex-wrap: wrap;
  }

  .master-list {
    max-height: 56vh;
  }

  .master-item {
    align-items: flex-start;
  }

  .file-upload-row input {
    max-width: 100%;
  }

  .file-upload-row {
    border-color: rgba(255, 255, 255, .13);
    background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .045));
  }

  .file-upload-trigger {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    box-shadow: none;
  }

  .file-upload-icon {
    background: rgba(55, 211, 153, .14);
    color: #6ee7b7;
  }

  .file-chip {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
  }

  .file-chip:hover {
    background: rgba(55, 211, 153, .13);
  }

  .file-remove-btn {
    background: rgba(255, 255, 255, .08);
    color: #9cafaa;
  }

  .paste-upload-zone:focus,
  .paste-upload-zone:focus-within {
    border-color: rgba(55, 211, 153, .46);
    background: rgba(24, 167, 122, .1);
    box-shadow: 0 0 0 3px rgba(55, 211, 153, .1);
  }

  .paste-upload-zone.uploading {
    border-color: #37d399;
    background: rgba(24, 167, 122, .14);
  }

  .ai-assistant {
    right: 14px;
    bottom: 14px;
  }

  .ai-toggle {
    width: 54px;
    height: 54px;
  }

  .ai-assistant:not(.collapsed) {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .ai-panel {
    width: 100%;
    height: min(70vh, 560px);
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: none;
  }

  .mobile-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(55, 211, 153, .2);
    border-radius: 22px;
    background:
      radial-gradient(circle at top right, rgba(55, 211, 153, .18), transparent 36%),
      linear-gradient(145deg, rgba(24, 167, 122, .16), rgba(13, 27, 23, .96));
    box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
  }

  .mobile-detail-hero strong {
    display: block;
    margin-top: 5px;
    color: #f4fff9;
    font-size: 22px;
    line-height: 1.25;
  }

  .mobile-detail-hero p {
    margin: 7px 0 0;
    color: #9cafaa;
    line-height: 1.55;
  }

  .mobile-detail-kicker {
    color: #6ee7b7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-timeline {
    position: relative;
  }

  .mobile-timeline .status-item {
    position: relative;
    margin-left: 14px;
  }

  .mobile-timeline .status-item::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #37d399;
    box-shadow: 0 0 0 4px rgba(55, 211, 153, .14);
  }
}

.order-docs {
  display: grid;
  gap: 8px;
}

.order-doc-group {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(248, 250, 247, .64);
}

.order-doc-group-head,
.order-doc-style-main,
.order-doc-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-doc-group-head {
  align-items: center;
}

.order-doc-group-head strong,
.order-doc-style-main strong {
  display: block;
  color: var(--text);
}

.order-doc-group-head .sub {
  font-size: 12px;
}

.order-doc-style-list,
.order-doc-files {
  display: grid;
  gap: 4px;
}

.order-doc-style-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(220px, 1.6fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid rgba(28, 63, 53, .1);
  border-radius: 6px;
  background: #fff;
}

.order-doc-style-main {
  justify-content: flex-start;
  min-width: 0;
}

.order-doc-style-main span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.order-doc-file {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(28, 63, 53, .12);
}

.order-doc-file .file-chip span:last-child {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-doc-file:last-child {
  border-bottom: 0;
}

.order-doc-upload-trigger {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.order-doc-style-row .row-actions {
  justify-content: flex-end;
  gap: 8px;
  min-width: 210px;
}

.order-doc-upload-trigger input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.manufacturing-approval {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #b9d8cc;
  border-radius: 8px;
  background: #f5fbf8;
}

.manufacturing-approval-empty {
  padding: 10px 12px;
  border-left: 3px solid #d49b2c;
  background: #fffaf0;
  color: #6b604c;
  font-size: 13px;
}

.manufacturing-approval-head,
.manufacturing-approval-actions,
.manufacturing-approval-item,
.manufacturing-approval-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.manufacturing-approval-head span,
.manufacturing-approval-file > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.manufacturing-approval-actions,
.manufacturing-approval-item-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.manufacturing-approval-notice {
  padding: 8px 10px;
  border-left: 3px solid #cf554d;
  background: #fff3f1;
  color: #8d3934;
  font-size: 13px;
}

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

.manufacturing-approval-item {
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid rgba(28, 63, 53, .12);
  border-radius: 6px;
  background: #fff;
}

.manufacturing-approval-file {
  min-width: 0;
}

.manufacturing-approval-file .file-chip span:nth-child(2) {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manufacturing-published-file {
  display: flex;
  align-items: center;
  gap: 7px;
}

.manufacturing-invalid-file {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8d3934;
}

.manufacturing-published-file > span:last-child {
  margin: 0;
  color: #1f7d5d;
}

.manufacturing-invalid-file > span:last-child {
  margin: 0;
  color: #a03f38;
}

.manufacturing-approval-history {
  border-top: 1px solid rgba(28, 63, 53, .12);
  padding-top: 8px;
}

.manufacturing-approval-history summary {
  color: #1f6f58;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.manufacturing-approval-history-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.manufacturing-approval-history-row {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) minmax(220px, 1.6fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(28, 63, 53, .1);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.manufacturing-approval-history-row > span {
  color: var(--muted);
}

.manufacturing-approval-history-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: #8d3934;
}

.manufacturing-workbench {
  display: grid;
  gap: 12px;
}

.manufacturing-workbench-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.manufacturing-workbench-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.manufacturing-workbench-summary > div:last-child {
  border-right: 0;
}

.manufacturing-workbench-summary span,
.manufacturing-workbench-row span,
.manufacturing-workbench-row small {
  color: var(--muted);
  font-size: 12px;
}

.manufacturing-workbench-summary strong {
  color: var(--ink);
  font-size: 24px;
}

.manufacturing-workbench-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px;
}

.manufacturing-workbench-head span {
  color: var(--muted);
  font-size: 12px;
}

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

.manufacturing-workbench-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(90px, .5fr) minmax(120px, .7fr) minmax(180px, 1fr) minmax(150px, .8fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.manufacturing-workbench-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.manufacturing-workbench-order strong {
  font-size: 16px;
}

.manufacturing-workbench-order span,
.manufacturing-workbench-status small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manufacturing-workbench-status {
  justify-items: start;
}

.manufacturing-approval-file p {
  margin: 5px 0 0;
  color: #a03f38;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .manufacturing-workbench-summary {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
  }

  .manufacturing-workbench-row {
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(120px, .7fr)) auto;
  }

  .manufacturing-workbench-status {
    grid-column: 2 / 5;
  }

  .order-change-form .order-change-line {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }

  .order-change-form .order-change-line-fields {
    margin-top: 0;
  }
}

@media (max-width: 1100px) {
  .order-doc-style-row {
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr);
  }

  .order-doc-style-row .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    min-width: 0;
  }

  .material-readiness-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .modal.order-change-modal {
    padding: 0;
  }

  .modal.order-change-modal .modal-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .record-form.order-change-form {
    gap: 12px;
    padding: 12px;
  }

  .order-change-intro {
    display: grid;
    justify-content: stretch;
    gap: 5px;
    padding: 11px 12px;
    border-color: #37a982;
    background: rgba(255, 255, 255, .05);
  }

  .order-change-intro span {
    text-align: left;
  }

  .order-change-line,
  .order-change-impact,
  .order-change-history-row {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
  }

  .order-change-replacement,
  .order-change-preview,
  .order-change-confirm {
    border-color: rgba(55, 169, 130, .45);
    background: rgba(55, 169, 130, .08);
  }

  .order-change-line-fields input,
  .order-change-replacement-fields input,
  .order-change-replacement-fields select {
    border-color: rgba(255, 255, 255, .16);
    background: #10231d;
    color: #f4f8f6;
  }

  .order-change-line-fields input:disabled {
    background: rgba(255, 255, 255, .06);
    color: #a9bbb4;
  }

  .order-change-line-fields label:nth-child(2n) input {
    border-color: #3da982;
    background: rgba(55, 169, 130, .1);
  }
}

@media (max-width: 720px) {
  .manufacturing-workbench-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .manufacturing-workbench-summary > div {
    min-height: 52px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }

  .manufacturing-workbench-summary > div:nth-child(2n) {
    border-right: 0;
  }

  .manufacturing-workbench-summary strong {
    font-size: 20px;
  }

  .manufacturing-workbench-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .manufacturing-workbench-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .manufacturing-workbench-order,
  .manufacturing-workbench-status,
  .manufacturing-workbench-row > button {
    grid-column: 1 / -1;
  }

  .manufacturing-workbench-row > button {
    width: 100%;
  }

  .manufacturing-approval-head,
  .manufacturing-approval-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .manufacturing-approval-actions,
  .manufacturing-approval-item-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .manufacturing-approval-file,
  .manufacturing-approval-file .file-chip {
    width: 100%;
  }

  .manufacturing-approval-file .file-chip span:nth-child(2) {
    max-width: calc(100vw - 150px);
  }

  .manufacturing-approval-history-row {
    grid-template-columns: 1fr auto;
  }

  .manufacturing-approval-history-row > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .order-change-line-fields,
  .order-change-replacement-fields,
  .order-change-impact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .order-change-impact-title,
  .order-change-replacement-title,
  .order-change-history-row {
    display: grid;
  }

  .order-change-history-status {
    justify-items: start;
  }

  .order-change-replacement-fields label.wide {
    grid-column: 1 / -1;
  }

  .material-readiness-summary {
    grid-template-columns: 1fr;
  }

  .material-readiness-page {
    gap: 10px;
  }

  .material-readiness-tabs {
    flex-wrap: nowrap;
    margin: 0 -2px;
    padding: 0 2px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .material-readiness-tabs::-webkit-scrollbar {
    display: none;
  }

  .material-readiness-tabs button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .material-readiness-page > .table-wrap {
    display: none;
  }

  .material-readiness-card-list,
  .material-readiness-detail-cards {
    display: grid;
    gap: 10px;
  }

  .material-readiness-card,
  .material-readiness-item-card {
    border-color: rgba(255, 255, 255, .09);
    background: rgba(13, 27, 23, .92);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .22);
  }

  .material-readiness-card-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .material-readiness-detail {
    padding: 10px 0 0;
  }

  .material-readiness-detail .material-readiness-table {
    display: none;
  }

  .material-readiness-table-wrap {
    overflow: visible;
  }
}

@media (max-width: 480px) {
  .order-change-line-fields,
  .order-change-replacement-fields,
  .order-change-impact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-change-replacement-fields label.wide {
    grid-column: auto;
  }

  .order-change-line-title,
  .order-change-replacement-head,
  .order-change-preview-head {
    display: grid;
  }

  .order-change-line-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .top-actions {
    grid-template-columns: 1fr;
  }

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

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

  .modal-panel,
  .detail-panel,
  .file-preview-panel {
    height: 100dvh;
    border-radius: 0;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .material-readiness-card-meta {
    grid-template-columns: 1fr 1fr;
  }

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

  .manufacturing-template-file {
    align-items: stretch;
  }

  .manufacturing-template-file .file-upload-trigger,
  .manufacturing-template-file .text-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 860px) {
  body.sidebar-collapsed .app-shell {
    display: block;
  }

  body.sidebar-collapsed .side-nav,
  body.sidebar-collapsed .side-nav:hover {
    width: auto;
    padding: 12px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
  }

  body.sidebar-collapsed .brand > div:not(.brand-mark) {
    display: block;
  }

  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .side-nav:hover .nav-label {
    display: inline;
  }

  body.sidebar-collapsed .side-card,
  body.sidebar-collapsed .side-nav:hover .side-card {
    display: none;
  }

  body.sidebar-collapsed .sidebar-toggle {
    display: none;
  }

  body.sidebar-collapsed .nav-btn,
  body.sidebar-collapsed .side-nav:hover .nav-btn {
    justify-content: center;
    padding: 9px 11px;
  }
}
.order-change-board { width: 100%; }
.order-change-board-summary { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.order-change-board-summary strong { font-size: 20px; }
.order-change-board-summary span { color: var(--muted); }
.order-change-collab-list { display: grid; gap: 10px; }
.order-change-collab-card { border: 1px solid var(--line); background: #fff; padding: 16px; cursor: pointer; }
.order-change-collab-card:hover { border-color: #90b9ad; box-shadow: 0 6px 20px rgba(15, 75, 59, .08); }
.order-change-collab-head, .order-change-collab-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-change-collab-head > div { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.order-change-collab-head strong { font-size: 18px; }
.order-change-collab-head span, .order-change-collab-foot span { color: var(--muted); }
.order-change-collab-card p { margin: 12px 0; }
.order-change-collab-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.order-change-collab-metrics span { padding: 6px 9px; background: #f4f7f5; color: #415650; font-size: 13px; }
.order-change-collab-metrics b { color: #123f33; }
.order-change-collab-metrics .warning { background: #fff4d8; color: #936000; }
.order-change-legacy-warning { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-left: 4px solid #d88b16; background: #fff8e8; margin-bottom: 14px; }
.order-change-legacy-warning span { color: #735a28; }
.order-change-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.order-change-detail-summary > div { border: 1px solid var(--line); padding: 12px; background: #f8faf8; }
.order-change-detail-summary span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.order-change-detail-section { border-top: 1px solid var(--line); padding: 16px 0; }
.order-change-detail-section h4 { display: flex; justify-content: space-between; margin: 0 0 12px; }
.order-change-detail-section h4 span { color: var(--muted); font-size: 13px; font-weight: 500; }
.order-change-step-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.order-change-step { display: flex; gap: 8px; padding: 10px; border: 1px solid var(--line); min-height: 78px; }
.order-change-step b { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 50%; background: #e9efec; }
.order-change-step div { min-width: 0; }
.order-change-step strong, .order-change-step span { display: block; }
.order-change-step span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.order-change-step.done { border-color: #b9dcca; background: #f2fbf6; }
.order-change-step.done b { background: #17845f; color: #fff; }
.order-change-step.current { border-color: #e4bd72; background: #fff9ea; }
.order-change-step.current b { background: #d28a16; color: #fff; }
.order-change-diff-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.order-change-diff-list article { border: 1px solid var(--line); padding: 11px; }
.order-change-diff-list article > span, .order-change-diff-list small { display: block; color: var(--muted); margin-top: 4px; }
.order-change-diff-list article > div { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.order-change-diff-list em { font-style: normal; font-weight: 700; }
.order-change-diff-list em.down { color: #c14332; }
.order-change-diff-list em.up { color: #16835d; }
.order-change-diff-list small.warning { color: #9a6500; }
.order-change-missing-bom { display: flex; flex-wrap: wrap; gap: 7px; }
.order-change-missing-bom span { padding: 7px 9px; background: #fff2d3; color: #8b5d00; }
.success-note { padding: 10px; background: #ecf9f1; color: #14714f; }
.order-change-material-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.order-change-material-summary span { padding: 7px 9px; background: #eef4f1; }
.order-change-material-preview { border: 1px solid var(--line); }
.order-change-material-preview > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.order-change-material-preview > div:last-child { border-bottom: 0; }
.order-change-material-preview span { color: var(--muted); text-align: right; }
.order-change-material-preview .more { justify-content: center; color: var(--muted); }

@media (max-width: 900px) {
  .exception-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-pager { align-items: flex-start; flex-direction: column; }
  .order-change-detail-summary, .order-change-diff-list { grid-template-columns: 1fr; }
  .order-change-step-list { grid-template-columns: 1fr 1fr; }
  .order-change-collab-head, .order-change-collab-foot, .order-change-material-preview > div { align-items: flex-start; flex-direction: column; }
  .order-change-material-preview span { text-align: left; }
}

.style-duplicate-guard {
  border: 1px solid #cbdad4;
  background: #f7faf8;
  padding: 14px;
}

.style-duplicate-guard-head,
.style-duplicate-alert,
.style-duplicate-clear {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.style-duplicate-guard-head span,
.style-duplicate-alert span,
.style-duplicate-clear span {
  color: var(--muted);
  font-size: 13px;
}

.style-duplicate-results {
  margin-top: 10px;
}

.style-duplicate-alert {
  border-left: 4px solid #d39a2c;
  background: #fff8e8;
  padding: 10px 12px;
}

.style-duplicate-alert.is-exact {
  border-left-color: #c54b3d;
  background: #fff3f1;
}

.style-duplicate-clear {
  border-left: 4px solid #218463;
  background: #edf8f2;
  padding: 10px 12px;
}

.style-duplicate-error {
  color: #9c3d32;
  background: #fff3f1;
  padding: 10px 12px;
}

.style-duplicate-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.style-duplicate-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 11px;
}

.style-duplicate-item.is-exact {
  border-color: #e2b1aa;
}

.style-duplicate-item > div:first-child strong,
.style-duplicate-item > div:first-child span,
.style-merge-target > div strong,
.style-merge-target > div span {
  display: block;
}

.style-duplicate-item > div:first-child span,
.style-merge-target > div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.style-duplicate-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.style-duplicate-override,
.style-merge-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  color: #6f3d20;
}

.style-duplicate-override input,
.style-merge-confirm input,
.style-merge-target input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.style-merge-panel {
  width: min(1080px, calc(100vw - 40px));
  max-height: min(880px, calc(100vh - 40px));
}

.style-merge-content {
  overflow: auto;
  padding: 18px 22px 24px;
}

.style-merge-source {
  border-left: 4px solid #c44c3f;
  background: #fff5f3;
  padding: 13px 15px;
}

.style-merge-source span,
.style-merge-source strong,
.style-merge-source p {
  display: block;
  margin: 0;
}

.style-merge-source span {
  color: var(--muted);
  font-size: 12px;
}

.style-merge-source strong {
  margin-top: 5px;
  font-size: 18px;
}

.style-merge-source p {
  margin-top: 4px;
  color: var(--muted);
}

.style-merge-guidance {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  border-left: 4px solid #247b61;
  background: #eef8f3;
  padding: 12px 14px;
}

.style-merge-guidance span {
  color: #4f645d;
  line-height: 1.55;
}

.style-merge-targets h4 {
  margin: 16px 0 9px;
}

.style-merge-target {
  display: grid;
  grid-template-columns: 20px minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.style-merge-target:hover,
.style-merge-target:has(input:checked) {
  border-color: #4d9a80;
  background: #f1f9f5;
}

.style-merge-reason {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .feedback-routing-hint,
  .feedback-workflow-overview > div:first-child,
  .feedback-start-row { align-items: flex-start; flex-direction: column; }
  .feedback-waiting-development,
  .feedback-waiting-business { grid-template-columns: 1fr; }
  .feedback-action-history > div { grid-template-columns: 1fr; gap: 4px; }
  .feedback-action-history em { text-align: left; }

  .style-duplicate-guard-head,
  .style-duplicate-alert,
  .style-duplicate-clear {
    align-items: flex-start;
    flex-direction: column;
  }

  .style-duplicate-item,
  .style-merge-target {
    grid-template-columns: 1fr;
  }

  .style-merge-panel {
    width: 100vw;
    max-height: 100vh;
  }
}
.development-view-toolbar {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 14px;
  border: 1px solid var(--line, #d7dfdc);
  border-radius: 6px;
  background: #f3f6f5;
}

.development-view-toolbar .internal-sample-create {
  margin-left: auto;
  white-space: nowrap;
}

.internal-sample-boundary-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-left: 3px solid #2f7d66;
  background: #f3f8f6;
  color: #35524a;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .development-view-toolbar {
    align-items: stretch;
    overflow-x: auto;
  }

  .development-view-toolbar .internal-sample-create {
    margin-left: 0;
    min-height: 40px;
  }
}

.development-view-toolbar button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  color: #54615d;
  background: transparent;
  cursor: pointer;
}

.development-view-toolbar button.active {
  color: #0d4035;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 45, 38, 0.12);
  font-weight: 700;
}

.development-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line, #d7dfdc);
}

.development-kpi-head h3,
.development-kpi-section h4 {
  margin: 0;
}

.development-kpi-head p {
  margin: 5px 0 0;
  color: #67736f;
}

.development-kpi-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.development-kpi-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #54615d;
  font-size: 13px;
}

.development-kpi-controls input {
  width: 142px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line, #d7dfdc);
  border-radius: 4px;
  background: #fff;
}

.development-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 1px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line, #d7dfdc);
  border-radius: 6px;
  background: var(--line, #d7dfdc);
}

.development-metric {
  min-height: 92px;
  padding: 14px;
  border: 0;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.development-metric span,
.development-metric small {
  display: block;
  color: #64716d;
}

.development-metric strong {
  display: block;
  margin-top: 7px;
  color: #102c26;
  font-size: 24px;
  letter-spacing: 0;
}

.development-quality-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  padding: 12px 0 18px;
  color: #52605c;
}

.development-quality-strip strong {
  margin-left: 5px;
  color: #102c26;
}

.sample-development-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line, #d7dfdc);
}

.sample-development-file > .sub {
  grid-column: 1;
  overflow-wrap: anywhere;
}

.sample-development-file > .icon-btn {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

.sample-development-file .file-chip {
  max-width: 100%;
}

.sample-development-file .file-chip > span:not(.file-icon) {
  overflow-wrap: anywhere;
  white-space: normal;
  min-width: 0;
}

.development-kpi-section {
  padding: 18px 0;
  border-top: 1px solid var(--line, #d7dfdc);
}

.development-kpi-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .development-metrics {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .development-kpi-head {
    flex-direction: column;
  }

  .development-kpi-controls {
    flex-wrap: wrap;
  }
}

body[data-active-module="orderDelivery"] .record-grid {
  display: block;
  width: 100%;
}

.order-delivery-page {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.order-delivery-head,
.order-delivery-list-head,
.order-delivery-status-tabs,
.order-delivery-pagination {
  display: flex;
  align-items: center;
}

.order-delivery-head {
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.order-delivery-head > div {
  display: grid;
  gap: 4px;
}

.order-delivery-head strong {
  font-size: 18px;
}

.order-delivery-head span,
.order-delivery-list-head span,
.order-delivery-analysis header span {
  color: var(--muted);
  font-size: 12px;
}

.order-delivery-status-tabs {
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.order-delivery-status-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.order-delivery-status-tabs button.active,
.order-delivery-status-tabs button:hover {
  border-color: #72a997;
  background: #e7f2ed;
  color: var(--primary-strong);
}

.order-delivery-filters {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) repeat(4, minmax(128px, .8fr)) minmax(138px, .9fr) auto auto;
  align-items: end;
  gap: 9px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.order-delivery-filters label {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.order-delivery-filters input,
.order-delivery-filters select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: var(--panel);
  color: var(--text);
}

.order-delivery-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.order-delivery-kpi {
  min-width: 0;
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

button.order-delivery-kpi {
  cursor: pointer;
}

button.order-delivery-kpi:hover,
button.order-delivery-kpi.active {
  border-color: #72a997;
  background: #edf8f3;
}

.order-delivery-kpi.attention strong {
  color: #98620d;
}

.order-delivery-kpi span {
  color: var(--muted);
  font-size: 12px;
}

.order-delivery-kpi strong {
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.1;
}

.order-delivery-overdue {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px 12px;
  padding: 8px 12px;
  border: 1px solid #efc5b5;
  border-radius: 6px;
  background: #fff7f3;
  color: #8f2f16;
  cursor: pointer;
}

.order-delivery-overdue:hover,
.order-delivery-overdue.active {
  border-color: var(--red);
  background: #ffede7;
}

.order-delivery-overdue strong {
  font-size: 18px;
}

.order-delivery-overdue small {
  color: #9b5a46;
}

.order-delivery-analysis {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(250px, .8fr) minmax(280px, .9fr);
  border-top: 1px solid var(--line);
}

.order-delivery-analysis > section {
  min-width: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.order-delivery-analysis > section + section {
  border-left: 1px solid var(--line);
}

.order-delivery-analysis header,
.order-delivery-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.order-delivery-analysis header {
  margin-bottom: 10px;
}

.order-delivery-customer,
.order-delivery-due-row {
  width: 100%;
  min-height: 30px;
  display: grid;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.order-delivery-customer {
  grid-template-columns: 22px minmax(86px, 1fr) minmax(90px, 1.8fr) auto 48px;
}

.order-delivery-customer:hover,
.order-delivery-due-row:hover,
.order-delivery-due-row.active {
  background: #f0f6f3;
}

.order-delivery-customer > span {
  color: var(--muted);
  text-align: center;
}

.order-delivery-customer > b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-delivery-customer > i,
.order-delivery-due-row > i {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e7ecea;
}

.order-delivery-customer > i em,
.order-delivery-due-row > i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #23866c;
}

.order-delivery-due-row > i em.danger {
  background: var(--red);
}

.order-delivery-customer small,
.order-delivery-due-row strong {
  color: var(--muted);
  text-align: right;
}

.order-delivery-due-row {
  grid-template-columns: 88px minmax(100px, 1fr) 80px;
  padding: 0 5px;
}

.order-delivery-months {
  height: 124px;
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 7px;
}

.order-delivery-month {
  min-width: 0;
  display: grid;
  grid-template-rows: 22px 1fr 20px;
  gap: 3px;
  text-align: center;
}

.order-delivery-month > strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-delivery-month > i {
  position: relative;
  min-height: 70px;
  border-bottom: 1px solid #9eaca7;
}

.order-delivery-month > i em {
  position: absolute;
  right: 18%;
  bottom: 0;
  left: 18%;
  background: #d59a28;
}

.order-delivery-list-head {
  padding: 13px 12px 9px;
}

.order-delivery-table {
  width: 100%;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.order-delivery-table table {
  min-width: 1120px;
}

.order-delivery-table td:nth-child(n+4):nth-child(-n+7) {
  text-align: right;
}

.order-delivery-due {
  white-space: nowrap;
  font-weight: 800;
}

.order-delivery-due.overdue,
.order-delivery-due.missing {
  color: var(--red);
}

.order-delivery-due.urgent {
  color: #98620d;
}

.order-delivery-due.complete {
  color: var(--green);
}

.order-delivery-mobile {
  display: none;
}

.order-delivery-pagination {
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1360px) {
  .order-delivery-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .order-delivery-filters,
  .order-delivery-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-delivery-analysis {
    grid-template-columns: 1fr;
  }

  .order-delivery-analysis > section + section {
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .order-delivery-page {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .order-delivery-head {
    align-items: flex-start;
  }

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

  .order-delivery-filters label:first-child,
  .order-delivery-filters label:last-of-type,
  .order-delivery-filters .btn {
    grid-column: 1 / -1;
  }

  .order-delivery-kpis {
    gap: 6px;
    padding: 8px;
  }

  .order-delivery-kpi {
    min-height: 72px;
    padding: 9px 10px;
  }

  .order-delivery-kpi strong {
    font-size: 19px;
  }

  .order-delivery-overdue {
    margin: 0 8px 8px;
  }

  .order-delivery-customer {
    grid-template-columns: 20px minmax(76px, 1fr) minmax(70px, 1.2fr) auto;
  }

  .order-delivery-customer small,
  .order-delivery-customer:nth-child(n+6) {
    display: none;
  }

  .order-delivery-month-section {
    overflow-x: auto;
  }

  .order-delivery-months {
    min-width: 520px;
  }

  .order-delivery-table {
    display: none;
  }

  .order-delivery-mobile {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .order-delivery-mobile > article {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
  }

  .order-delivery-mobile article > header,
  .order-delivery-mobile-risk {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .order-delivery-mobile article > header > div {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .order-delivery-mobile article > header span {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .order-delivery-mobile-risk {
    padding: 9px 10px;
    background: var(--panel-soft);
  }

  .order-delivery-mobile-risk > span {
    color: var(--muted);
  }

  .order-delivery-mobile-risk > strong {
    font-size: 19px;
  }

  .order-delivery-mobile dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
  }

  .order-delivery-mobile dl div {
    min-width: 0;
    padding: 7px 8px;
    background: var(--panel-soft);
  }

  .order-delivery-mobile dt {
    color: var(--muted);
    font-size: 11px;
  }

  .order-delivery-mobile dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-weight: 800;
  }

  .order-delivery-mobile .btn {
    min-height: 44px;
  }

  .order-delivery-pagination {
    justify-content: space-between;
  }
}

/* Desktop order grid: isolated UI candidate. */
.order-grid-modal .modal-panel { width:min(1480px,96vw); max-height:94vh; }
.order-grid-modal .record-form { grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px 16px; padding:16px 20px; }
.order-grid-modal .record-form > .wide { grid-column:1/-1; }
.order-grid-modal .record-form > .field > label { margin-bottom:4px; }
.order-grid-modal .order-number-hints { grid-column:1/-1; padding:8px 12px; display:flex; align-items:center; gap:10px; }
.order-grid-modal .order-number-hint-note { display:none; }
.order-grid-modal .order-number-hint-title { white-space:nowrap; }
.order-grid-modal .order-number-hint-card { display:flex; align-items:center; gap:10px; padding:8px 10px; flex:1; }
.order-grid-modal #recordForm > .field:has(textarea[name=remark]) textarea { min-height:48px; height:48px; }
.order-grid-toolbar { display:flex; gap:18px; align-items:center; padding:4px 0 10px; }
.order-grid-toolbar label { display:flex; gap:8px; align-items:center; font-size:13px; }
.order-grid-toolbar input { width:155px; padding:6px; }
.order-grid-toolbar .sub { margin-left:auto; }
.order-grid-scroll { border:1px solid #d6e1dd; border-radius:6px; min-height:145px; }
.order-entry-table { width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; font-size:13px; }
.order-entry-table thead { position:sticky; top:-16px; z-index:2; }
.order-entry-table th { background:#eff5f2; padding:9px 8px; color:#325348; font-size:12px; border-bottom:1px solid #c8d9d1; text-align:left; }
.order-entry-table td { padding:4px 8px; border-bottom:1px solid #e5ece8; border-right:1px solid #eef2ef; vertical-align:middle; }
.order-entry-table tbody:nth-child(odd) { background:#fafcfb; }
.order-entry-table tbody + tbody td { border-top:2px solid #d4e2dc; }
.order-entry-table tr { height:39px; }
.order-entry-table input:not([type=checkbox]), .order-entry-table select { width:100%; min-width:0; height:29px; padding:3px 6px; font-size:13px; border:1px solid #d8e2de; border-radius:3px; background:#fff; }
.order-entry-table input:focus { outline:2px solid #288566; outline-offset:0; background:#f4fff8; }
.order-entry-table input:disabled { background:#f1f3f2; color:#55675d; }
.order-entry-table .order-grid-style { vertical-align:top; padding-top:8px; }
.order-grid-style strong,.order-grid-style > span,.order-grid-style > small { display:block; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-grid-style > small { color:#728079; font-size:11px; }
.order-group-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:5px; }
.order-entry-table .text-btn { font-size:12px; padding:0; white-space:nowrap; }
.order-grid-quantity { display:flex; align-items:center; gap:5px; }
.order-grid-quantity small { color:#718078; white-space:nowrap; }
.order-entry-table [data-grid-status] { display:block; font-size:11px; color:#6b7873; }
.order-grid-note { margin:0; font-size:12px; color:#586b61; padding:6px 10px; background:#f1f6f3; }
.order-grid-summary { margin-right:auto; display:flex; gap:20px; font-size:13px; color:#53675d; }
.order-grid-summary b,.order-grid-summary strong { color:#174d37; font-size:16px; margin-left:4px; }
.order-grid-picker { position:fixed; inset:0; z-index:60; background:rgba(24,45,37,.24); display:grid; place-items:center; }
.order-grid-picker-card { width:760px; max-height:78vh; display:grid; grid-template-rows:auto minmax(0,1fr) auto; border-radius:10px; background:white; box-shadow:0 20px 70px #1c322544; overflow:hidden; }
.order-grid-picker-card > header,.order-grid-picker-card > footer { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-bottom:1px solid #dfe7e2; gap:12px; }
.order-grid-picker-card h4 { margin:0; font-size:18px; }
.order-grid-picker-card > footer { justify-content:flex-end; border-top:1px solid #dfe7e2; border-bottom:0; }
.order-picker-body { padding:16px 20px; overflow:auto; display:grid; gap:12px; }
.order-picker-body label { font-size:13px; }
.order-picker-body input:not([type=checkbox]),.order-picker-body select { display:block; width:100%; padding:9px; margin-top:5px; border:1px solid #cddcd4; border-radius:5px; }
.order-picker-filters { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.order-picker-results { max-height:340px; overflow:auto; border:1px solid #dfe7e2; border-radius:5px; }
.order-picker-option { display:grid; grid-template-columns:20px 130px 1fr; gap:9px; padding:10px 12px; border-bottom:1px solid #edf1ee; cursor:pointer; }
.order-picker-option small { grid-column:2/-1; color:#6a7c70; }
.order-size-checks { display:flex; flex-wrap:wrap; gap:10px; }
.order-size-checks label { padding:9px 16px; border:1px solid #d7e3dc; border-radius:5px; }
.order-grid-picker.hidden { display:none; }
.order-grid-modal .order-number-hints { min-height:0; gap:8px; margin:0; padding:5px 8px; }
.order-grid-modal .order-number-hint-card { min-height:0; height:32px; padding:4px 8px; }
.order-grid-modal .order-number-hint-card strong { font-size:14px; margin:0; }
.order-grid-modal .order-number-hint-card span,.order-grid-modal .order-number-hint-card b,.order-grid-modal .order-number-hint-title { font-size:12px; margin:0; }
.order-grid-modal .record-form > .field > label { font-size:12px; }
.order-grid-modal .record-form > .field > input:not([type=hidden]),.order-grid-modal .record-form > .field > select,.order-grid-modal .record-form > .field > .readonly-field { min-height:0; height:33px; padding:5px 9px; font-size:13px; }
.order-grid-modal .record-form > .field > textarea { min-height:38px!important; height:38px!important; padding:6px 9px; font-size:13px; }
.order-grid-modal .modal-head,.order-grid-modal .modal-actions { padding:10px 16px; }
.order-grid-modal .modal-head h3 { font-size:18px; }
.order-entry-table th { position:static; }

/* ERP desktop entry: flat grid, compact rows and one active cell. */
.order-grid-modal .record-form { gap:7px 12px; padding:10px 14px; }
.order-grid-toolbar { gap:12px; padding:2px 0 5px; }
.order-grid-toolbar .sub { font-size:12px; }
.order-grid-toolbar .btn { min-height:30px; padding:5px 10px; border-radius:2px; }
.order-grid-scroll { border-color:#bfcad3; border-radius:0; min-height:100px; }
.order-entry-table { font-size:12px; }
.order-entry-table thead { top:-10px; }
.order-entry-table th { padding:5px 6px; background:#e9edf1; color:#293c4b; border-bottom:1px solid #bfcad3; }
.order-entry-table tbody:nth-child(odd) { background:#fafbfc; }
.order-entry-table td { padding:2px 6px; border-bottom:1px solid #dce2e7; border-right:1px solid #dce2e7; }
.order-entry-table tbody + tbody td { border-top:1px solid #bfcad3; }
.order-entry-table tr { height:31px; }
.order-entry-table input:not([type=checkbox]),.order-entry-table select { height:25px; padding:2px 4px; font-size:12px; border-radius:0; border:1px solid transparent; background:transparent; }
.order-entry-table input:focus { outline:none; background:transparent; }
.order-entry-table td.is-active-cell { box-shadow:inset 0 0 0 2px #246eae; background:#eef6ff; }
.order-entry-table input[type=number] { -moz-appearance:textfield; appearance:textfield; }
.order-entry-table input[type=number]::-webkit-inner-spin-button,.order-entry-table input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.order-entry-table .order-grid-style { position:relative; vertical-align:middle; padding:2px 112px 2px 6px; white-space:nowrap; }
.order-grid-style > strong { display:inline-block; vertical-align:middle; font-size:12px; max-width:75px; }
.order-grid-style > span { display:inline-block; vertical-align:middle; font-size:12px; margin-left:5px; max-width:calc(100% - 60px); }
.order-grid-style > small { display:none; }
.order-group-actions { position:absolute; top:50%; right:5px; transform:translateY(-50%); display:flex; flex-wrap:nowrap; gap:8px; margin:0; }
.order-group-actions .text-btn { font-size:11px; }
.order-grid-summary { gap:16px; font-size:12px; }
.order-grid-summary b,.order-grid-summary strong { font-size:14px; }

/* v3: independent desktop ERP document workspace. */
body.order-document-mode .workspace { height:100vh; min-height:0; padding:30px 12px 8px; display:flex; flex-direction:column; overflow:hidden; }
body.order-document-mode .topbar,body.order-document-mode #moduleView,body.order-document-mode #dashboardView,body.order-document-mode #noticeBand { display:none!important; }
body.order-document-mode .side-nav { padding-top:35px; }
body.order-document-mode #tabBar { flex:none; margin:0 0 5px; min-height:32px; }
.order-document-page { min-height:0; flex:1; display:grid; grid-template-rows:42px minmax(0,1fr) 46px; background:#fff; border:1px solid #bcc9d2; }
.order-document-page.hidden { display:none; }
.order-document-page .modal-head { padding:6px 10px; gap:12px; background:#f3f6f8; border-bottom:1px solid #c4ced7; }
.order-document-page .modal-head h3 { font-size:16px; flex:1; margin:0; }
.order-document-location { color:#687988; font-size:12px; }
.order-document-page .icon-btn { width:28px; height:28px; border-radius:2px; }
.order-document-page .record-form { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); gap:0; overflow:hidden; padding:0; min-height:0; }
.order-document-master { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); align-items:start; gap:7px 12px; padding:10px 12px 8px; border-bottom:1px solid #c9d3da; background:#fbfcfd; }
.order-document-master > .field { margin:0; min-width:0; }
.order-document-master > .field.wide { grid-column:span 3; }
.order-document-master .field > label { font-size:12px; margin-bottom:3px; }
.order-document-master .field > input:not([type=hidden]),.order-document-master .field > select,.order-document-master .readonly-field { height:29px; min-height:0; padding:4px 7px; font-size:12px; border-radius:2px; border:1px solid #cdd7de; }
.order-document-master .field > textarea { min-height:29px; height:29px; padding:4px 7px; font-size:12px; border-radius:2px; }
.order-document-master #orderNumberHints { grid-column:1/-1; display:flex; gap:10px; align-items:center; border:0; margin:0; padding:0; background:transparent; }
.order-document-master .order-number-hint-title { font-size:11px; color:#647887; }
.order-document-master .order-number-hint-note { display:none; }
.order-document-master .order-number-hint-card { display:flex; gap:8px; align-items:center; min-height:0; height:24px; padding:2px 6px; border:0; border-radius:2px; background:#eef3f6; }
.order-document-master .order-number-hint-card strong,.order-document-master .order-number-hint-card span,.order-document-master .order-number-hint-card b { font-size:11px; margin:0; }
.order-document-lines { min-height:0; display:flex; flex-direction:column; margin:0; }
.order-document-page #orderLinesBuilder { min-height:0; flex:1; display:flex; flex-direction:column; gap:0; }
.order-document-page .order-grid-toolbar { flex:none; padding:6px 10px; background:#fafbfc; border-bottom:1px solid #dde3e8; }
.order-document-page .order-grid-toolbar input { height:26px; font-size:12px; border-radius:2px; }
.order-document-line-actions { flex:none; display:flex; align-items:center; gap:8px; padding:5px 10px; border-bottom:1px solid #bac8d2; background:#edf2f6; }
.order-document-line-actions > strong { font-size:12px; margin-right:6px; }
.order-document-line-actions .btn { padding:3px 7px; min-height:25px; font-size:11px; border-radius:2px; background:#fff; }
.order-document-line-actions [data-doc-row-status] { margin-left:auto; font-size:11px; color:#50697c; }
.order-document-page .order-grid-note { padding:4px 10px; font-size:11px; }
.order-document-page .order-grid-scroll { flex:1; min-height:0; overflow:auto; border:0; }
.order-document-page .order-entry-table { min-width:1120px; font-size:12px; }
.order-document-page .order-entry-table thead { top:0; }
.order-document-page .order-entry-table th { height:29px; white-space:nowrap; }
.order-document-page .order-entry-table td { height:28px; padding:1px 5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-color:#d5dde4; }
.order-document-page .order-entry-table tr { height:29px; }
.order-document-page .order-entry-table input:not([type=checkbox]) { height:26px; padding:2px 3px; }
.order-document-page .order-entry-table input[type=date] { font-size:11px; }
.order-document-page .order-row-sequence { color:#637989; text-align:center; }
.order-document-page .order-row-amount { text-align:right; padding-right:8px; color:#344f61; }
.order-document-page .is-selected-order-row { background:#f3f8fc; }
.order-document-page .order-row-remark { color:#677b89; }
.order-document-page .modal-actions { padding:6px 10px; background:#f3f6f8; gap:8px; }
.order-document-page .modal-actions .btn { border-radius:2px; min-height:29px; padding:4px 12px; font-size:12px; }
.order-picker-selected-sizes { display:grid; gap:5px; max-height:220px; overflow:auto; }
.order-picker-size-line { display:flex; gap:12px; flex-wrap:wrap; align-items:center; padding:5px 8px; border-bottom:1px solid #dbe3e9; font-size:12px; }
.order-picker-size-line strong { min-width:80px; font-size:12px; }
.order-picker-size-line label { display:flex; gap:4px; align-items:center; font-size:12px; }
.order-document-row-actions[hidden] { display:none; }

/* Order v3: stable document rail and compact desktop command rows. */
body.order-document-mode .app-shell { grid-template-columns:76px minmax(0,1fr); transition:none; }
body.order-document-mode .side-nav { transition:none; }
.order-document-page .order-grid-toolbar .btn { height:28px; min-height:28px; padding:3px 10px; font-size:12px; }
.order-document-page .order-document-line-actions .btn { height:25px; min-height:25px; }
.order-document-page .modal-actions .btn { height:29px; min-height:29px; }

/* v4: Excel-style range selection and copy-fill; document view only. */
.order-document-page .order-entry-table td { position:relative; }
.order-document-page .order-entry-table td.is-range-selected { background:#e8f2fc; }
.order-document-page .order-entry-table td.is-range-edge { box-shadow:inset 0 0 0 1px #82acd1; }
.order-document-page .order-entry-table td.is-active-cell { box-shadow:inset 0 0 0 2px #246eae; }
.order-document-page .order-grid-fill-handle { position:absolute; bottom:0; right:0; z-index:5; display:block; width:9px; height:9px; min-height:0; max-height:9px; padding:0; border:1px solid #fff; border-radius:0; background:#246eae; cursor:crosshair; line-height:0; }
.order-document-page .is-grid-range-dragging .order-entry-table,.order-document-page .is-grid-range-dragging .order-entry-table input { user-select:none; cursor:crosshair; }
.order-document-page .order-grid-range-status { flex:none; min-height:28px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:4px 10px; border-top:1px solid #b8cbdc; background:#edf4fa; color:#244b6a; font-size:12px; }
.order-grid-range-status strong { font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
.order-grid-range-status span { color:#647b8c; font-size:11px; }

/* Scoped addition; frozen ERP v4 grid styles are untouched. */
.delivery-records-modal { z-index: 1300; }
.delivery-records-modal .modal-panel { width: min(1240px, 94vw); max-height: 90vh; overflow: auto; padding: 18px; }
.delivery-records-modal .modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.delivery-records-modal h3 { margin: 0; }
.delivery-records-modal p, .delivery-records-modal [data-delivery-summary] { font-size: 13px; margin: 10px 0; }
.delivery-records-message { color: #536178; }
.delivery-records-table-wrap { overflow: auto; max-height: 58vh; border: 1px solid #d6dce5; }
.delivery-records-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.delivery-records-table th, .delivery-records-table td { padding: 7px 8px; border: 1px solid #e0e5ec; text-align: left; vertical-align: top; }
.delivery-records-table th { background: #f3f5f8; position: sticky; top: 0; }
.delivery-records-table summary { cursor: pointer; color: #235ba8; }
.delivery-records-table details span { display: block; padding-top: 6px; color: #64748b; }
.delivery-records-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; }
