:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #fbfdff;
  --surface-selected: #f3f7ff;
  --line: #dde4ef;
  --line-strong: #c8d2e1;
  --text: #162033;
  --muted: #697586;
  --faint: #98a2b3;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --teal: #0f9f8f;
  --teal-soft: #ddf7f3;
  --amber: #b66a00;
  --amber-soft: #fff3d6;
  --rose: #d83b4c;
  --rose-soft: #ffe7eb;
  --required-mark: #d92d20;
  --violet: #6d5bd0;
  --violet-soft: #eeeafd;
  --green: #22835b;
  --green-soft: #e3f5ec;
  --primary: var(--blue);
  --blue-strong: #1d55c8;
  --on-primary: #ffffff;
  --on-danger: #ffffff;
  --sidebar-bg: #0f172a;
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --info-surface: #f5f8ff;
  --info-line: #bfd0f4;
  --blue-line: #bcd1ff;
  --readonly-surface: #f4f7fb;
  --readonly-text: #344054;
  --image-placeholder: #edf2f7;
  --track: #e8edf5;
  --danger-surface: #fff7f8;
  --danger-hover-surface: #fff4f5;
  --danger-line: #f4bcc4;
  --rose-strong: #bb2638;
  --focus-line: #93b4ff;
  --focus-ring: rgba(37, 99, 235, 0.12);
  --modal-backdrop: rgba(15, 23, 42, 0.44);
  --modal-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  --toast-bg: #162033;
  --toast-line: #26344d;
  --toast-text: #ffffff;
  --card-shadow: 0 6px 18px rgba(28, 40, 62, 0.05);
  --card-shadow-hover: 0 10px 24px rgba(37, 99, 235, 0.1);
  --shadow: 0 18px 48px rgba(28, 40, 62, 0.08);
  color-scheme: light;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

html[data-theme="soft"] {
  --bg: #e9edf3;
  --surface: #f5f7fa;
  --surface-soft: #edf1f5;
  --surface-hover: #e8eef6;
  --surface-selected: #e4ebf6;
  --line: #cbd4df;
  --line-strong: #aebbc9;
  --text: #1c2635;
  --muted: #5d6979;
  --faint: #7d8998;
  --blue: #245ecb;
  --blue-soft: #dbe6f8;
  --blue-strong: #1f52b0;
  --teal: #137f75;
  --teal-soft: #d6ece8;
  --amber: #9b5c0a;
  --amber-soft: #f2e4c5;
  --rose: #bd3e4c;
  --rose-soft: #f3dce0;
  --violet: #6556b8;
  --violet-soft: #e3dff3;
  --green: #27754f;
  --green-soft: #d8eade;
  --sidebar-bg: #172033;
  --topbar-bg: rgba(245, 247, 250, 0.92);
  --info-surface: #e3ebf8;
  --info-line: #a9bddb;
  --blue-line: #a8bee2;
  --readonly-surface: #e9edf2;
  --readonly-text: #354152;
  --image-placeholder: #e2e7ed;
  --track: #d5dce5;
  --danger-surface: #f4e2e5;
  --danger-hover-surface: #f1d9dd;
  --danger-line: #d9aab1;
  --focus-line: #7198df;
  --focus-ring: rgba(36, 94, 203, 0.16);
  --modal-backdrop: rgba(20, 29, 43, 0.52);
  --shadow: 0 14px 36px rgba(35, 46, 64, 0.1);
}

html[data-theme="dark"] {
  --bg: #101214;
  --surface: #191c1f;
  --surface-soft: #202428;
  --surface-hover: #252a2f;
  --surface-selected: #202d42;
  --line: #343a40;
  --line-strong: #4d5660;
  --text: #eef1f4;
  --muted: #a9b1b9;
  --faint: #7f8993;
  --blue: #79a7ff;
  --blue-soft: #263650;
  --blue-strong: #5f8fe7;
  --teal: #5bc9b8;
  --teal-soft: #1b3d38;
  --amber: #f3bc62;
  --amber-soft: #44361f;
  --rose: #ff8390;
  --rose-soft: #4a282e;
  --required-mark: #ff6b75;
  --violet: #b7a6ff;
  --violet-soft: #352f50;
  --green: #69d09c;
  --green-soft: #1f4232;
  --sidebar-bg: #0b0d0f;
  --topbar-bg: rgba(20, 22, 24, 0.92);
  --info-surface: #1e2a3b;
  --info-line: #3f5f8f;
  --blue-line: #4b6f9f;
  --readonly-surface: #22262a;
  --readonly-text: #bbc3cb;
  --image-placeholder: #24292e;
  --track: #30363c;
  --danger-surface: #392126;
  --danger-hover-surface: #46262c;
  --danger-line: #75414b;
  --rose-strong: #ee6978;
  --focus-line: #6e9cf2;
  --focus-ring: rgba(121, 167, 255, 0.2);
  --modal-backdrop: rgba(0, 0, 0, 0.66);
  --modal-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  --toast-bg: #eef1f4;
  --toast-line: #ffffff;
  --toast-text: #17191b;
  --on-primary: #111820;
  --on-danger: #1b1113;
  --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.3);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-width: 320px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar-bg);
  color: #e7ecf6;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #29b3a7, #4e78ff);
  color: #fff;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}

.brand span,
.sidebar-footer span,
.mini-label {
  color: #9aa7bd;
  font-size: 12px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav-count {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #f1b84b;
  color: #172033;
  font-size: 11px;
  font-weight: 800;
}

.nav-item svg,
.icon-button svg,
.primary-button svg,
.secondary-button svg,
.search-box svg,
.metric-icon svg,
.tiny-icon svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.today-count {
  margin: 8px 0 2px;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  padding: 14px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 8;
}

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

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.topbar-actions,
.control-row,
.panel-actions,
.modal-actions,
.button-row,
.record-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.appearance-control {
  position: relative;
  display: inline-flex;
}

.appearance-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 24;
  width: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.appearance-title {
  padding: 2px 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.appearance-subtitle {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.appearance-options {
  display: grid;
  gap: 4px;
}

.appearance-option {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.appearance-option:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.appearance-option[aria-checked="true"] {
  border-color: var(--blue-line);
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 800;
}

.appearance-option svg {
  width: 17px;
  height: 17px;
}

.appearance-check {
  visibility: hidden;
}

.appearance-option[aria-checked="true"] .appearance-check {
  visibility: visible;
}

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

.density-option {
  min-width: 0;
  min-height: 48px;
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
}

.density-option:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.density-option[aria-checked="true"] {
  border-color: var(--blue-line);
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 800;
}

.density-option svg {
  width: 16px;
  height: 16px;
}

.button-row {
  flex-wrap: wrap;
}

.date-pill {
  height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}

.icon-button:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.icon-button.ghost {
  background: transparent;
}

.primary-button {
  padding: 0 14px;
  background: var(--blue);
  color: var(--on-primary);
  border-color: var(--blue);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--blue-strong);
  border-color: var(--blue-strong);
}

.danger-button {
  padding: 0 14px;
  background: var(--rose);
  color: var(--on-danger);
  border-color: var(--rose);
  font-weight: 700;
}

.danger-button:hover {
  background: var(--rose-strong);
  border-color: var(--rose-strong);
}

.secondary-button {
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.undo-button:not(:disabled) {
  color: var(--blue);
  border-color: var(--info-line);
  background: var(--info-surface);
}

.compact-button {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.content-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 22px 24px;
}

.main-content,
.detail-panel {
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.25;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

html[data-active-view="reminders"] .page-head {
  flex-direction: column;
  align-items: stretch;
}

html[data-active-view="reminders"] .page-head .view-filter-controls {
  justify-content: flex-start;
}

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

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

.metric,
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 116px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-action {
  width: 100%;
  color: inherit;
  text-align: left;
  appearance: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.metric-action:hover,
.metric-action:focus-visible {
  border-color: var(--focus-line);
  box-shadow: 0 12px 30px var(--focus-ring);
  outline: 0;
}

.metric-action.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft), var(--shadow);
  background: var(--surface-hover);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.tone-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.tone-teal {
  color: var(--teal);
  background: var(--teal-soft);
}

.tone-amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.tone-violet {
  color: var(--violet);
  background: var(--violet-soft);
}

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

.metric-value.compact {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value.tight {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-caption {
  color: var(--muted);
  margin-top: 6px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.surface {
  padding: 16px;
}

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

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

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.stage-column {
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.stage-title {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
}

.stage-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.stage-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  text-align: left;
  color: var(--text);
}

.stage-card:hover,
.table-row:hover,
.focus-item:hover,
.client-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.stage-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-card span,
.tiny-meta,
.table-sub,
.field-value,
.empty-state,
.activity-item span {
  color: var(--muted);
}

.stage-card .amount {
  display: block;
  margin-top: 7px;
  color: var(--blue);
  font-weight: 800;
}

.focus-list,
.activity-list,
.client-list,
.reminder-list,
.settings-list {
  display: grid;
  gap: 8px;
}

.focus-item,
.client-row,
.reminder-row,
.setting-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.focus-item strong,
.client-row strong,
.reminder-row strong {
  display: block;
  margin-bottom: 4px;
}

.table-surface {
  padding: 0;
  overflow: hidden;
}

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

.table-toolbar h2,
.table-toolbar p {
  margin: 0;
}

.table-toolbar-actions,
.bulk-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-selection-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

.filter-toggle.active,
.highlight-toggle.active {
  color: var(--blue);
  border-color: var(--blue-line);
  background: var(--blue-soft);
  font-weight: 800;
}

.filter-chevron {
  width: 14px !important;
  height: 14px !important;
}

.filter-tab {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.filter-tab.active {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue-line);
  font-weight: 800;
}

.advanced-filter-panel {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.global-filter-panel {
  margin: -2px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.advanced-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.advanced-filter-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.advanced-filter-head strong {
  font-size: 15px;
}

.advanced-filter-head > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

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

.advanced-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 12px;
  margin-top: 12px;
}

.advanced-filter-grid label {
  gap: 5px;
  min-width: 0;
  font-size: 12px;
}

.advanced-filter-grid input,
.advanced-filter-grid select {
  min-height: 38px;
  padding: 8px 9px;
}

.row-highlight-panel {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.row-highlight-panel > div:first-child,
.row-highlight-panel > div:first-child span {
  display: block;
}

.row-highlight-panel > div:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.row-highlight-choices {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.row-highlight-choice {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-weight: 750;
}

.row-highlight-choice:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.row-highlight-choice svg {
  width: 15px;
  height: 15px;
}

.row-highlight-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, white 24%, transparent);
}

.swatch-red { background: #ef5b65; }
.swatch-amber { background: #e8a52b; }
.swatch-green { background: #2eaf7d; }
.swatch-blue { background: #4c8df6; }
.swatch-violet { background: #8c6de8; }

.follow-highlight-field {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.follow-highlight-field legend {
  padding: 0;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.follow-highlight-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.follow-highlight-option {
  position: relative;
  display: grid !important;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.follow-highlight-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
}

.follow-highlight-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.follow-highlight-option:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.follow-highlight-option svg { width: 18px; height: 18px; }
.follow-highlight-option .row-highlight-swatch { width: 22px; height: 22px; }
.order-demand-label { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-size: 12px; font-weight: 700; }
.order-demand-label svg { flex: 0 0 12px; width: 12px; height: 12px; }
.workspace-order-summary > .order-demand-label { display: flex; margin-top: 4px; }
.business-table td > .order-demand-label { display: flex; margin-top: 4px; }

.order-table {
  display: grid;
}

.table-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(110px, 0.7fr) 104px 110px 112px 36px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.table-row.header {
  min-height: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-soft);
  cursor: default;
}

.table-row.selected {
  background: var(--surface-selected);
  box-shadow: inset 3px 0 0 var(--blue);
}

.table-main strong,
.table-main span {
  display: block;
}

.amount-cell {
  font-weight: 800;
}

.status-badge,
.priority-badge,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag {
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.status-询盘 {
  background: var(--violet-soft);
  color: var(--violet);
}

.status-报价 {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-确认 {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-生产 {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-发货 {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-复购 {
  background: var(--green-soft);
  color: var(--green);
}

.priority-high {
  background: var(--rose-soft);
  color: var(--rose);
}

.priority-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.priority-normal {
  background: var(--green-soft);
  color: var(--green);
}

.pill {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.detail-panel {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  margin: 8px 0 6px;
  font-size: 20px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 18px;
}

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

.field-label {
  display: block;
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 4px;
}

.field-value {
  color: var(--text);
  font-weight: 700;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--track);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
}

.timeline-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}

.timeline-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.timeline-card strong {
  display: block;
  margin-bottom: 4px;
}

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

.timeline-record-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-record-head .record-delete-button { flex: 0 0 32px; }
.timeline-card > .tiny-meta { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }

.chart-wrap {
  height: 248px;
}

#trendChart {
  width: 100%;
  height: 100%;
}

.activity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  width: 100%;
}

.activity-item:last-child,
.table-row:last-child,
.timeline-card:last-child {
  border-bottom: 0;
}

.tiny-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--muted);
}

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

.report-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.report-box strong {
  display: block;
  font-size: 22px;
  margin-top: 8px;
}

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

.bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

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

.modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
}

.modal::backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(3px);
}

.modal-body {
  padding: 20px;
  background: var(--surface);
}

.modal-body.compact {
  width: min(520px, 100%);
  max-width: calc(100vw - 32px);
}

#productModal {
  width: min(820px, calc(100vw - 32px));
}

.import-modal {
  width: min(760px, calc(100vw - 32px));
}

.import-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.import-template-link {
  text-decoration: none;
}

.import-file-picker {
  position: relative;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.import-file-picker:hover {
  border-color: var(--blue);
  background: var(--info-surface);
}

.import-file-picker > svg {
  width: 28px;
  height: 28px;
  color: var(--blue);
}

.import-file-picker span,
.import-file-picker strong,
.import-file-picker small {
  display: block;
}

.import-file-picker small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.import-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.import-preview {
  min-height: 126px;
  margin-top: 14px;
}

.import-empty,
.import-loading {
  min-height: 126px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.import-empty svg,
.import-loading svg {
  width: 28px;
  height: 28px;
  color: var(--faint);
}

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

.import-summary-item {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

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

.import-summary-item strong {
  margin-top: 5px;
  font-size: 21px;
}

.import-validation {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.import-validation.success {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.import-validation.error {
  border-color: var(--danger-line);
  background: var(--rose-soft);
  color: var(--rose);
}

.import-validation.warning {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.import-validation svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.import-validation strong,
.import-validation span {
  display: block;
}

.import-validation span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.import-issues {
  max-height: 180px;
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.import-issues li {
  padding: 9px 11px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.import-issues li + li {
  border-top: 1px solid var(--line);
}

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

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.form-label-caption {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: baseline;
  gap: 3px;
}

.required-mark {
  color: var(--required-mark);
  font-size: 1.08em;
  font-weight: 900;
  line-height: 1;
}

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

.product-dimensions-field, .product-container-preview {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.product-dimensions-field legend {
  padding: 0 6px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

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

.dimension-inputs input { min-width: 0; width: 100%; }
.product-container-preview .section-head { gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.product-container-preview h3 { margin: 0; font-size: 14px; }
.container-estimate-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 12px; }
.container-estimate-values > div { min-width: 0; }
.container-estimate-values dt { color: var(--muted); font-size: 12px; }
.container-estimate-values dd { margin: 6px 0 0; color: var(--text); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.container-estimate-values small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.container-estimate-caution { line-height: 1.5; }
.container-estimate-status { color: var(--muted); font-size: 13px; }
.product-market-controls { min-width: 0; display: grid; align-content: center; gap: 6px; }
.product-market-controls .inline-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.product-market-controls input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.product-carton-toggle { display: flex; align-items: center; gap: 8px; }
.product-carton-toggle input { width: 16px; height: 16px; margin: 0; }
#productCartonEditor { display: grid; grid-column: 1 / -1; min-width: 0; gap: 12px; }
#productCartonEditor[hidden] { display: none; }
#productCartonEditor fieldset { min-width: 0; margin: 0; padding: 12px 0; border: 0; border-top: 1px solid var(--line); }
.carton-editor-head { display: flex; align-items: end; gap: 12px; margin-bottom: 10px; }
.carton-editor-head label { flex: 1; min-width: 0; }
.carton-dimension-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.product-carton-details { margin-top: 14px; }
.product-carton-details h3 { font-size: 14px; margin: 0 0 8px; }
.product-carton-details > div { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.product-carton-details span { overflow-wrap: anywhere; }
@media (max-width: 600px) { .carton-dimension-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 400px) {
  .container-estimate-values { gap: 8px; }
  .container-estimate-values dd { font-size: 14px; }
}

.customer-assignment-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.customer-assignment-field legend {
  padding: 0 5px;
  color: var(--text);
  font-weight: 800;
}

.customer-assignment-field > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.customer-assignment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  max-height: 196px;
  padding-right: 3px;
  overflow: auto;
}

.customer-assignment-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.customer-assignment-option:has(input:checked) {
  border-color: var(--blue-line);
  background: var(--surface-selected);
}

.customer-assignment-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.customer-assignment-option span,
.customer-assignment-option strong,
.customer-assignment-option small {
  display: block;
  min-width: 0;
}

.customer-assignment-option strong,
.customer-assignment-option small {
  overflow-wrap: anywhere;
}

.customer-assignment-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.customer-order-preview {
  grid-column: 1 / -1;
  padding: 11px 12px;
  border: 1px solid var(--info-line);
  border-radius: 8px;
  background: var(--info-surface);
}

.order-product-preview {
  grid-column: 1 / -1;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.order-product-preview.is-new-product {
  border-color: var(--info-line);
  background: var(--info-surface);
}

.new-product-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
}

.new-product-preview > span:last-child {
  min-width: 0;
}

.new-product-preview strong,
.new-product-preview small {
  display: block;
}

.new-product-preview small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.new-product-preview-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: var(--blue-soft);
}

.new-product-preview-icon svg {
  width: 21px;
  height: 21px;
}

.inventory-link-preview {
  grid-column: 1 / -1;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid var(--info-line);
  border-radius: 8px;
  background: var(--info-surface);
}

.order-product-preview-main,
.inventory-preview-main,
.product-table-product,
.product-link-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.order-product-preview-main > span,
.inventory-preview-main > div,
.product-table-product > span,
.product-link-main > div {
  min-width: 0;
}

.order-product-preview-main strong,
.order-product-preview-main small,
.inventory-preview-main strong,
.inventory-preview-main small,
.product-link-main strong,
.product-link-main small {
  display: block;
}

.order-product-preview-main small,
.inventory-preview-main small,
.product-link-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.empty-product-picker {
  display: grid;
  min-height: 56px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.product-thumb,
.order-product-thumb,
.product-link-thumb {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--image-placeholder);
  color: var(--faint);
}

.product-thumb {
  width: 52px;
  height: 52px;
}

.carton-mark-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--image-placeholder);
  color: var(--faint);
}

.carton-mark-table {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 108px;
  color: var(--muted);
  font-size: 12px;
}

.carton-mark-thumb.product-image-placeholder {
  display: inline-grid;
  place-items: center;
}

.carton-mark-thumb svg {
  width: 22px;
  height: 22px;
}

.order-product-thumb,
.product-link-thumb {
  width: 58px;
  height: 58px;
}

.product-image-placeholder {
  display: inline-grid;
  place-items: center;
}

.product-image-placeholder svg {
  width: 22px;
  height: 22px;
}

.product-image-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  align-items: end;
  gap: 12px;
}

.product-image-preview {
  width: 120px;
  height: 86px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-preview > span {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  color: var(--muted);
  text-align: center;
}

.product-image-preview svg {
  width: 24px;
  height: 24px;
}

.product-image-preview small {
  font-size: 10px;
}

.customer-order-preview strong,
.customer-order-preview small {
  display: block;
}

.customer-order-preview small {
  margin-top: 4px;
  color: var(--muted);
}

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

input[readonly] {
  background: var(--readonly-surface);
  color: var(--readonly-text);
  cursor: default;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.delete-warning {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  background: var(--danger-surface);
}

.delete-warning-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--rose);
  background: var(--rose-soft);
}

.delete-warning p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.delete-undo-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.delete-undo-note svg {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.action-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--toast-line);
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--toast-text);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
}

.action-toast[hidden] {
  display: none;
}

.action-toast span {
  flex: 1;
}

.action-toast button {
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--toast-text) 12%, transparent);
  color: var(--toast-text);
  font-weight: 700;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
}

.business-table-surface {
  padding: 0;
  overflow: hidden;
}

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

.business-table .table-amount-totals th,
.business-table .table-amount-totals td {
  height: auto;
  border-top: 2px solid var(--line-strong);
  border-bottom: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
}

.table-total-amount strong,
.amount-summary-item strong {
  font-variant-numeric: tabular-nums;
}

.table-amount-totals .cell-sub {
  font-weight: 400;
  font-size: 11px;
}

.amount-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding: 14px 16px;
  border-top: 2px solid var(--line-strong);
  background: var(--surface-soft);
  font-size: 13px;
}

.amount-summary-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}

.amount-summary-item > span {
  color: var(--muted);
}

.table-mobile-totals {
  display: none;
}

@media (max-width: 700px) {
  .table-mobile-totals {
    display: flex;
  }

  .table-mobile-totals .amount-summary-label {
    flex-basis: 100%;
  }

  .business-table .table-amount-totals {
    display: none;
  }
}

.table-pagination {
  min-height: 58px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
}

.pagination-summary,
.page-total,
.page-size-control {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pagination-controls,
.page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-control select,
.page-select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
}

.pagination-button {
  width: 34px;
  height: 34px;
}

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

.business-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: var(--surface);
}

.business-table th,
.business-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.business-table th {
  height: 42px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.business-table .bulk-select-cell,
.business-table .bulk-select-heading {
  width: 44px;
  min-width: 44px;
  padding-right: 8px;
  padding-left: 14px;
  text-align: center;
}

.bulk-select-cell input,
.bulk-select-heading input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.bulk-select-cell input:disabled,
.bulk-select-heading input:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.business-table tbody tr:last-child td {
  border-bottom: 0;
}

.business-table td:nth-child(2) {
  min-width: 190px;
  white-space: normal;
}

.business-table-surface[data-table-type="shipments"] .business-table td:nth-child(3) {
  min-width: 190px;
  max-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.business-table .shipment-detail-row td:nth-child(2) {
  padding-left: 28px;
  border-left: 2px solid var(--line);
}

.business-table-surface[data-table-type="orders"] .business-table-wrap {
  overflow-x: hidden;
}

.business-table-surface[data-table-type="orders"] .business-table {
  min-width: 0;
  table-layout: fixed;
}

.business-table-surface[data-table-type="orders"] .business-table th,
.business-table-surface[data-table-type="orders"] .business-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.business-table-surface[data-table-type="orders"] .business-table .bulk-select-cell,
.business-table-surface[data-table-type="orders"] .business-table .bulk-select-heading {
  width: auto;
  min-width: 0;
}

.business-table-surface[data-table-type="orders"] .business-table td:last-child {
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
}

.business-table-surface[data-table-type="orders"] .business-table td:last-child svg {
  width: 16px;
  height: 16px;
}

.business-table-surface[data-table-type="orders"] .business-table th:nth-child(1) { width: 3%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(2) { width: 16%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(3) { width: 21%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(4) { width: 6%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(5) { width: 11%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(6) { width: 11%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(7) { width: 6%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(8) { width: 8%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(9) { width: 8%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(10) { width: 7%; }
.business-table-surface[data-table-type="orders"] .business-table th:nth-child(11) { width: 3%; }

.business-table-surface[data-table-type="orders"] .business-table td:nth-child(4),
.business-table-surface[data-table-type="orders"] .business-table td:nth-child(6),
.business-table-surface[data-table-type="orders"] .business-table td:nth-child(7),
.business-table-surface[data-table-type="orders"] .business-table td:nth-child(8),
.business-table-surface[data-table-type="orders"] .business-table td:nth-child(9),
.business-table-surface[data-table-type="orders"] .business-table td:nth-child(10),
.business-table-surface[data-table-type="orders"] .business-table td:nth-child(11) {
  overflow-wrap: normal;
}

html[data-table-density="compact"] .business-table th,
html[data-table-density="compact"] .business-table td {
  padding: 9px 9px;
  font-size: 13px;
}

html[data-table-density="compact"] .business-table .bulk-select-cell,
html[data-table-density="compact"] .business-table .bulk-select-heading {
  padding-right: 5px;
  padding-left: 7px;
}

html[data-table-density="compact"] .business-table .cell-sub {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
}

html[data-table-density="compact"] .business-table .status-badge {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

html[data-table-density="comfortable"] .business-table th,
html[data-table-density="comfortable"] .business-table td {
  padding: 15px 16px;
}

.product-table-product {
  min-width: 240px;
  white-space: normal;
}

.selectable-row {
  cursor: pointer;
  transition: background 140ms ease;
}

.selectable-row:hover,
.selectable-row:focus-visible {
  background: var(--surface-hover);
  outline: 0;
}

.selectable-row.selected {
  background: var(--surface-selected);
  box-shadow: inset 3px 0 0 var(--blue);
}

.row-highlight-red { --row-highlight-color: #ef5b65; }
.row-highlight-amber { --row-highlight-color: #e8a52b; }
.row-highlight-green { --row-highlight-color: #2eaf7d; }
.row-highlight-blue { --row-highlight-color: #4c8df6; }
.row-highlight-violet { --row-highlight-color: #8c6de8; }

.selectable-row[class*="row-highlight-"] {
  background: color-mix(in srgb, var(--row-highlight-color) 18%, var(--surface));
  box-shadow: inset 4px 0 0 var(--row-highlight-color);
}

.selectable-row[class*="row-highlight-"]:hover,
.selectable-row[class*="row-highlight-"]:focus-visible,
.selectable-row.selected[class*="row-highlight-"] {
  background: color-mix(in srgb, var(--row-highlight-color) 27%, var(--surface));
  box-shadow: inset 4px 0 0 var(--row-highlight-color);
}

.cell-sub,
.record-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.order-customer-filter {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.order-customer-filter:hover,
.order-customer-filter:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  outline: 0;
}

.order-ledger-product { display: block; color: var(--text); font-weight: 700; }
.order-ledger-customer .order-customer-filter { color: var(--muted); font-size: inherit; font-weight: 400; }
.order-ledger-customer .order-customer-filter:hover,
.order-ledger-customer .order-customer-filter:focus-visible { color: var(--blue); }

.remaining-quantity-cell strong {
  color: var(--muted);
}

.remaining-quantity-cell.tail strong {
  color: var(--amber);
}

.remaining-quantity-cell.complete strong,
.remaining-complete-note {
  color: var(--green);
}

.remaining-tail-note {
  color: var(--amber);
  font-weight: 800;
}

.remaining-inspection-note {
  color: var(--muted);
  font-weight: 700;
}

.order-deadline-status.overdue {
  color: var(--red);
  font-weight: 800;
}

.order-deadline-status.risk {
  color: var(--red);
  font-weight: 800;
}

.order-deadline-status.complete {
  color: var(--green);
  font-weight: 800;
}

.order-deadline-status.soon {
  color: var(--amber);
  font-weight: 800;
}

.shipment-date-status.overdue {
  color: var(--red);
  font-weight: 800;
}

.shipment-date-status.complete {
  color: var(--green);
  font-weight: 800;
}

.shipment-date-status.transit {
  color: var(--blue);
  font-weight: 800;
}

.shipment-date-status.cancelled {
  color: var(--muted);
  font-weight: 700;
}

.shipment-date-status.soon {
  color: var(--amber);
  font-weight: 800;
}

.inventory-product-preview {
  width: 380px;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-positive {
  color: var(--green);
  font-weight: 800;
}

.amount-negative {
  color: var(--rose);
  font-weight: 800;
}

.status-success {
  color: var(--green);
  background: var(--green-soft);
}

.status-info {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-danger {
  color: var(--rose);
  background: var(--rose-soft);
}

.detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.flow-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.flow-item.active {
  border-color: var(--blue-line);
  background: var(--surface-selected);
}

.flow-item > span:first-child,
.flow-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.flow-item strong {
  display: block;
  margin: 5px 0 2px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-progress {
  display: block;
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

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

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

.customer-link-block {
  padding: 12px;
  border: 1px solid var(--info-line);
  border-radius: 8px;
  background: var(--info-surface);
}

.product-link-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.product-detail-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.product-detail-gallery .product-detail-image {
  height: 156px;
}

.product-media-label {
  display: block;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.source-link-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.source-link-block strong,
.source-link-block small {
  display: block;
}

.source-link-block small {
  margin-top: 3px;
  color: var(--muted);
}

.source-link-block a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.source-link-block svg {
  width: 15px;
  height: 15px;
}

.product-detail-image {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.product-detail-image.product-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--faint);
}

.product-detail-image.product-image-placeholder svg {
  width: 38px;
  height: 38px;
}

.customer-link-block p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.customer-link-block .terms-inline {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.customer-link-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.customer-link-action svg {
  width: 15px;
  height: 15px;
}

.order-identifiers {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.identifier-title {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.identifier-grid div {
  min-width: 0;
}

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

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

.identifier-grid strong {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.terms-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.terms-summary > div {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

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

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

.terms-summary strong {
  margin-top: 4px;
  font-size: 17px;
}

.terms-summary p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.customer-ops-board {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.customer-ops-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.customer-ops-metrics > div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.customer-ops-metrics span,
.customer-ops-metrics strong,
.customer-ops-metrics small {
  display: block;
}

.customer-ops-metrics span,
.customer-ops-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.customer-ops-metrics strong {
  margin: 5px 0 3px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.customer-inspection-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.customer-inspection-strip strong {
  margin-left: 3px;
  color: var(--text);
}

.customer-order-statuses {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.inspection-summary {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.inspection-summary-grid > div {
  min-width: 0;
}

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

.inspection-summary-grid span {
  color: var(--muted);
  font-size: 11px;
}

.inspection-summary-grid strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.inspection-summary > p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.order-quick-actions {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.quick-action-grid button {
  width: 100%;
  justify-content: center;
}

.quick-action-status {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.quick-action-status span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.quick-action-status strong {
  color: var(--text);
  text-align: right;
}

.inspection-order-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid var(--info-line);
  border-radius: 8px;
  background: var(--info-surface);
}

.inspection-order-preview strong,
.inspection-order-preview small {
  display: block;
}

.inspection-order-preview small {
  margin-top: 4px;
  color: var(--muted);
}

.inspection-guidance {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 12px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: var(--muted);
  line-height: 1.5;
}

.inspection-guidance svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--blue);
}

.order-reminder-summary {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.order-reminder-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.order-reminder-line + .order-reminder-line {
  border-top: 1px solid var(--line);
}

.order-reminder-line strong,
.order-reminder-line small {
  display: block;
}

.order-reminder-line small {
  margin-top: 3px;
  color: var(--muted);
}

.terms-example {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 12px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: var(--muted);
  line-height: 1.5;
}

.terms-example svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--blue);
}

.reminder-detail-card {
  align-items: start;
}

.full-button {
  width: 100%;
}

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

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

.record-card strong {
  display: block;
}

.record-card-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.record-edit-button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--blue);
}

.record-edit-button:hover,
.record-edit-button:focus-visible {
  border-color: var(--blue-line);
  background: var(--blue-soft);
  outline: 0;
}

.record-edit-button svg {
  width: 16px;
  height: 16px;
}

.row-action-cell {
  width: 48px;
  text-align: center;
}

.table-edit-button {
  margin: 0 auto;
}

.product-customer-link-card .product-link-main {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.record-delete-button {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--faint);
}

.record-delete-button:hover {
  border-color: var(--danger-line);
  background: var(--danger-hover-surface);
  color: var(--rose);
}

.record-delete-button svg {
  width: 16px;
  height: 16px;
}

.product-record-link {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.product-record-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.compact-empty {
  padding: 16px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

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

.archive-customer-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--card-shadow);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.archive-customer-card:hover,
.archive-customer-card.selected {
  border-color: var(--focus-line);
  box-shadow: var(--card-shadow-hover);
}

.archive-customer-card.selected {
  outline: 2px solid var(--focus-ring);
}

.archive-customer-head,
.archive-card-foot,
.archive-year-row,
.archive-detail-year,
.archive-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.archive-customer-head > span:first-child,
.archive-year-row > span,
.archive-order-row > span:first-child {
  min-width: 0;
}

.archive-customer-head strong,
.archive-customer-head small,
.archive-year-row b,
.archive-year-row small,
.archive-order-row strong,
.archive-order-row small,
.archive-check-item strong,
.archive-check-item small {
  display: block;
}

.archive-customer-head > span:first-child > strong {
  font-size: 16px;
}

.archive-customer-head small,
.archive-year-row small,
.archive-order-row small,
.archive-check-item small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.archive-customer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.archive-customer-metrics > span {
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: var(--surface-soft);
}

.archive-customer-metrics small,
.archive-customer-metrics strong {
  display: block;
}

.archive-customer-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.archive-customer-metrics strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-year-list {
  display: block;
  margin-top: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.archive-year-row {
  padding: 8px 0;
}

.archive-year-row + .archive-year-row {
  border-top: 1px solid var(--line);
}

.archive-year-row > span {
  text-align: right;
}

.archive-card-foot {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.archive-card-foot svg {
  width: 16px;
  height: 16px;
}

.archive-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 40px;
  text-align: center;
}

.archive-empty svg {
  width: 34px;
  height: 34px;
  color: var(--faint);
}

.archive-empty h2,
.archive-empty p {
  margin: 8px 0 0;
}

.archive-empty p {
  color: var(--muted);
}

.archive-checklist,
.archive-detail-years,
.archive-order-list {
  display: grid;
  gap: 8px;
}

.archive-check-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.archive-check-item svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.archive-check-item.pending svg {
  color: var(--faint);
}

.archive-detail-year,
.archive-order-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.archive-detail-year > strong,
.archive-order-row > span:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.archive-order-row > span:last-child strong {
  color: var(--green);
}

.cloud-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.cloud-login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cloud-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.cloud-login-brand .brand-mark {
  flex: 0 0 auto;
}

.cloud-login-brand h1 {
  margin: 3px 0 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.cloud-login-panel > p {
  margin: 0 0 20px;
  color: var(--muted);
}

.cloud-login-form {
  display: grid;
  gap: 16px;
}

.cloud-login-form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}

.cloud-login-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  color: var(--text);
  background: var(--surface);
}

.cloud-login-form input:focus {
  border-color: var(--focus-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.cloud-login-message {
  min-height: 20px;
  color: var(--rose);
  font-size: 13px;
}

.cloud-login-submit {
  width: 100%;
  justify-content: center;
}

.cloud-account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.cloud-sync-status {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}

.cloud-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.cloud-sync-status[data-status="synced"] .cloud-sync-dot {
  background: var(--green);
}

.cloud-sync-status[data-status="saving"] .cloud-sync-dot,
.cloud-sync-status[data-status="loading"] .cloud-sync-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.cloud-sync-status[data-status="error"] .cloud-sync-dot,
.cloud-sync-status[data-status="conflict"] .cloud-sync-dot {
  background: var(--rose);
}

.cloud-sync-status[data-status="conflict"] {
  border-color: var(--danger-line);
  color: var(--rose);
  background: var(--danger-surface);
}

.cloud-user {
  max-width: 142px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-active-view="dashboard"] .content-grid,
html[data-active-view="reports"] .content-grid,
html[data-active-view="notebook"] .content-grid,
html[data-active-view="accounts"] .content-grid {
  grid-template-columns: minmax(0, 1fr);
}

html[data-active-view="dashboard"] .detail-panel,
html[data-active-view="reports"] .detail-panel,
html[data-active-view="notebook"] .detail-panel,
html[data-active-view="accounts"] .detail-panel {
  display: none;
}

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

.monthly-controls,
.monthly-balance-head,
.monthly-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.monthly-controls {
  align-items: flex-end;
}

.monthly-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.monthly-controls input,
.monthly-controls select {
  width: 180px;
  max-width: 100%;
  height: 38px;
  min-width: 0;
}

.monthly-controls select {
  width: 210px;
}

.monthly-section-title {
  margin: 0 0 12px;
  font-size: 15px;
}

.monthly-metrics .metric-value {
  margin: 12px 0 0;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.monthly-error {
  color: var(--rose);
  font-size: 13px;
}

.monthly-table-head {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.monthly-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.monthly-table td {
  overflow-wrap: anywhere;
  max-width: 220px;
}

.monthly-expand-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.monthly-expand-button:hover { color: var(--blue); }
.monthly-expand-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.monthly-expand-button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.monthly-expand-button span { min-width: 0; overflow-wrap: anywhere; }
.monthly-expand-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.monthly-title-row { background: var(--surface-soft); }
.monthly-title-button { padding-left: 18px; font-size: 12px; }
.monthly-detail-row > td { padding: 0; max-width: none; }
.monthly-title-detail { padding: 14px 18px 16px; border-left: 3px solid var(--blue); }
.monthly-detail-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.monthly-ledger-tabs { margin: 12px 0; flex-wrap: wrap; }
.monthly-ledger-tabs .filter-tab { display: inline-flex; gap: 6px; align-items: center; }
.monthly-ledger-tabs .filter-tab span { font-size: 11px; color: var(--muted); }
.monthly-record-scroll { max-width: 100%; overflow-x: auto; }
.monthly-record-table { min-width: 760px; }
.monthly-record-table th { font-size: 11px; }
.monthly-record-table td { font-size: 12px; }
html[data-active-view="receipts"][data-ledger-filter="unallocated"] .content-grid { grid-template-columns: minmax(0, 1fr); }
html[data-active-view="receipts"][data-ledger-filter="unallocated"] .detail-panel { display: none; }
html[data-active-view="receipts"][data-ledger-filter="unallocated"] .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-active-view="receipts"][data-ledger-filter="unallocated"] .business-table { min-width: 920px; }
.business-table td.unallocated-receipt-note { min-width: 180px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; }

.dashboard-metric {
  min-height: 170px;
  gap: 16px;
}

.dashboard-layout-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dashboard-layout-controls label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-layout-controls select {
  width: 210px;
  max-width: 100%;
  min-width: 0;
  height: 38px;
}

.dashboard-layout-controls .tiny-meta {
  margin-left: auto;
}

.dashboard-empty {
  grid-column: 1 / -1;
  padding: 24px 0;
  color: var(--muted);
}

.dashboard-metric-select {
  width: 100%;
  min-width: 0;
  flex: 1;
  height: 32px;
  padding: 0 4px;
  border-color: transparent;
  background-color: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-metric-select:hover {
  border-color: var(--line-strong);
}

.dashboard-remove {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-color: transparent;
  color: var(--faint);
}

.dashboard-remove:hover {
  border-color: var(--danger-line);
  color: var(--rose);
  background: var(--rose-soft);
}

.dashboard-remove svg {
  width: 14px;
  height: 14px;
}

.dashboard-open {
  display: flex;
  flex: 1;
  width: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.dashboard-open:hover .metric-value {
  color: var(--blue);
}

.dashboard-open:focus-visible {
  outline: 2px solid var(--focus-line);
  outline-offset: 4px;
}

.dashboard-metric .metric-caption small {
  display: block;
  margin-top: 4px;
  color: var(--faint);
}

.dashboard-metric .metric-value {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dashboard-metric-foot,
.dashboard-month-controls,
.dashboard-scope {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-metric-foot {
  justify-content: space-between;
  color: var(--muted);
}

.dashboard-metric-foot > svg {
  width: 16px;
  flex-shrink: 0;
}

.dashboard-month-controls {
  flex-wrap: wrap;
}

.dashboard-month-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-month-label input {
  width: 160px;
  min-width: 0;
  height: 38px;
}

.dashboard-month-controls > button {
  align-self: flex-end;
}

.dashboard-scope {
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dashboard-scope > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-management-surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-loading-metric {
  grid-column: 1 / -1;
}

.account-members-head,
.account-member-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.7fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
}

.account-members-head {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-member-row {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.account-member-row:last-child {
  border-bottom: 0;
}

.account-member-row.is-inactive {
  background: color-mix(in srgb, var(--surface) 82%, var(--faint));
}

.account-person strong,
.account-person span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-person span,
.account-username,
.account-updated {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-role-select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
}

.account-role-select:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.account-actions .secondary-button,
.account-actions .danger-button {
  min-height: 34px;
  padding: 0 10px;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.account-status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.account-status.is-inactive::before {
  background: var(--faint);
}

.credential-fields {
  display: grid;
  gap: 14px;
}

.password-modal {
  width: min(460px, calc(100vw - 32px));
}

.credential-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.credential-fields input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
}

html[data-cloud-role="editor"] #exportBtn,
html[data-cloud-role="editor"] .danger-button,
html[data-cloud-role="editor"] .record-delete-button,
html[data-cloud-role="editor"] [data-delete-record] {
  display: none !important;
}

html[data-cloud-role="viewer"] .app-shell #primaryActionBtn,
html[data-cloud-role="viewer"] .app-shell #undoActionBtn,
html[data-cloud-role="viewer"] #exportBtn,
html[data-cloud-role="viewer"] #importExcelBtn,
html[data-cloud-role="viewer"] .danger-button,
html[data-cloud-role="viewer"] .record-delete-button,
html[data-cloud-role="viewer"] [data-delete-record],
html[data-cloud-role="viewer"] [data-business-action],
html[data-cloud-role="viewer"] [data-edit-shipment],
html[data-cloud-role="viewer"] [data-edit-invoice],
html[data-cloud-role="viewer"] [data-edit-invoice-contract-return],
html[data-cloud-role="viewer"] [data-edit-order-contract-return],
html[data-cloud-role="viewer"] [data-edit-product-link],
html[data-cloud-role="viewer"] [data-reminder-action],
html[data-cloud-role="viewer"] [data-highlight-color],
html[data-cloud-role="viewer"] #markColorBtn,
html[data-cloud-role="viewer"] #addFollowBtn,
html[data-cloud-role="viewer"] #addProductCustomerLinkBtn,
html[data-cloud-role="viewer"] #editInspectionBtn,
html[data-cloud-role="viewer"] #editInventoryBtn,
html[data-cloud-role="viewer"] #editOrderBtn,
html[data-cloud-role="viewer"] #editProductBtn,
html[data-cloud-role="viewer"] #editTermsBtn,
html[data-cloud-role="viewer"] #newCustomerInventoryBtn,
html[data-cloud-role="viewer"] #newCustomerInventoryFromCustomerBtn,
html[data-cloud-role="viewer"] #newCustomerOrderBtn,
html[data-cloud-role="viewer"] #newCustomerProductBtn,
html[data-cloud-role="viewer"] #newProductOrderBtn,
html[data-cloud-role="viewer"] #nextStageBtn,
html[data-cloud-role="viewer"] #previousStageBtn,
html[data-cloud-role="viewer"] #quickInventoryBtn,
html[data-cloud-role="viewer"] dialog:not(#changePasswordModal) form .modal-actions .primary-button,
html[data-cloud-role="viewer"] dialog:not(#changePasswordModal) form .modal-actions .danger-button {
  display: none !important;
}

@media (max-width: 1480px) and (min-width: 1181px) {
  html[data-active-view="orders"] .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-active-view="orders"] .detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

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

  .two-column {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .app-shell {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: 0;
    width: 100%;
    padding: 12px;
    gap: 12px;
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    min-width: max-content;
  }

  .topbar {
    position: static;
    min-width: 0;
    width: 100%;
    height: auto;
    flex-wrap: wrap;
    padding: 12px;
  }

  .search-box {
    max-width: 100%;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .cloud-account {
    max-width: 100%;
    flex: 1 1 auto;
  }

  .cloud-user {
    max-width: min(142px, 30vw);
  }

  .content-grid {
    width: 100%;
    padding: 14px 12px;
  }

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

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

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-row,
  .filter-tabs,
  .view-filter-controls {
    min-width: 0;
    max-width: 100%;
  }

  .view-filter-controls {
    justify-content: flex-start;
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .table-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .business-table-surface[data-table-type="orders"] .business-table-wrap {
    overflow-x: auto;
  }

  .business-table-surface[data-table-type="orders"] .business-table {
    min-width: 980px;
    table-layout: fixed;
  }

  .pagination-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .table-row {
    grid-template-columns: minmax(170px, 1fr) 84px 86px;
  }

  .table-row.header {
    display: none;
  }

  .hide-mobile {
    display: none;
  }

  .form-grid,
  .field-grid,
  .customer-assignment-grid {
    grid-template-columns: 1fr;
  }

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

  .account-members-head {
    display: none;
  }

  .account-member-row {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 0.7fr);
  }

  .account-member-row .account-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .advanced-filter-grid {
    grid-template-columns: 1fr;
  }

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

  .archive-customer-metrics {
    grid-template-columns: 1fr;
  }

  .archive-order-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-order-row > span:last-child {
    text-align: left;
  }

  .metrics-grid,
  .report-grid,
  .flow-summary {
    grid-template-columns: 1fr;
  }

  .date-pill {
    display: none;
  }

  .cloud-user {
    display: none;
  }

  .cloud-sync-status {
    max-width: calc(100vw - 154px);
  }

  .cloud-sync-status span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

  .account-member-row .account-actions {
    grid-column: auto;
  }

  .undo-button span {
    display: none;
  }

  .undo-button {
    width: 38px;
    padding: 0;
  }

  .action-toast {
    right: 12px;
    bottom: 12px;
  }

  .advanced-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .row-highlight-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .row-highlight-choices {
    width: 100%;
    justify-content: flex-start;
  }

  .bulk-table-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .advanced-filter-head > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .filter-actions {
    width: 100%;
  }

  .filter-actions button {
    flex: 1;
  }

  .product-image-field {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .product-image-preview {
    width: 100%;
    height: 160px;
  }

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

  .product-detail-gallery .product-detail-image {
    height: 190px;
  }

  .import-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .advanced-filter-grid,
  .identifier-grid,
  .terms-summary,
  .customer-ops-metrics,
  .inspection-summary-grid,
  .order-reminder-line {
    grid-template-columns: 1fr;
  }

  .terms-summary p {
    grid-column: 1;
  }
}
.po-mode-toggle { display: flex; align-items: center; gap: 8px; }
.po-mode-toggle input { width: 16px; height: 16px; }
.po-editor { border-top: 1px solid var(--line); padding-top: 14px; }
.form-grid > .po-editor, .form-grid > .po-allocation-editor { grid-column: 1 / -1; min-width: 0; }
.po-editor[hidden], .po-allocation-editor[hidden] { display: none; }
.po-allocation-head, .po-progress-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.po-editor-row { display: grid; grid-template-columns: minmax(120px, 2fr) minmax(80px, 1fr) minmax(80px, 1fr) minmax(130px, 1.4fr) 38px; gap: 10px; align-items: end; margin-top: 12px; }
.po-editor-row label, .po-allocation-row { min-width: 0; }
.po-editor-row { align-items: start; }
.po-editor-row > .icon-button { align-self: end; }
.order-price-control { position: relative; min-width: 0; }
.order-price-control > input { padding-right: 44px; }
.order-price-control > .order-price-refresh {
  position: absolute;
  right: 5px;
  top: 27px;
  width: 30px;
  height: 30px;
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.order-price-control > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.order-price-control > .order-price-refresh[hidden] { display: none; }
.order-price-error {
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--rose-strong);
  background: var(--danger-surface);
  border: 1px solid var(--danger-line);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.order-price-error[hidden] { display: none; }
.po-editor-row input { width: 100%; min-width: 0; }
.po-editor-row.multi-product-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 0; border-bottom: 1px solid var(--line); }
.product-line-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; grid-column: 1 / -1; }
.product-line-fields label { min-width: 0; }
.product-line-fields input, .product-line-fields select { width: 100%; min-width: 0; }
.product-line-amount { grid-column: 1 / -1; font-weight: 700; text-align: right; }
.multi-product-row > button { justify-self: end; grid-column: 2; }
.po-open-button { display: inline-flex; gap: 5px; align-items: center; color: var(--blue); background: transparent; border: 0; padding: 5px 0; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.po-open-button svg { width: 14px; height: 14px; flex: none; }
.po-progress-modal { max-width: 1000px; width: calc(100% - 24px); }
#addPOModal { max-width: 560px; }
#addPOModal .modal-body.compact { max-width: none; }
.po-progress-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.po-progress-head > strong { overflow-wrap: anywhere; }
.po-progress-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.po-progress-values > div { min-width: 0; }
.po-progress-values span, .po-progress-values small { display: block; font-size: 12px; color: var(--muted); }
.po-progress-values strong { display: block; font-size: 14px; margin-top: 5px; overflow-wrap: anywhere; }
.po-summary-lines { display: grid; gap: 8px; margin-bottom: 8px; }
.po-summary-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; font-size: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.po-summary-line strong { overflow-wrap: anywhere; }
.po-summary-line small { display: block; margin-top: 4px; color: var(--muted); }
.contract-return-fields { border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.contract-return-fields[hidden] { display: none; }
.contract-return-fields .contract-return-check { display: flex; align-items: center; gap: 8px; }
.contract-return-check input[type="checkbox"] { width: 16px; height: 16px; flex: none; }
.contract-return-fields .form-grid { margin-top: 12px; }
.po-allocation-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 12px; margin: 10px 0; }
.po-allocation-row small { display: block; margin-top: 4px; color: var(--muted); }
@media (max-width: 700px) {
  .po-editor-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .po-editor-row label:first-child { grid-column: 1 / -1; }
  .po-editor-row button { grid-column: 2; justify-self: end; }
  .po-progress-values { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .po-allocation-row { grid-template-columns: minmax(0, 1fr) 90px; }
}
/* Keep the current view visible while the idle connection is revalidated. */
.cloud-resume-notice {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 16px #0002;
  font-size: 13px;
}

/* Shared work surfaces and the order-centered workspace. */
:root {
  --bg: #f8fafc;
  --workspace-sidebar: #ffffff;
  --workspace-sidebar-text: #475467;
  --card-shadow: none;
  --shadow: 0 8px 24px rgba(22, 32, 51, 0.06);
}

html[data-theme="soft"] {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --workspace-sidebar: #fafbfc;
  --workspace-sidebar-text: #475467;
}

html[data-theme="dark"] {
  --workspace-sidebar: #15181b;
  --workspace-sidebar-text: #bdc5ce;
}

body { letter-spacing: 0; }
html[data-theme="custom"] #mainContent, html[data-theme="custom"] .page-head { color: var(--page-text); }
html[data-theme="custom"] :is(.surface, .sidebar, .topbar, .detail-panel, .order-browser, .modal, .appearance-popover, .metrics-grid, .stage-column, .report-box, .cloud-login-panel, .monthly-table-wrap, .account-management-surface, .global-filter-panel, .advanced-filter-panel) { color: var(--text); }
html[data-theme="custom"] .primary-button { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
html[data-theme="custom"] .primary-button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
html[data-theme="custom"] .brand-mark { color: var(--brand-text); }
html[data-theme="custom"] .workspace-step.complete .workspace-step-icon { color: var(--brand-text); }
html[data-theme="custom"] .workspace-filter-count { color: var(--on-blue); }
html[data-theme="custom"] .row-highlight-red { --row-highlight-bg: var(--rose-soft); }
html[data-theme="custom"] .row-highlight-amber { --row-highlight-bg: var(--amber-soft); }
html[data-theme="custom"] .row-highlight-green { --row-highlight-bg: var(--green-soft); }
html[data-theme="custom"] .row-highlight-blue { --row-highlight-bg: var(--blue-soft); }
html[data-theme="custom"] .row-highlight-violet { --row-highlight-bg: var(--violet-soft); }
html[data-theme="custom"] .selectable-row[class*="row-highlight-"] { background: var(--row-highlight-bg); }
html[data-theme="custom"] .page-head .eyebrow { color: var(--page-text); }
.appearance-popover { position: fixed; right: auto; width: 258px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 90px); overflow-y: auto; }
.custom-appearance-fields { display: grid; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.custom-appearance-fields label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); font-size: 12px; }
.custom-appearance-fields input[type="color"] { width: 72px; height: 30px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); cursor: pointer; }
.appearance-swatches { display: flex; gap: 9px; margin-bottom: 3px; }
.appearance-swatch { width: 35px; height: 30px; flex: 0 0 35px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--swatch-color); box-shadow: inset 8px 0 var(--swatch-accent); }
.appearance-swatch[aria-pressed="true"] { outline: 2px solid var(--blue); outline-offset: 2px; }
.shipment-batch-toggle { display: flex !important; align-items: center; gap: 9px; min-height: 32px; color: var(--text); }
.shipment-batch-toggle input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.shipment-batch-editor { grid-column: 1 / -1; min-width: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.shipment-batch-scope { color: var(--muted); font-size: 12px; margin-bottom: 12px; overflow-wrap: anywhere; }
.shipment-batch-order { padding: 14px 0; border-bottom: 1px solid var(--line); }
.shipment-batch-order-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; gap: 12px; }
.shipment-batch-order-head strong { font-size: 15px; overflow-wrap: anywhere; }
.shipment-batch-contract { margin: 8px 0 12px; }
.shipment-batch-line { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: center; gap: 14px; padding: 9px 0; }
.shipment-batch-line strong { font-size: 13px; overflow-wrap: anywhere; }
.shipment-batch-line small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.shipment-batch-line label { font-size: 12px; }
.shipment-batch-subtotal { display: flex; justify-content: flex-end; gap: 10px; font-size: 12px; margin-top: 10px; color: var(--muted); }
.shipment-batch-subtotal strong { color: var(--text); }
.shipment-batch-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 16px; }
.shipment-batch-total { padding: 14px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.shipment-batch-error { margin-top: 12px; padding: 10px; color: var(--rose); background: var(--rose-soft); border-left: 3px solid var(--rose); overflow-wrap: anywhere; }
.shipment-volume-preview { grid-column: 1 / -1; min-width: 0; border-block: 1px solid var(--line); padding: 12px 0; }
.shipment-volume-head, .shipment-volume-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shipment-volume-head { margin-bottom: 10px; }
.shipment-volume-head h3 { margin: 0; font-size: 14px; }
.shipment-volume-summary { margin-bottom: 8px; }
.shipment-volume-summary strong { font-size: 18px; color: var(--blue); overflow-wrap: anywhere; }
.shipment-volume-summary span { font-size: 12px; color: var(--muted); }
.shipment-volume-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, auto); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.shipment-volume-line > div { min-width: 0; overflow-wrap: anywhere; }
.shipment-volume-line small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.shipment-volume-line-total { text-align: right; }
.shipment-volume-cell { min-width: 120px; font-variant-numeric: tabular-nums; }
.shipment-volume-cell strong { white-space: normal; overflow-wrap: anywhere; }
#refreshShipmentPackaging.active { color: var(--blue); background: var(--blue-soft); }
@media (max-width: 400px) {
  .shipment-volume-line { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .shipment-volume-line-total { text-align: left; }
}
@media (max-width: 520px) {
  .shipment-batch-line { grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; }
  .shipment-batch-add { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .shipment-batch-add button { justify-self: end; }
}
.app-shell { grid-template-columns: 196px minmax(0, 1fr); }
.sidebar {
  padding: 18px 10px;
  gap: 20px;
  border-right: 1px solid var(--line);
  background: var(--workspace-sidebar);
  color: var(--text);
}
.brand { gap: 9px; padding: 0 8px 18px; border-color: var(--line); }
.brand-mark { background: var(--teal); border-radius: 7px; }
.brand strong { font-size: 18px; }
.brand span, .mini-label, .sidebar-footer span { color: var(--muted); }
.nav-list { gap: 5px; }
.nav-item { height: 42px; padding: 0 12px; color: var(--workspace-sidebar-text); }
.nav-item:hover { color: var(--text); background: var(--surface-soft); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.nav-count { background: var(--amber-soft); color: var(--amber); }
.sidebar-footer { padding: 14px 8px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.today-count { color: var(--text); font-size: 26px; }
.topbar { min-height: 64px; height: auto; padding: 12px 20px; gap: 12px; background: var(--surface); backdrop-filter: none; }
.search-box { max-width: 648px; min-width: 120px; height: 38px; border-radius: 6px; background: var(--surface-soft); }
.topbar-actions { gap: 7px; min-width: 0; flex-shrink: 0; }
.date-pill { padding: 0 8px; border: 0; background: none; font-size: 12px; }
.undo-button { width: 36px; padding: 0; }
.undo-button span { display: none; }
.cloud-user { max-width: 136px; font-size: 11px; }
.icon-button, .primary-button, .secondary-button, .danger-button, .filter-tab { border-radius: 6px; }
.content-grid { gap: 18px; padding: 24px 20px; grid-template-columns: minmax(0, 1fr) 300px; }
.page-head { align-items: center; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; }
.page-head > div > p { display: none; }
.surface { box-shadow: none; border: 0; border-radius: 0; }
.business-table-surface { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics-grid { gap: 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics-grid > .metric { min-height: 104px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 15px 18px; }
.metrics-grid > .metric:last-child { border-right: 0; }
.metrics-grid > .metric-action.active { background: var(--blue-soft); box-shadow: inset 0 -2px var(--blue); }
.metric-value { font-size: 24px; }
.metric-icon { width: 30px; height: 30px; border-radius: 6px; }
.detail-panel { border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.detail-head { padding: 18px; }
.detail-head h2 { font-size: 19px; }
.detail-body { gap: 20px; }
.table-toolbar { padding: 16px 12px; }
.table-toolbar h2, .section-head h2 { font-size: 16px; }
.business-table th { font-weight: 600; font-size: 12px; }
.business-table td { line-height: 1.5; }
.business-table .cell-sub { margin-top: 3px; }
.table-pagination { border-top: 1px solid var(--line); }
.modal { border-radius: 8px; }
.modal-body { padding: 24px; }
.modal-head h2 { font-size: 21px; }
.form-grid { gap: 18px 16px; }
.form-grid label { color: var(--muted); font-size: 13px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea { border-radius: 6px; background: var(--surface); font-size: 14px; color: var(--text); }
.modal-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.order-layout-control { display: inline-flex; gap: 3px; }
.order-layout-control .active { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-line); }

html[data-active-view="orders"][data-order-layout="workspace"] .content-grid {
  padding: 0;
  gap: 0;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--surface);
}
html[data-active-view="orders"][data-order-layout="workspace"] #mainContent { border-right: 1px solid var(--line); }
html[data-active-view="orders"][data-order-layout="workspace"] #detailPanel { position: static; top: auto; border: 0; max-height: none; overflow: visible; }
.order-browser { min-width: 0; background: var(--surface); }
.order-browser-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.order-browser-head h1 { margin: 0 0 4px; font-size: 19px; }
.order-browser-tools { display: flex; gap: 3px; }
.order-browser-tools .icon-button { width: 30px; height: 32px; padding: 0; }
.order-browser-toggle { display: none; }
.order-browser-filters { padding: 14px; border-bottom: 1px solid var(--line); }
.order-browser-query-row { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.order-browser-query-row > .icon-button { position: relative; width: 28px; height: 32px; padding: 0; flex-shrink: 0; }
.order-browser-query-row > .icon-button.active { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-line); }
.workspace-filter-count { position: absolute; top: -5px; right: -3px; min-width: 14px; padding: 0 3px; border-radius: 4px; background: var(--blue); color: #fff; font-size: 10px; line-height: 14px; }
.order-browser-search { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; min-height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface); }
.order-browser-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.order-browser-search input { min-width: 0; width: 100%; padding: 7px 0; border: 0; background: transparent; color: var(--text); font-size: 12px; outline: 0; }
.order-browser-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.order-browser-filters .filter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.order-browser-filters .filter-tab { padding: 0 5px; font-size: 12px; }
.order-browser .advanced-filter-grid { grid-template-columns: minmax(0, 1fr); }
.order-browser .advanced-filter-head { flex-wrap: wrap; }
.order-browser .global-filter-panel { margin: 0; border: 0; border-radius: 0; }
.order-browser-selection { display: flex; align-items: center; gap: 5px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.order-browser-selection label { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; margin-right: auto; }
.order-browser-selection .icon-button { width: 28px; height: 28px; padding: 0; }
.order-browser-selection .danger-button { background: none; color: var(--rose); border-color: transparent; }
.order-browser input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.workspace-order-item { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; min-height: 110px; padding: 15px 13px; border-bottom: 1px solid var(--line); }
.workspace-order-item.selected { background: var(--surface-selected); box-shadow: inset 3px 0 var(--blue); }
.workspace-order-checkbox { padding-top: 4px; }
.workspace-order-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.workspace-order-title > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.workspace-order-title .status-badge { font-size: 10px; flex-shrink: 0; }
.workspace-order-customer { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.workspace-order-product { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-order-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.workspace-order-meta .danger { color: var(--rose); }
.order-browser-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.order-browser-total strong { color: var(--text); }
.order-browser .table-pagination { padding: 12px; flex-wrap: wrap; gap: 10px; }
.order-browser .pagination-controls { justify-content: flex-start; gap: 3px; flex-wrap: wrap; }
.order-browser .page-size-control > span { display: none; }
.order-browser .page-size-control select { max-width: 64px; }
.order-browser .pagination-button { width: 26px; height: 30px; }
.order-browser .page-select { min-width: 76px; max-width: 80px; }
.order-browser .row-highlight-choices { display: flex; flex-wrap: wrap; }
.order-browser .row-highlight-panel { padding: 12px; }
.order-workspace { min-width: 0; }
.order-workspace-head { padding: 24px 24px 0; }
.workspace-breadcrumb { display: flex; align-items: center; gap: 7px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.workspace-breadcrumb svg { width: 16px; height: 16px; }
.workspace-order-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.workspace-order-heading > div:first-child { flex: 1; min-width: 220px; }
.workspace-order-heading-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.workspace-order-heading h1 { margin: 0; font-size: 26px; line-height: 1.3; overflow-wrap: anywhere; }
.workspace-current-customer { font-size: 15px; font-weight: 600; }
.workspace-order-facts { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.workspace-commands { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.workspace-more { position: relative; }
.workspace-more-menu { position: absolute; z-index: 15; right: 0; top: calc(100% + 6px); width: 178px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.workspace-more-menu button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 8px 9px; border: 0; background: none; color: var(--text); text-align: left; font-size: 13px; }
.workspace-more-menu button:hover { background: var(--surface-soft); }
.workspace-more-menu .danger-button { color: var(--rose); }
.workspace-more-menu svg { width: 16px; height: 16px; }
.customer-note-identity { margin: -4px 0 20px; color: var(--muted); font-size: 13px; }
.customer-notebook .section-head { flex-wrap: wrap; gap: 14px; }
.customer-note-search { display: flex; align-items: center; gap: 8px; min-height: 36px; width: 230px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); }
.customer-note-search svg { flex-shrink: 0; width: 16px; height: 16px; }
.customer-note-search input { width: 100%; min-width: 0; padding: 8px 0; border: 0; background: transparent; color: var(--text); outline: 0; font-size: 13px; }
.customer-note-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.customer-note-columns, .customer-note-row { display: grid; grid-template-columns: 144px minmax(120px, 170px) minmax(0, 1fr) 72px; gap: 16px; }
.customer-note-columns { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.customer-note-list { list-style: none; padding: 0; margin: 0; }
.customer-note-row { padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.customer-note-row time { color: var(--muted); font-size: 12px; line-height: 1.65; }
.customer-note-row h3, .customer-note-row p { margin: 0; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.customer-note-row h3 { font-weight: 600; }
.customer-note-row p { white-space: pre-wrap; }
.customer-note-actions { display: flex; justify-content: flex-end; gap: 4px; }
.customer-note-actions button { flex-shrink: 0; width: 32px; height: 32px; }
.customer-note-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 0; color: var(--muted); font-size: 12px; }
.customer-note-pagination > div { display: flex; align-items: center; gap: 10px; }
.customer-note-error { margin-top: 14px; padding: 10px 12px; border-left: 3px solid var(--rose); color: var(--rose); background: var(--rose-soft); overflow-wrap: anywhere; }
.order-browser-notebook { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.order-browser-notebook button { width: 100%; min-width: 0; height: 36px; font-size: 12px; justify-content: flex-start; gap: 8px; }
.order-browser-notebook button svg { width: 16px; height: 16px; flex-shrink: 0; }
.order-browser-notebook button svg:last-child { margin-left: auto; }
.notebook-board { width: 100%; min-width: 0; border-top: 1px solid var(--line); }
.notebook-board-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 36px; gap: 12px; align-items: end; padding: 16px 0; }
.notebook-board-filters label { min-width: 0; font-size: 12px; color: var(--muted); }
.notebook-board-filters select { width: 100%; min-width: 0; margin-top: 6px; }
.notebook-board-columns, .notebook-board-row { display: grid; grid-template-columns: minmax(136px, .8fr) minmax(160px, 1.2fr) minmax(0, 2.5fr) 72px; gap: 18px; }
.notebook-board-columns { border-block: 1px solid var(--line); padding: 12px 0; color: var(--muted); font-size: 12px; }
.notebook-board-list { list-style: none; margin: 0; padding: 0; }
.notebook-board-row { border-bottom: 1px solid var(--line); padding: 18px 0; align-items: start; }
.notebook-board-row > div, .notebook-board-row p { min-width: 0; }
.notebook-board-row p { margin: 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.notebook-board-customer { display: flex; flex-direction: column; gap: 5px; }
.notebook-board-customer time, .notebook-board-customer small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.notebook-board-customer strong { font-size: 13px; overflow-wrap: anywhere; }
.notebook-board-references { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 13px; overflow-wrap: anywhere; }
.notebook-reference-link { display: inline-flex; align-items: flex-start; gap: 6px; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 13px; text-align: left; line-height: 1.6; }
.notebook-reference-link span { min-width: 0; overflow-wrap: anywhere; }
.notebook-reference-link svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; }
.notebook-reference-link:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .notebook-board-filters { grid-template-columns: minmax(0, 1fr) 36px; gap: 12px 8px; }
  .notebook-board-filters label { grid-column: 1 / -1; }
  .notebook-board-filters label:nth-child(3) { grid-column: 1; }
  .notebook-board-columns { display: none; }
  .notebook-board-row { grid-template-columns: minmax(0, 1fr) 72px; gap: 12px; }
  .notebook-board-customer { grid-column: 1; }
  .notebook-board-references, .notebook-board-row p { grid-column: 1 / -1; }
  .notebook-board-row .customer-note-actions { grid-column: 2; grid-row: 1; }
}
@media (max-width: 1000px) {
  .customer-note-columns { display: none; }
  .customer-note-row { grid-template-columns: minmax(0, 1fr) 72px; gap: 6px 12px; }
  .customer-note-row time, .customer-note-row h3 { grid-column: 1; }
  .customer-note-row p { grid-column: 1 / -1; margin-top: 6px; }
  .customer-note-actions { grid-column: 2; grid-row: 1 / 3; }
}
.workspace-body { padding: 22px 24px 30px; gap: 24px; }
.workspace-progress { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.workspace-step { position: relative; min-width: 0; display: grid; justify-items: center; gap: 7px; padding: 6px 3px; border: 0; border-radius: 0; background: transparent; color: var(--text); box-shadow: none; }
.workspace-step:before { content: ""; position: absolute; top: 20px; width: 100%; height: 1px; left: -50%; background: var(--line-strong); }
.workspace-step:first-child:before { display: none; }
.workspace-step.complete:before { background: var(--teal); }
.workspace-step:hover { background: var(--surface-soft); }
.workspace-step.active { background: none; border: 0; box-shadow: none; }
.workspace-step .workspace-step-icon { z-index: 1; display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--faint); }
.workspace-step.complete .workspace-step-icon { background: var(--teal); color: white; border-color: var(--teal); }
.workspace-step.active:not(.complete) .workspace-step-icon { color: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.workspace-step-icon svg { width: 17px; height: 17px; }
.workspace-step > strong { font-size: 13px; }
.workspace-step > small { color: var(--muted); font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.workspace-financial-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.workspace-financial-summary > div { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-right: 1px solid var(--line); }
.workspace-financial-summary > div:first-child { padding-left: 0; }
.workspace-financial-summary > div:last-child { border: 0; }
.workspace-financial-summary svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--blue); }
.workspace-financial-summary > div:nth-child(2) svg { color: var(--teal); }
.workspace-financial-summary > div:nth-child(3) svg { color: var(--amber); }
.workspace-financial-summary span { min-width: 0; color: var(--muted); font-size: 12px; }
.workspace-financial-summary strong { display: block; margin-top: 7px; color: var(--text); font-size: 20px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.workspace-financial-summary > div:last-child strong { color: var(--amber); }
.workspace-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; min-width: 0; }
.workspace-tabs button { flex-shrink: 0; min-height: 43px; padding: 0 4px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 14px; white-space: nowrap; }
.workspace-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.workspace-tab-content { min-width: 0; display: grid; gap: 26px; }
.workspace-tab-content > .full-button { display: none; }
.workspace-section { min-width: 0; }
.workspace-section .section-head { margin-bottom: 12px; }
.workspace-table-wrap { max-width: 100%; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.workspace-table-wrap .business-table { min-width: 700px; }
.workspace-table-wrap .business-table td:first-child { min-width: 140px; max-width: 230px; white-space: normal; overflow-wrap: anywhere; }
.workspace-po-table td:nth-child(2) { min-width: 100px; }
.workspace-table-wrap .business-table th, .workspace-table-wrap .business-table td { padding: 11px 10px; font-size: 13px; }
.workspace-table-wrap .business-table th { font-size: 12px; }
.workspace-table-wrap .business-table th { font-weight: 600; }
.workspace-table-wrap .business-table strong { font-weight: 600; }
.workspace-table-wrap .business-table tfoot { display: table-footer-group; background: var(--surface-soft); }
.workspace-line-actions { display: flex; align-items: center; gap: 4px; }
.workspace-line-actions .record-edit-button { width: 32px; height: 32px; }
.workspace-tabs button:focus-visible, .workspace-step:focus-visible, .workspace-order-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.workspace-tab-content > .field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.workspace-tab-content .record-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 0; background: none; }
.workspace-tab-content .record-list { gap: 0; }
.workspace-inspection-list { border-top: 1px solid var(--line); }
.workspace-inspection-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.workspace-inspection-row > span:first-child { min-width: 140px; flex: 1; }
.workspace-inspection-row small { display: block; margin-top: 5px; color: var(--muted); }
.workspace-empty { min-height: 360px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.workspace-empty svg { width: 25px; height: 25px; }
.workspace-empty h2 { font-size: 18px; }
html[data-cloud-role="viewer"] .workspace-write-control { display: none !important; }
html[data-cloud-role="viewer"] .workspace-commands { display: none !important; }

@media (min-width: 901px) {
  .sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; align-self: start; }
}
@media (max-width: 1280px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { flex-wrap: wrap; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-panel { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  html[data-active-view="orders"][data-order-layout="workspace"] .content-grid { grid-template-columns: 248px minmax(0, 1fr); }
  .workspace-order-heading > div:first-child { min-width: 180px; }
  .workspace-financial-summary > div { padding: 0 12px; gap: 8px; }
  .workspace-financial-summary strong { font-size: 18px; }
}
@media (max-width: 1000px) {
  html[data-active-view="orders"][data-order-layout="workspace"] .content-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .order-workspace-head { padding: 20px 18px 0; }
  .workspace-body { padding: 20px 18px; }
  .workspace-tabs { gap: 14px; }
  .workspace-financial-summary svg { display: none; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 10; width: 100%; padding: 8px 10px; gap: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand, .sidebar-footer { display: none; }
  .nav-list { display: flex; overflow-x: auto; width: 100%; gap: 4px; }
  .nav-item { width: auto; flex-shrink: 0; min-width: max-content; height: 38px; padding: 0 10px; font-size: 12px; }
  .nav-item svg { width: 16px; height: 16px; }
  .topbar { padding: 10px 12px; position: static; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .search-box { max-width: none; }
  .content-grid { padding: 18px 12px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid > .metric { border-bottom: 1px solid var(--line); min-height: 92px; }
  .metrics-grid > .metric:nth-child(2n) { border-right: 0; }
  .metrics-grid > .metric:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 700px) {
  html[data-active-view="orders"][data-order-layout="workspace"] .content-grid { grid-template-columns: minmax(0, 1fr); }
  html[data-active-view="orders"][data-order-layout="workspace"] #mainContent { border-right: 0; border-bottom: 1px solid var(--line); }
  .order-browser-head { min-height: 60px; padding: 12px; }
  .order-browser-head h1 { font-size: 16px; }
  .order-browser-toggle { display: inline-grid; }
  .order-browser[data-collapsed="true"] .order-browser-body { display: none; }
  .order-browser-list { max-height: 330px; overflow-y: auto; }
  .order-browser .table-pagination { align-items: center; flex-direction: row; }
  .workspace-order-item { min-height: 102px; }
  .order-workspace-head { padding: 20px 14px 0; }
  .workspace-body { padding: 20px 14px; gap: 20px; }
  .workspace-order-heading h1 { font-size: 22px; }
  .workspace-order-facts { gap: 8px 12px; }
  .workspace-commands { width: 100%; }
  .workspace-progress { grid-template-columns: repeat(6, minmax(50px, 1fr)); overflow-x: auto; }
  .workspace-step > strong { font-size: 12px; }
  .workspace-step > small { font-size: 10px; }
  .workspace-financial-summary { padding: 14px 0; }
  .workspace-financial-summary > div { padding: 0 9px; }
  .workspace-financial-summary strong { font-size: 16px; }
  .workspace-tabs { gap: 18px; }
  .workspace-tab-content > .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-body { padding: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .table-toolbar { padding: 14px 8px; }
}
@media (max-width: 520px) {
  .date-pill { display: none; }
  .topbar-actions { gap: 6px; justify-content: space-between; }
  .cloud-account { flex: 1 1 100%; }
  .workspace-financial-summary strong { font-size: 14px; }
  .workspace-financial-summary span { font-size: 11px; }
  .workspace-current-customer { font-size: 14px; }
  .workspace-inspection-row .secondary-button { margin-left: auto; }
  .workspace-order-heading > div:first-child { min-width: 0; flex-basis: 100%; }
  .workspace-order-heading-title { gap: 8px; }
}

.production-import-status { margin: 12px 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.voice-input-actions { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.voice-input-actions [aria-pressed="true"] { color: var(--rose); border-color: var(--rose); }
.voice-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.voice-consent input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 16px; }
.voice-status { margin: 12px 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.voice-status:empty, .voice-result:empty { display: none; }
.voice-status.error { color: var(--rose); }
.voice-review { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.voice-shipment-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.voice-result { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; font-size: 13px; overflow-wrap: anywhere; }
.voice-result > strong { font-size: 18px; }
.voice-result p { color: var(--muted); }
.voice-result ul { margin: 12px 0 0; padding-left: 18px; }
.voice-result li { padding: 6px 0; }
#voiceAssistantModal select, #voiceAssistantModal textarea, #voiceAssistantModal input:not([type="checkbox"]) { max-width: 100%; min-width: 0; }
@media (max-width: 520px) {
  .voice-shipment-fields { grid-template-columns: minmax(0, 1fr); }
  #voiceAssistantModal .modal-actions { flex-wrap: wrap; }
  #voiceAssistantModal .primary-button { white-space: normal; }
}
.production-import-status.error { color: var(--rose); }
.order-product-requirements { border-block: 1px solid var(--line); padding: 12px 0; min-width: 0; }
.order-product-requirements[hidden] { display: none; }
.order-requirement-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-requirement-heading h3 { margin: 0; font-size: 14px; color: var(--amber); }
.customer-product-requirement { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.customer-product-requirement:last-child { border-bottom: 0; padding-bottom: 0; }
.customer-product-requirement strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.customer-product-requirement p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 14px; margin: 10px 0 0; }
.product-requirement-summary { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box !important; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-requirement-modal { width: min(520px, calc(100vw - 32px)); }
.product-requirement-modal .modal-head h2 { font-size: 18px; overflow-wrap: anywhere; }
.product-requirement-modal .modal-actions { flex-wrap: wrap; }
.product-requirement-modal .modal-actions button { white-space: normal; }
.production-source-file { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.production-import-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.production-wide-field, .production-source-line, .production-reference-price { grid-column: 1 / -1; min-width: 0; }
.production-source-line { display: flex; align-items: center; gap: 12px; }
.production-source-line > div { min-width: 0; }
.production-source-line img { width: 100px; height: 80px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; flex: 0 0 100px; }
.production-import-line label.production-price-control { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 36px; align-items: end; }
.production-price-control input { grid-column: 1; }
.production-price-control button { grid-column: 2; grid-row: 2; width: 36px; height: 36px; }
.production-source-line strong, .production-source-line small { display: block; overflow-wrap: anywhere; }
.production-source-line strong { font-size: 14px; }
.production-source-line small, .production-reference-price { color: var(--muted); margin-top: 5px; font-size: 12px; }
.production-import-line label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; min-width: 0; }
.production-duplicate { display: grid; gap: 10px; margin-top: 16px; color: var(--amber); font-size: 13px; }
.production-duplicate:empty { display: none; }
.production-duplicate button { justify-content: flex-start; white-space: normal; overflow-wrap: anywhere; }
.production-order-fields { border: 0; border-bottom: 1px solid var(--line); margin: 0 0 18px; padding: 0 0 18px; min-width: 0; }
.production-order-fields legend { font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.production-order-fields .production-price-confirm { display: flex; align-items: center; gap: 8px; }
.production-price-confirm input { width: 16px; height: 16px; flex: 0 0 16px; }
.production-order-details { border-bottom: 1px solid var(--line); padding-bottom: 18px; min-width: 0; }
.production-order-details h2 { font-size: 16px; }
.production-order-details h3 { margin: 16px 0 6px; font-size: 13px; }
.production-order-details p { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.production-requirements { white-space: pre-wrap; }
html[data-cloud-role="viewer"] [data-open-production-import] { display: none !important; }
@media (max-width: 700px) {
  .production-import-line { grid-template-columns: minmax(0, 1fr); }
  #productionImportModal .import-file-picker { min-width: 0; }
}
