﻿:root {
  --surface: #f8f9fb;
  --surface-subtle: #f3f6f9;
  --surface-card: #ffffff;
  --surface-muted: #edeef0;
  --border: #dcdfe6;
  --border-strong: #c3c6d7;
  --primary: #003da6;
  --primary-container: #0052d9;
  --primary-soft: #dbe1ff;
  --primary-soft-2: #edf3ff;
  --secondary: #3f5c9e;
  --success: #2ba471;
  --warning: #e37318;
  --danger: #d54941;
  --text: #1d2129;
  --text-soft: #4e5969;
  --text-muted: #737686;
  --sidebar-width: 180px;
  --sidebar-rail: 72px;
  --header-height: 48px;
  --row-compact: 32px;
  --row-standard: 40px;
  --radius: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--surface);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
}

body {
  min-height: 100vh;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Login */
body.login-shell {
  background: var(--surface);
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--surface);
}

.login-card {
  width: min(380px, 100%);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: 0 12px 28px rgba(25, 28, 30, 0.08);
}

.login-title-block {
  margin-bottom: 28px;
}

.login-title-block h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.login-title-block p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.login-field,
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field {
  margin-bottom: 14px;
}

.login-field span,
.field span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  min-height: var(--row-compact);
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.12);
}

input[readonly] {
  background: var(--surface-subtle);
  color: var(--text-soft);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 20px;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.remember-check input {
  min-height: auto;
  width: auto;
}

/* App shell */
body.app-shell {
  overflow: hidden;
  background: var(--surface);
}

.main-view {
  height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--header-height) + 16px) 24px 40px;
  background: var(--surface);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.main-view::-webkit-scrollbar,
.records-list::-webkit-scrollbar,
.record-detail-panel::-webkit-scrollbar,
.eye-param-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.main-view::-webkit-scrollbar-thumb,
.records-list::-webkit-scrollbar-thumb,
.record-detail-panel::-webkit-scrollbar-thumb,
.eye-param-table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.app-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 30;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-card);
  box-shadow: none;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand h1 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.account-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
}

#currentUserBadge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.header-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.header-icon-btn::before,
.dock-icon::before,
.page-title::before,
.panel > h2::before,
.info-block h3::before,
.ghost-btn::before,
.primary-btn::before,
.danger-btn::before,
.model-control-btn::before,
.eye-btn::before,
.record-search-input {
  speak: never;
}

.header-notify-btn::before {
  content: "!";
}

.header-settings-btn::before {
  content: "⚙";
  font-size: 13px;
}

.header-icon-btn:hover {
  background: var(--surface-subtle);
  color: var(--primary-container);
}

/* Stitch side navigation */
.dock-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 0 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
  background: #f3f6f9;
  box-shadow: none;
  transform: none;
}

.side-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin: 0 -8px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-card);
}

.side-brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--primary-container);
  color: #fff;
  font-weight: 800;
  font-size: 0;
}

.side-brand-mark::before {
  content: "○";
  font-size: 15px;
  line-height: 1;
}

.side-brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.side-brand strong {
  display: block;
  color: var(--primary);
  font-size: 15px;
  line-height: 18px;
  font-weight: 700;
}

.side-brand span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dock-item {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.dock-item:hover {
  background: var(--surface-muted);
  color: var(--primary);
}

.dock-item.active {
  background: var(--primary-container);
  color: #fff;
  font-weight: 700;
}

.dock-icon,
.dock-item:hover .dock-icon,
.dock-item.active .dock-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: currentColor;
  font-size: 16px;
  font-weight: 700;
  transform: none;
}

.dock-item[data-tab="calc"] .dock-icon::before {
  content: "∑";
}

.dock-item[data-tab="records"] .dock-icon::before {
  content: "▤";
}

.dock-item[data-tab="mine"] .dock-icon::before {
  content: "○";
}

.dock-item[data-tab="users"] .dock-icon::before {
  content: "◇";
}

.dock-dot {
  display: none !important;
}

.dock-label {
  display: block;
  color: currentColor;
  font-size: 13px;
  font-weight: 600;
}

/* Layout */
.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title::before {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  line-height: 1;
  content: "•";
}

#calcTab .page-title::before {
  content: "∑";
}

#outputTab .page-title::before {
  content: "✓";
}

.page-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.toolbar-actions,
.actions-row,
.inline-form,
.lens-model-controls,
.lens-eye-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: 0 1px 2px rgba(25, 28, 30, 0.04);
  padding: 16px;
}

.panel h2,
.panel h3,
.record-detail-section h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 700;
}

.panel h2 {
  font-size: 16px;
  line-height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel > h2::before,
.info-block h3::before,
.record-detail-section h3::before {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--primary-container);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  content: "□";
}

.info-panel > h2::before,
.output-info-panel > h2::before,
.record-detail-section:nth-of-type(1) h3::before {
  content: "i";
}

.eye-table-panel > h2::before,
.output-input-panel > h2::before,
.record-detail-section:nth-of-type(2) h3::before {
  content: "≡";
}

.output-result-panel > h2::before,
.record-detail-section:nth-of-type(3) h3::before {
  content: "✓";
}

.lens-model-panel h2::before {
  content: "◎";
}

.users-list + h2::before,
#usersTab .panel > h2::before {
  content: "◇";
}

.mine-panel > h2::before {
  content: "○";
}

.info-block:first-child h3::before {
  content: "▣";
}

.info-block:nth-child(2) h3::before {
  content: "◌";
}

.panel h3,
.record-detail-section h3 {
  font-size: 14px;
  line-height: 20px;
}

.info-panel {
  position: relative;
}

.info-two-column {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 2fr);
  gap: 12px;
}

.info-block {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-card);
}

.basic-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.info-block:first-child .basic-info-grid {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.eye-table-panel {
  overflow: hidden;
}

.eye-param-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.eye-param-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  font-size: 13px;
}

.eye-param-table th,
.eye-param-table td {
  height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.eye-param-table th {
  background: #eaf4fb;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.eye-param-table tbody th,
.eye-param-table tbody td:first-child {
  background: var(--surface-subtle);
  color: #344052;
  font-weight: 700;
  text-align: left;
}

.eye-param-table tbody tr:hover td,
.eye-param-table tbody tr:hover th {
  background: #cfe1ff !important;
}

.eye-summary-table tbody tr.row-selected td,
.eye-summary-table tbody tr.row-selected th {
  background: #b4c5ff !important;
}

.eye-param-table input,
.eye-param-table select {
  min-height: 30px;
  height: 30px;
  padding: 4px 8px;
  font-size: 13px;
  text-align: left;
}

.eye-column-inactive {
  opacity: 0.42;
  filter: grayscale(1);
}

/* Buttons */
.primary-btn,
.ghost-btn,
.danger-btn,
.eye-btn,
.model-control-btn,
.record-delete-btn {
  min-height: var(--row-standard);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 0 16px;
  border: 1px solid transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.primary-btn::before,
.ghost-btn::before,
.danger-btn::before,
.record-delete-btn::before,
.model-control-btn::before,
.eye-btn::before {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  color: currentColor;
}

.primary-btn::before {
  content: "→";
}

.ghost-btn::before {
  content: "＋";
}

.danger-btn::before,
.record-delete-btn::before {
  content: "×";
}

.action-clear::before {
  content: "×";
}

.action-test::before {
  content: "⚑";
}

#backToInputBtn::before {
  content: "←";
}

#saveRecordBtn::before,
#saveAdminPasswordBtn::before {
  content: "✓";
}

#createUserBtn::before {
  content: "＋";
}

#logoutBtn::before {
  content: "↩";
}

.model-control-btn::before,
.eye-btn::before {
  content: none;
}

.primary-btn,
.eye-btn.active,
.model-control-btn.active {
  background: var(--primary-container);
  border-color: var(--primary-container);
  color: #fff;
}

.primary-btn:hover,
.eye-btn.active:hover,
.model-control-btn.active:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.ghost-btn,
.eye-btn,
.model-control-btn {
  background: #fff;
  border-color: var(--border);
  color: var(--primary);
}

.ghost-btn:hover,
.eye-btn:hover,
.model-control-btn:hover {
  background: var(--primary-soft-2);
  border-color: var(--primary-container);
}

.danger-btn,
.record-delete-btn {
  background: #fff;
  border-color: #f2c7c3;
  color: var(--danger);
}

.danger-btn:hover,
.record-delete-btn:hover {
  background: #fff1f0;
  border-color: var(--danger);
}

.action-clear,
.action-test {
  background: #fff;
  border-color: var(--border);
  color: var(--primary);
}

.login-card .primary-btn {
  width: 100%;
}

.action-panel {
  padding: 12px 16px;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

.error-text,
.error {
  color: var(--danger);
}

/* Output */
#outputTab {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.35fr);
  gap: 12px;
  align-items: start;
}

#outputTab.hidden {
  display: none !important;
}

#outputTab > .toolbar,
#outputTab > .lens-model-panel,
#outputTab > .action-panel {
  grid-column: 1 / -1;
}

#outputTab > .output-info-panel,
#outputTab > .output-input-panel {
  grid-column: 1;
}

#outputTab > .output-result-panel {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.summary-item {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.summary-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.summary-item strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.lens-model-panel {
  overflow: hidden;
}

.lens-model-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.lens-model-title,
.lens-model-summary,
.lens-model-validation {
  color: var(--text-soft);
  font-size: 13px;
}

.lens-model-summary,
.lens-model-validation {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--text);
  font-weight: 700;
}

.lens-model-validation {
  border-color: rgba(43, 164, 113, 0.24);
  background: rgba(43, 164, 113, 0.08);
  color: #1f7a4d;
}

.lens-model-warning {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(227, 115, 24, 0.3);
  border-radius: var(--radius);
  background: rgba(227, 115, 24, 0.08);
  color: #994d08;
  font-weight: 700;
}

.lens-model-canvas-wrap {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

#lensModelCanvas {
  width: 100%;
  min-height: 360px;
  display: block;
}

.lens-model-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  pointer-events: none;
}

.lens-continuity-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.lens-continuity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.continuity-card,
.continuity-empty {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

/* Records */
.records-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.records-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fff;
}

.record-search-input {
  margin: 14px;
  width: calc(100% - 28px);
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737686' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.records-list {
  flex: 1;
  overflow-y: auto;
}

.record-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--border);
}

.record-item {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 0;
  border-left: 3px solid transparent;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.record-item:hover,
.record-list-row.active .record-item {
  background: var(--primary-soft-2);
  border-left-color: var(--primary-container);
}

.record-delete-btn {
  min-height: auto;
  height: 100%;
  border-radius: 0;
}

.record-detail-panel {
  min-height: 620px;
  padding: 20px;
  background: #fff;
  overflow: auto;
}

.record-detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.record-detail-section {
  margin-bottom: 18px;
}

/* Users and mine */
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr minmax(180px, 240px) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.company-text,
.company-id-text,
.password-text {
  color: var(--text-soft);
  font-size: 12px;
}

#mineTab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  align-items: start;
}

#mineTab.hidden {
  display: none !important;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  text-decoration: none;
}

.info-row strong {
  color: var(--text);
}

.mine-actions {
  margin-top: 18px;
}

.contact-panel {
  min-height: 500px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #143f85;
  background: #0b2f6b;
  color: #fff;
}

.contact-content {
  display: grid;
  gap: 24px;
}

.contact-details {
  display: grid;
  gap: 12px;
  color: #fff;
  font-size: 13px;
}

.contact-details p {
  margin: 0;
}

.contact-details span,
.contact-details strong {
  color: #fff;
}

.contact-qr {
  width: 112px;
  height: 112px;
  padding: 8px;
  background: #fff;
}

.contact-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.main-loading {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: calc(var(--sidebar-width) + 24px);
  z-index: 50;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 28, 30, 0.1);
}

@media (max-width: 1100px) {
  .basic-info-grid,
  .info-block:first-child .basic-info-grid,
  .summary-grid,
  .lens-continuity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-two-column,
  #outputTab,
  #mineTab,
  .records-workspace {
    grid-template-columns: 1fr;
  }

  #outputTab > .toolbar,
  #outputTab > .lens-model-panel,
  #outputTab > .action-panel,
  #outputTab > .output-info-panel,
  #outputTab > .output-input-panel,
  #outputTab > .output-result-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .records-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 900px) {
  .main-view {
    margin-left: var(--sidebar-rail);
    padding: calc(var(--header-height) + 16px) 12px 24px;
  }

  .app-header {
    left: var(--sidebar-rail);
  }

  .dock-nav {
    width: var(--sidebar-rail);
    padding: 0 8px 12px;
  }

  .side-brand {
    justify-content: center;
  }

  .side-brand > div:not(.side-brand-mark),
  .dock-label {
    display: none;
  }

  .dock-item {
    justify-content: center;
    padding: 0;
  }

  .toolbar,
  .lens-model-header {
    flex-direction: column;
  }

  .basic-info-grid,
  .summary-grid,
  .lens-continuity-grid {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
  }
}

/* Stitch refinement layer */
.toolbar {
  min-height: 48px;
  align-items: center;
  margin-bottom: 0;
}

.toolbar-actions {
  justify-content: flex-end;
}

.panel {
  border-radius: 6px;
  padding: 16px;
}

.info-panel {
  padding: 16px;
}

.info-two-column {
  grid-template-columns: minmax(360px, 0.52fr) minmax(520px, 1fr);
}

.info-block {
  padding: 16px;
  border-radius: 6px;
}

.info-block h3 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.basic-info-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  column-gap: 12px;
  row-gap: 12px;
}

.info-block:first-child .basic-info-grid {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.eye-table-panel {
  padding: 0;
}

.eye-table-panel > h2 {
  margin: 0;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-card);
}

.eye-entry-table {
  min-width: 1420px;
  table-layout: auto;
}

.eye-entry-table th,
.eye-entry-table td {
  min-width: 126px;
  height: 52px;
  padding: 8px 10px;
}

.eye-entry-table thead th {
  height: 36px;
  background: var(--surface-subtle);
  color: var(--text-soft);
  font-size: 11px;
  text-align: left;
}

.eye-entry-table thead th:first-child,
.eye-entry-table tbody th {
  width: 90px;
  min-width: 90px;
}

.eye-entry-table tbody th {
  background: #fff;
  color: var(--text);
  text-align: left;
}

.eye-entry-table tbody tr {
  transition: background 0.15s ease;
}

.eye-entry-table tbody tr:nth-child(2) td,
.eye-entry-table tbody tr:nth-child(2) th {
  background: var(--surface-subtle);
}

.eye-entry-table input,
.eye-entry-table select {
  min-width: 0;
  height: 32px;
}

.paired-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.eye-row-indicator {
  display: inline-block;
  width: 4px;
  height: 22px;
  margin-right: 8px;
  border-radius: 99px;
  vertical-align: middle;
  background: var(--danger);
}

.left-eye-row .eye-row-indicator {
  background: var(--secondary);
}

.calc-action-panel {
  position: sticky;
  bottom: -40px;
  z-index: 10;
  border-radius: 0;
  margin: 0 -24px -40px;
  padding: 12px 24px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.calc-action-panel .actions-row {
  justify-content: flex-end;
}

#outputTab {
  grid-template-columns: minmax(360px, 0.75fr) minmax(0, 1.35fr);
  gap: 12px;
}

.compact-panel {
  padding: 0;
  overflow: hidden;
}

.compact-panel > h2 {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.compact-panel .summary-grid,
.compact-panel .eye-param-table-wrap {
  padding: 12px 16px;
}

.output-result-panel .eye-param-table-wrap,
.output-input-panel .eye-param-table-wrap {
  padding: 0;
}

.output-result-panel .eye-param-table,
.output-input-panel .eye-param-table {
  border: 0;
}

.output-result-panel .eye-param-table th,
.output-result-panel .eye-param-table td,
.output-input-panel .eye-param-table th,
.output-input-panel .eye-param-table td {
  border-left: 0;
  border-right: 0;
}

.records-workspace {
  height: calc(100vh - 174px);
  min-height: 520px;
}

.records-sidebar {
  min-height: 0;
}

.record-detail-panel {
  min-height: 0;
}

.record-search-input {
  height: 34px;
  margin: 14px;
}

.record-list-row {
  grid-template-columns: 1fr 60px;
}

.record-item {
  min-height: 86px;
  padding: 12px 14px;
}

.record-delete-btn {
  opacity: 0.78;
  font-size: 12px;
}

.record-list-row:hover .record-delete-btn {
  opacity: 1;
}

#mineTab {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
}

.contact-panel {
  min-height: 500px;
  border-radius: 6px;
}

@media (max-width: 1100px) {
  .info-two-column {
    grid-template-columns: 1fr;
  }

  .calc-action-panel {
    position: static;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
  }
}

/* Stitch icon final polish */
.summary-item {
  position: relative;
  padding-left: 36px;
}

.summary-item::before {
  content: "i";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--primary-soft-2);
  color: var(--primary-container);
  font-size: 11px;
  font-weight: 800;
}

.record-delete-btn {
  font-size: 0;
  padding: 0 14px;
}

.record-delete-btn::before {
  content: "×";
  font-size: 16px;
}

.contact-details p {
  position: relative;
  padding-left: 24px;
}

.contact-details p::before {
  position: absolute;
  left: 0;
  top: 1px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.contact-details p:nth-child(1)::before {
  content: "☎";
}

.contact-details p:nth-child(2)::before {
  content: "@";
}

.contact-details p:nth-child(3)::before,
.contact-details p:nth-child(4)::before {
  content: "⌖";
}

.field span::before {
  content: "";
  width: 4px;
  height: 4px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--primary-container);
  vertical-align: 2px;
}

.toolbar-actions .ghost-btn,
.toolbar .ghost-btn,
.toolbar .primary-btn {
  min-width: 86px;
}

.lens-model-controls .model-control-btn {
  min-height: 34px;
}

.side-brand,
.app-header {
  box-shadow: 0 1px 0 rgba(220, 223, 230, 0.72);
}

/* Stitch near-match pass: typography, material-like local icons, tables */
:root {
  --icon-calc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4h10v2H7V4Zm1.5 5h7L12 13.2 8.5 9Zm0 10L12 14.8 15.5 19h-7Z'/%3E%3C/svg%3E");
  --icon-record: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14v2H5V5Zm0 4h14v2H5V9Zm0 4h14v2H5v-2Zm0 4h10v2H5v-2Z'/%3E%3C/svg%3E");
  --icon-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8c.7-3.6 3.4-6 7-6s6.3 2.4 7 6H5Z'/%3E%3C/svg%3E");
  --icon-admin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 8 4v6c0 4.4-2.9 8.4-8 10-5.1-1.6-8-5.6-8-10V6l8-4Zm0 4.2L8 8.1v4.2c0 2.5 1.5 4.8 4 5.9 2.5-1.1 4-3.4 4-5.9V8.1l-4-1.9Z'/%3E%3C/svg%3E");
  --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 10h2v8h-2v-8Zm0-4h2v2h-2V6Zm1 16a10 10 0 1 1 0-20 10 10 0 0 1 0 20Z'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.2 16.2-4-4 1.4-1.4 2.6 2.6 8.2-8.2 1.4 1.4-9.6 9.6Z'/%3E%3C/svg%3E");
  --icon-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v8l3-3 1.4 1.4L12 15.8l-5.4-5.4L8 9l3 3V4ZM5 18h14v2H5v-2Z'/%3E%3C/svg%3E");
  --icon-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 4 5.4 5.4L16 10.8l-3-3V16h-2V7.8l-3 3-1.4-1.4L12 4ZM5 18h14v2H5v-2Z'/%3E%3C/svg%3E");
  --icon-scan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM4 14h2v4h4v2H4v-6Zm14 0h2v6h-6v-2h4v-4ZM8 8h8v8H8V8Zm2 2v4h4v-4h-4Z'/%3E%3C/svg%3E");
  --icon-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h11l.5 2H20v9h-8l-.5-2H7v7H5V4Zm2 2v5h6l.5 2H18V8h-3.2l-.5-2H7Z'/%3E%3C/svg%3E");
  --icon-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m10 6 1.4 1.4L8.8 10H19v2H8.8l2.6 2.6L10 16l-5-5 5-5Z'/%3E%3C/svg%3E");
  --icon-save: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h12l2 2v14H5V4Zm2 2v12h10V7.2L15.8 6H15v5H8V6H7Zm3 0v3h3V6h-3Z'/%3E%3C/svg%3E");
  --icon-add: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5Z'/%3E%3C/svg%3E");
  --icon-delete: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7.4 5 4.6 4.6L16.6 5 19 7.4 14.4 12l4.6 4.6-2.4 2.4-4.6-4.6L7.4 19 5 16.6 9.6 12 5 7.4 7.4 5Z'/%3E%3C/svg%3E");
  --icon-bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22a2.5 2.5 0 0 0 2.4-2h-4.8A2.5 2.5 0 0 0 12 22Zm7-5-2-2V9a5 5 0 0 0-4-4.9V2h-2v2.1A5 5 0 0 0 7 9v6l-2 2v1h14v-1Z'/%3E%3C/svg%3E");
  --icon-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2-1.5-2-3.5-2.4 1a7.6 7.6 0 0 0-2.6-1.5L14 2h-4l-.4 2.5A7.6 7.6 0 0 0 7 6L4.6 5l-2 3.5 2 1.5c-.1.5-.1 1-.1 1.5s0 1 .1 1.5l-2 1.5 2 3.5 2.4-1a7.6 7.6 0 0 0 2.6 1.5L10 22h4l.4-2.5A7.6 7.6 0 0 0 17 18l2.4 1 2-3.5-2-1.5ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E");
}

body {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

.header-brand h1,
.page-title {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.panel h2,
.panel h3,
.record-detail-section h3,
.side-brand strong {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.dock-label,
.primary-btn,
.ghost-btn,
.danger-btn,
.eye-btn,
.model-control-btn {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.dock-icon::before,
.header-icon-btn::before,
.page-title::before,
.panel > h2::before,
.info-block h3::before,
.record-detail-section h3::before,
.primary-btn::before,
.ghost-btn::before,
.danger-btn::before,
.record-delete-btn::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--icon-info) center / contain no-repeat;
  mask: var(--icon-info) center / contain no-repeat;
}

.dock-item[data-tab="calc"] .dock-icon::before,
#calcTab .page-title::before {
  -webkit-mask-image: var(--icon-calc);
  mask-image: var(--icon-calc);
}

.dock-item[data-tab="records"] .dock-icon::before {
  -webkit-mask-image: var(--icon-record);
  mask-image: var(--icon-record);
}

.dock-item[data-tab="mine"] .dock-icon::before {
  -webkit-mask-image: var(--icon-user);
  mask-image: var(--icon-user);
}

.dock-item[data-tab="users"] .dock-icon::before,
#usersTab .panel > h2::before {
  -webkit-mask-image: var(--icon-admin);
  mask-image: var(--icon-admin);
}

.record-delete-btn::before,
.danger-btn::before {
  -webkit-mask-image: var(--icon-delete);
  mask-image: var(--icon-delete);
}

.header-notify-btn::before {
  -webkit-mask-image: var(--icon-bell);
  mask-image: var(--icon-bell);
}

.header-settings-btn::before {
  -webkit-mask-image: var(--icon-gear);
  mask-image: var(--icon-gear);
}

#outputTab .page-title::before,
.output-result-panel > h2::before,
#saveRecordBtn::before,
#saveAdminPasswordBtn::before {
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

.action-clear::before {
  -webkit-mask-image: var(--icon-delete);
  mask-image: var(--icon-delete);
}

.action-test::before {
  -webkit-mask-image: var(--icon-flag);
  mask-image: var(--icon-flag);
}

#backToInputBtn::before,
#logoutBtn::before {
  -webkit-mask-image: var(--icon-back);
  mask-image: var(--icon-back);
}

#createUserBtn::before {
  -webkit-mask-image: var(--icon-add);
  mask-image: var(--icon-add);
}

.page-title::before,
.panel > h2::before,
.info-block h3::before,
.record-detail-section h3::before {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  background-color: var(--primary-container);
  box-shadow: inset 0 0 0 999px var(--primary-soft);
}

.page-title::before,
.panel > h2::before,
.info-block h3::before,
.record-detail-section h3::before {
  background-color: var(--primary-container);
}

.page-title::before {
  background-color: var(--primary-container);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.eye-btn,
.model-control-btn,
.record-delete-btn {
  min-height: 40px;
  border-radius: 4px;
  padding: 0 16px;
  font-weight: 500;
}

.ghost-btn,
.eye-btn,
.model-control-btn {
  background: #fff;
  border-color: var(--primary-container);
  color: var(--primary-container);
}

.ghost-btn:hover,
.eye-btn:hover,
.model-control-btn:hover {
  background: #f3f6f9;
}

.primary-btn:hover,
.eye-btn.active:hover,
.model-control-btn.active:hover {
  opacity: 0.92;
}

.eye-param-table th,
.eye-param-table td {
  border-color: var(--border);
}

.eye-param-table th {
  background: #f3f6f9;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
}

.eye-entry-table tbody tr:hover td,
.eye-entry-table tbody tr:hover th {
  background: inherit !important;
}

.eye-entry-table tbody tr:nth-child(1):hover td,
.eye-entry-table tbody tr:nth-child(1):hover th {
  background: #fff !important;
}

.eye-entry-table tbody tr:nth-child(2):hover td,
.eye-entry-table tbody tr:nth-child(2):hover th {
  background: var(--surface-subtle) !important;
}

.eye-entry-table input:hover,
.eye-entry-table select:hover {
  border-color: var(--primary-container);
}

.side-brand {
  height: 72px;
}

.dock-nav {
  gap: 8px;
}

/* Visible icon chips: make Stitch-style symbols explicit on every page */
.page-title::before,
.panel > h2::before,
.info-block h3::before,
.record-detail-section h3::before {
  content: "";
  width: 24px;
  height: 24px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 6px;
  background-color: transparent;
  background-image:
    var(--icon-info),
    linear-gradient(var(--primary-soft), var(--primary-soft));
  background-repeat: no-repeat;
  background-position: center, center;
  background-size: 14px 14px, 100% 100%;
  box-shadow: none;
  -webkit-mask: none;
  mask: none;
}

#calcTab .page-title::before {
  background-image:
    var(--icon-calc),
    linear-gradient(var(--primary-soft), var(--primary-soft));
}

#outputTab .page-title::before,
.output-result-panel > h2::before,
#saveRecordBtn::before,
#saveAdminPasswordBtn::before {
  background-image:
    var(--icon-check),
    linear-gradient(var(--primary-soft), var(--primary-soft));
}

.eye-table-panel > h2::before,
.output-input-panel > h2::before,
.record-detail-section:nth-of-type(2) h3::before {
  background-image:
    var(--icon-record),
    linear-gradient(var(--primary-soft), var(--primary-soft));
}

.lens-model-panel h2::before {
  background-image:
    var(--icon-scan),
    linear-gradient(var(--primary-soft), var(--primary-soft));
}

#usersTab .panel > h2::before {
  background-image:
    var(--icon-admin),
    linear-gradient(var(--primary-soft), var(--primary-soft));
}

.mine-panel > h2::before {
  background-image:
    var(--icon-user),
    linear-gradient(var(--primary-soft), var(--primary-soft));
}

.header-icon-btn::before,
.dock-icon::before,
.primary-btn::before,
.ghost-btn::before,
.danger-btn::before,
.record-delete-btn::before {
  background-color: currentColor;
  background-image: none;
  -webkit-mask: var(--icon-info) center / contain no-repeat;
  mask: var(--icon-info) center / contain no-repeat;
}

.header-notify-btn::before {
  -webkit-mask-image: var(--icon-bell);
  mask-image: var(--icon-bell);
}

.header-settings-btn::before {
  -webkit-mask-image: var(--icon-gear);
  mask-image: var(--icon-gear);
}

.dock-item[data-tab="calc"] .dock-icon::before {
  -webkit-mask-image: var(--icon-calc);
  mask-image: var(--icon-calc);
}

.dock-item[data-tab="records"] .dock-icon::before {
  -webkit-mask-image: var(--icon-record);
  mask-image: var(--icon-record);
}

.dock-item[data-tab="mine"] .dock-icon::before {
  -webkit-mask-image: var(--icon-user);
  mask-image: var(--icon-user);
}

.dock-item[data-tab="users"] .dock-icon::before {
  -webkit-mask-image: var(--icon-admin);
  mask-image: var(--icon-admin);
}

.action-clear::before {
  -webkit-mask-image: var(--icon-delete);
  mask-image: var(--icon-delete);
}

.action-test::before {
  -webkit-mask-image: var(--icon-flag);
  mask-image: var(--icon-flag);
}

#backToInputBtn::before,
#logoutBtn::before {
  -webkit-mask-image: var(--icon-back);
  mask-image: var(--icon-back);
}

#createUserBtn::before {
  -webkit-mask-image: var(--icon-add);
  mask-image: var(--icon-add);
}

#saveRecordBtn::before,
#saveAdminPasswordBtn::before {
  -webkit-mask-image: var(--icon-save);
  mask-image: var(--icon-save);
}

.danger-btn::before,
.record-delete-btn::before {
  -webkit-mask-image: var(--icon-delete);
  mask-image: var(--icon-delete);
}

.page-title::before,
.panel > h2::before,
.info-block h3::before,
.record-detail-section h3::before {
  background-image: none;
  background-color: var(--primary-soft);
  position: relative;
}

.page-title::before,
.panel > h2::before,
.info-block h3::before,
.record-detail-section h3::before {
  -webkit-mask: none;
  mask: none;
}

.page-title::after,
.panel > h2::after,
.info-block h3::after,
.record-detail-section h3::after {
  content: "";
  width: 14px;
  height: 14px;
  position: absolute;
  left: 5px;
  top: 5px;
  background: var(--primary-container);
  -webkit-mask: var(--icon-info) center / contain no-repeat;
  mask: var(--icon-info) center / contain no-repeat;
  pointer-events: none;
}

.page-title,
.panel > h2,
.info-block h3,
.record-detail-section h3 {
  position: relative;
}

#calcTab .page-title::after {
  -webkit-mask-image: var(--icon-calc);
  mask-image: var(--icon-calc);
}

#outputTab .page-title::after,
.output-result-panel > h2::after {
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

.eye-table-panel > h2::after,
.output-input-panel > h2::after,
.record-detail-section:nth-of-type(2) h3::after {
  -webkit-mask-image: var(--icon-record);
  mask-image: var(--icon-record);
}

.lens-model-panel h2::after {
  -webkit-mask-image: var(--icon-scan);
  mask-image: var(--icon-scan);
}

#usersTab .panel > h2::after {
  -webkit-mask-image: var(--icon-admin);
  mask-image: var(--icon-admin);
}

.mine-panel > h2::after {
  -webkit-mask-image: var(--icon-user);
  mask-image: var(--icon-user);
}

/* Records page: strict Stitch split-view layout */
#recordsTab,
#orderSearchTab {
  gap: 0;
}

#recordsTab > .records-panel,
#orderSearchTab > .records-panel {
  height: calc(100vh - var(--header-height) - 16px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#recordsTab .records-workspace,
#orderSearchTab .records-workspace {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #fff;
}

#recordsTab .records-workspace.factory-three-column {
  grid-template-columns: 220px 340px minmax(0, 1fr);
}

#orderSearchTab .order-search-workspace {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

.records-stage-panel {
  min-height: 0;
  border-right: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.records-stage-title {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  color: #153c63;
  font-size: 15px;
  font-weight: 900;
}

#factoryStageTabs {
  display: grid;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
}

#recordsTab .records-sidebar {
  border-right: 1px solid var(--border);
  border-bottom: 0;
  background: #fff;
  min-height: 0;
}

#recordsTab .records-sidebar-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

#recordsTab .records-sidebar-toolbar strong {
  min-width: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.order-search-results-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fff;
}

.order-search-toolbar {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

#recordsTab .record-search-input {
  width: calc(100% - 32px);
  height: 32px;
  margin: 16px;
  border-radius: 2px;
  background-color: #fff;
  font-size: 13px;
}

.records-list-head {
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 78px;
  align-items: center;
  padding: 0 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #f3f6f9;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.records-list-head span:last-child {
  text-align: center;
}

#recordsTab .records-list {
  min-height: 0;
  overflow-y: auto;
}

#recordsTab .record-list-row {
  display: grid;
  grid-template-columns: 1fr 68px;
  border-top: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

#recordsTab .record-list-row.active {
  background: #edf3ff;
}

#recordsTab .record-item {
  min-height: 82px;
  padding: 12px 16px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text);
}

#recordsTab .record-list-row.active .record-item,
#recordsTab .record-item:hover {
  background: transparent;
  border-left-color: var(--primary-container);
}

#recordsTab .record-item strong {
  color: var(--primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

#recordsTab .record-item span {
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
}

#recordsTab .record-item small {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
}

#recordsTab .record-delete-btn {
  width: 68px;
  min-height: 82px;
  height: auto;
  border: 0;
  border-left: 1px solid #f2c7c3;
  border-radius: 0;
  background: #fffafa;
  color: var(--danger);
}

#recordsTab .record-detail-panel {
  min-height: 0;
  padding: 0;
  background: var(--surface);
  overflow-y: auto;
}

.record-detail-shell {
  min-height: 100%;
  padding: 24px;
}

.record-detail-shell.has-detail-collapse {
  position: relative;
  padding-left: 56px;
}

.detail-collapse-btn {
  position: fixed;
  top: calc(50vh + 24px);
  left: calc(var(--sidebar-width) + 132px - 15px);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #cfe0f5;
  border-radius: 999px;
  background: #ffffff;
  color: #075cc7;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.detail-collapse-btn:hover {
  border-color: #8db7f0;
  background: #f0f7ff;
}

.detail-collapse-btn span {
  width: 9px;
  height: 9px;
  margin-left: -3px;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-45deg);
}

.record-detail-top {
  min-height: 68px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.record-detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.record-detail-title-row h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.record-status-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border: 1px solid rgba(43, 164, 113, 0.22);
  border-radius: 2px;
  background: rgba(43, 164, 113, 0.12);
  color: #16794d;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
}

.record-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.record-detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.record-detail-meta span::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--icon-record) center / contain no-repeat;
  mask: var(--icon-record) center / contain no-repeat;
}

.record-meta-doctor::before {
  -webkit-mask-image: var(--icon-user) !important;
  mask-image: var(--icon-user) !important;
}

.record-export-btn {
  height: 32px;
  min-height: 32px;
  min-width: 128px;
}

.record-clinical-card {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 28, 30, 0.04);
  overflow: hidden;
}

.record-clinical-card > header {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: #f3f6f9;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.record-patient-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 16px;
}

.record-patient-item {
  min-height: 42px;
}

.record-patient-item span {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.record-patient-item strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

.record-result-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.record-card-icon {
  width: 18px;
  height: 18px;
  overflow: hidden;
  color: transparent;
  background: var(--text-soft);
  -webkit-mask: var(--icon-user) center / contain no-repeat;
  mask: var(--icon-user) center / contain no-repeat;
}

.record-card-icon.success {
  background: var(--success);
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

#recordsTab .record-clinical-card .eye-param-table-wrap {
  padding: 0;
}

#recordsTab .record-clinical-card .eye-param-table {
  border: 0;
}

#recordsTab .record-clinical-card .eye-param-table th,
#recordsTab .record-clinical-card .eye-param-table td {
  height: 32px;
  border-top: 0;
  border-left: 0;
  font-size: 13px;
}

#recordsTab .record-clinical-card .eye-param-table tr:last-child th,
#recordsTab .record-clinical-card .eye-param-table tr:last-child td {
  border-bottom: 0;
}

#recordsTab .record-clinical-card .eye-param-table th:last-child,
#recordsTab .record-clinical-card .eye-param-table td:last-child {
  border-right: 0;
}

.record-inline-alert {
  display: flex;
  gap: 10px;
  margin: 8px 16px 16px;
  padding: 10px 12px;
  border: 1px solid rgba(227, 115, 24, 0.36);
  border-radius: 2px;
  background: rgba(227, 115, 24, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
}

.record-inline-alert strong {
  color: var(--warning);
}

.record-detail-empty {
  display: grid;
  gap: 6px;
  place-content: center;
  min-height: 320px;
  color: var(--text-soft);
  text-align: center;
}

.record-detail-empty strong {
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

@media (max-width: 1200px) {
  #recordsTab .records-workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .record-result-grid,
  .record-patient-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* User management page: strict Stitch dashboard layout */
#usersTab {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 974px;
}

#usersTab.hidden {
  display: none !important;
}

.users-dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.users-dashboard-head .page-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.users-dashboard-head .page-subtitle {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 18px;
}

.admin-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 29px;
  padding: 0 14px;
  border: 1px solid #ffccc7;
  background: #fff1f0;
  color: #b42318;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-access-badge::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--icon-admin) center / contain no-repeat;
  mask: var(--icon-admin) center / contain no-repeat;
}

.users-admin-grid {
  display: grid;
  grid-template-columns: 317px minmax(0, 1fr);
  gap: 12px;
}

.user-admin-card,
.user-system-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 28, 30, 0.04);
}

.user-admin-card {
  min-height: 226px;
  padding: 20px;
}

.admin-reset-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 16px 12px;
}

.user-card-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #dbeafe;
  color: var(--primary);
}

.user-card-icon::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon-user) center / contain no-repeat;
  mask: var(--icon-user) center / contain no-repeat;
}

.admin-reset-icon {
  background: #fee2e2;
  color: #dc2626;
}

.admin-reset-icon::before {
  -webkit-mask-image: var(--icon-password, var(--icon-admin));
  mask-image: var(--icon-password, var(--icon-admin));
}

.user-admin-card h3 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.user-admin-card p {
  grid-column: 1 / -1;
  margin: 0;
  max-width: 270px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 18px;
}

.admin-reset-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  align-self: end;
}

.admin-reset-form input {
  height: 32px;
}

.admin-reset-form .primary-btn,
.provision-form .primary-btn {
  height: 40px;
  border-radius: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.admin-reset-form .primary-btn::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: currentColor;
  -webkit-mask: var(--icon-reset, var(--icon-record)) center / contain no-repeat;
  mask: var(--icon-reset, var(--icon-record)) center / contain no-repeat;
}

.provision-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provision-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.provision-card-title h3 {
  margin: 0;
}

.provision-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.provision-form label {
  display: grid;
  gap: 6px;
}

.provision-form label span {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.provision-form input,
.provision-form select {
  height: 32px;
  border-radius: 0;
  background: #f7f8fa;
}

.provision-form select {
  border: 1px solid var(--border);
  color: var(--text);
}

.provision-form label.hidden {
  display: none;
}

.provision-form .primary-btn {
  grid-column: 3;
  justify-self: end;
  min-width: 140px;
}

/* 公司主账号的子账号表单需要比厂家账号配置卡更宽，避免字段文字被截断。 */
.company-subaccount-grid {
  grid-template-columns: minmax(640px, 760px);
}

.company-subaccount-grid .user-admin-card {
  min-height: 0;
}

.company-subaccount-grid .provision-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-subaccount-grid .provision-form input {
  width: 100%;
  min-width: 0;
}

.account-availability-hint {
  min-height: 16px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 16px;
}

.account-availability-hint.is-available {
  color: #1f7a4d;
}

.account-availability-hint.is-unavailable {
  color: var(--danger);
}

.company-subaccount-grid .provision-form .primary-btn {
  grid-column: 1 / -1;
  justify-self: end;
}

.provision-form .primary-btn::before {
  content: "+";
  margin-right: 8px;
  font-size: 18px;
  line-height: 1;
}

.user-system-card {
  overflow: hidden;
}

.system-users-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.system-users-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.system-users-head h2::before {
  content: "";
  width: 22px;
  height: 22px;
  background: var(--text-soft);
  -webkit-mask: var(--icon-user) center / contain no-repeat;
  mask: var(--icon-user) center / contain no-repeat;
}

.user-search-input {
  width: 250px;
  height: 32px;
  padding-left: 36px;
  border-radius: 0;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234e5969' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 14px 14px;
}

.system-users-table-wrap {
  overflow-x: auto;
}

.account-table-section {
  border-top: 12px solid #f6f8fb;
}

.account-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.account-table-title strong {
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.account-table-title span,
.staff-role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.system-users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.system-users-table th,
.system-users-table td {
  height: 54px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.system-users-table th {
  height: 40px;
  background: #f3f6f9;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.system-users-table td {
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
}

.system-users-table th:nth-child(1),
.system-users-table td:nth-child(1) {
  width: 92px;
}

.system-users-table th:nth-child(4),
.system-users-table td:nth-child(4) {
  width: 130px;
}

.system-users-table th:nth-child(5),
.system-users-table td:nth-child(5) {
  width: 180px;
}

.system-users-table th:nth-child(6),
.system-users-table td:nth-child(6) {
  width: 150px;
  text-align: right;
}

.customer-users-table th:nth-child(1),
.customer-users-table td:nth-child(1) { width: 92px; }

.customer-users-table th:nth-child(2),
.customer-users-table td:nth-child(2) { width: 180px; }

.customer-users-table th:nth-child(3),
.customer-users-table td:nth-child(3) { width: 150px; }

.customer-users-table th:nth-child(4),
.customer-users-table td:nth-child(4) { width: 164px; }

.customer-users-table th:nth-child(5),
.customer-users-table td:nth-child(5) { width: 130px; }

.customer-users-table th:nth-child(6),
.customer-users-table td:nth-child(6) { width: 180px; }

.customer-users-table th:nth-child(7),
.customer-users-table td:nth-child(7) { width: 150px; text-align: right; }

.company-discount-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-discount-control input {
  width: 72px;
  min-width: 72px;
  text-align: right;
}

.company-discount-control span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.company-discount-note {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.customer-order-total-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: #fff;
}

.customer-order-total-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.customer-order-total-main span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.customer-order-total-main strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
}

.customer-order-total-main small {
  color: var(--text-muted);
  font-size: 12px;
}

.customer-order-total-breakdown {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.customer-order-total-breakdown div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.customer-order-total-breakdown dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-order-total-breakdown dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .customer-order-total-card {
    display: grid;
    gap: 8px;
  }

  .customer-order-total-breakdown {
    min-width: 0;
    padding: 0;
  }

  .customer-order-total-breakdown {
    flex-wrap: wrap;
  }
}

.current-password-value {
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.system-user-row:hover td {
  background: #f8fbff;
}

.password-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 9px;
  border: 1px solid rgba(43, 164, 113, 0.22);
  border-radius: 999px;
  background: rgba(43, 164, 113, 0.12);
  color: #16794d;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
}

.password-status-pill::before {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}

.password-status-pill.expired {
  border-color: rgba(227, 115, 24, 0.32);
  background: rgba(227, 115, 24, 0.1);
  color: var(--warning);
}

.system-users-table input {
  height: 32px;
  border-radius: 0;
  background: #fff;
}

.system-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.save-user-password-btn,
.delete-user-btn {
  width: 40px;
  min-width: 40px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  border-radius: 2px;
}

.save-user-password-btn::before,
.delete-user-btn::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  display: block;
  margin: 0 auto;
  color: var(--primary);
  -webkit-mask: var(--icon-save, var(--icon-check)) center / contain no-repeat;
  mask: var(--icon-save, var(--icon-check)) center / contain no-repeat;
}

.delete-user-btn::before {
  color: var(--danger);
  -webkit-mask-image: var(--icon-close, var(--icon-delete));
  mask-image: var(--icon-close, var(--icon-delete));
}

.system-users-empty {
  height: 96px;
  color: var(--text-soft) !important;
  text-align: center !important;
}

.system-users-footer {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 12px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 18px;
}

.system-pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.system-pagination button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  color: var(--text-soft);
}

.system-pagination button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

@media (max-width: 1120px) {
  #usersTab {
    max-width: none;
  }

  .users-admin-grid {
    grid-template-columns: 1fr;
  }

  .provision-form {
    grid-template-columns: 1fr;
  }

  .provision-form .primary-btn {
    grid-column: auto;
    justify-self: stretch;
  }

  .system-users-head {
    align-items: stretch;
    flex-direction: column;
  }

  .user-search-input {
    width: 100%;
  }
}

/* Final cleanup: remove decorative icons that render as broken dots/marks */
.page-title::before,
.page-title::after,
.panel > h2::before,
.panel > h2::after,
.info-block h3::before,
.info-block h3::after,
.record-detail-section h3::before,
.record-detail-section h3::after,
.record-detail-meta span::before,
.summary-item::before,
.field span::before,
.admin-access-badge::before,
.system-users-head h2::before,
.password-status-pill::before,
.primary-btn::before,
.ghost-btn::before,
.danger-btn::before,
.record-delete-btn::before,
.model-control-btn::before,
.eye-btn::before,
.save-user-password-btn::before,
.delete-user-btn::before {
  content: none !important;
  display: none !important;
}

.user-card-icon,
.record-card-icon {
  display: none !important;
}

.admin-reset-card {
  grid-template-columns: 1fr !important;
}

.provision-card-title {
  gap: 0;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.record-delete-btn,
.model-control-btn,
.eye-btn {
  gap: 0;
}

/* Input table: keep one parameter per column */
.eye-entry-table {
  min-width: 1380px;
}

.eye-entry-table th,
.eye-entry-table td {
  padding-left: 10px;
  padding-right: 10px;
}

.eye-entry-table input,
.eye-entry-table select {
  width: 100%;
}

/* Lens model preview: reduce chart height in the output page */
.lens-model-canvas-wrap {
  height: 280px !important;
  min-height: 280px !important;
}

#lensModelCanvas {
  height: 280px !important;
  min-height: 280px !important;
}

.lens-continuity-panel {
  margin-top: 12px;
  padding-top: 12px;
}

.record-eye-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.record-eye-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.record-eye-card h4 {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #f3f6f9;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.record-eye-param-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.record-eye-param-table th,
.record-eye-param-table td {
  height: 32px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 16px;
  text-align: left;
}

.record-eye-param-table tr:last-child th,
.record-eye-param-table tr:last-child td {
  border-bottom: 0;
}

.record-eye-param-table th {
  width: 56%;
  background: #f7f9fc;
  color: var(--text);
  font-weight: 700;
}

.record-eye-param-table td {
  color: var(--text);
}

.record-eye-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
}

.users-dashboard-head {
  align-items: flex-start;
}

.admin-reset-card p {
  max-width: none;
}

.system-users-footer {
  min-height: 44px;
  padding: 10px 14px;
}

.system-pagination {
  display: none !important;
}

.save-user-password-btn,
.delete-user-btn {
  width: auto !important;
  min-width: 64px !important;
  padding: 0 12px !important;
  overflow: visible !important;
  color: var(--primary) !important;
}

.delete-user-btn {
  color: var(--danger) !important;
}

@media (max-width: 980px) {
  .record-eye-columns {
    grid-template-columns: 1fr;
  }
}

/* Mine page: Stitch account profile layout with local avatar */
.header-avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
  background: #e8f0ff;
}

#mineTab {
  display: block !important;
  max-width: 1060px;
}

#mineTab.hidden {
  display: none !important;
}

.mine-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.mine-page-head .page-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
}

.mine-page-head .page-subtitle {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 18px;
}

.logout-action {
  height: 40px;
  min-width: 98px;
  border-color: #ffb4ab;
  color: var(--danger);
}

.mine-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 24px;
  align-items: start;
}

.mine-main-column {
  display: grid;
  gap: 24px;
}

.mine-profile-card,
.mine-institution-card,
.mine-learn-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 28, 30, 0.04);
}

.mine-profile-card {
  padding: 24px;
}

.mine-profile-top {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.avatar-upload-box {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.mine-avatar {
  width: 80px;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: cover;
  background: #f3f6f9;
}

.avatar-upload-btn {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.mine-profile-identity h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
}

.mine-profile-identity p {
  margin: 4px 0 12px;
  color: var(--primary);
  font-size: 14px;
  line-height: 20px;
}

.mine-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mine-status-badge,
.mine-role-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
}

.mine-status-badge {
  background: rgba(43, 164, 113, 0.14);
  color: #16794d;
}

.mine-role-badge {
  background: #edeef0;
  color: var(--text-soft);
}

.mine-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 36px;
  padding-top: 22px;
}

.mine-profile-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mine-profile-field strong {
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.mine-institution-card {
  padding: 20px 24px 24px;
}

.mine-institution-card h3 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.mine-institution-table {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.mine-institution-table div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 40px;
  border-bottom: 1px solid var(--border);
}

.mine-institution-table div:last-child {
  border-bottom: 0;
}

.mine-institution-table span,
.mine-institution-table strong {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  line-height: 18px;
}

.mine-institution-table span {
  background: #f3f6f9;
  color: var(--text-soft);
  font-weight: 600;
}

.mine-institution-table strong {
  color: var(--text);
  font-weight: 600;
}

.mine-learn-card {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: var(--text);
  text-decoration: none;
}

.mine-learn-card strong {
  display: block;
  font-size: 16px;
  line-height: 24px;
}

.mine-learn-card span {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 18px;
}

.learn-arrow {
  color: var(--text) !important;
  font-size: 28px !important;
}

.mine-support-card {
  min-height: 420px;
  padding: 28px 24px;
  border-radius: 6px;
  background: var(--surface-card);
  color: var(--text);
}

.mine-support-card h3 {
  margin: 0 0 26px;
  color: #fff;
  font-size: 18px;
  line-height: 26px;
  font-weight: 800;
}

.support-block {
  margin-bottom: 22px;
}

.support-block span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.support-block strong {
  color: #fff;
  font-size: 17px;
  line-height: 24px;
  font-weight: 800;
}

.support-block p {
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
}

.support-divider {
  height: 1px;
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.22);
}

.support-qr-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.support-qr-row img {
  width: 78px;
  height: 78px;
  background: #fff;
  object-fit: contain;
}

.support-qr-row span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 17px;
}

@media (max-width: 1080px) {
  .mine-dashboard {
    grid-template-columns: 1fr;
  }

  .mine-support-card {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .mine-page-head,
  .mine-profile-top {
    flex-direction: column;
  }

  .mine-profile-grid,
  .mine-institution-table div {
    grid-template-columns: 1fr;
  }
}

/* Records page refinement: list only selects, detail owns actions */
.records-list-head {
  grid-template-columns: 1fr !important;
}

#recordsTab .record-list-row {
  grid-template-columns: 1fr !important;
}

#recordsTab .record-delete-btn {
  display: none !important;
}

.record-detail-button-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.record-detail-delete-btn {
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 2px;
}

.phase1-order-list-title {
  padding: 10px 14px 6px;
  font-size: 12px;
  font-weight: 800;
  color: #5d6b82;
  letter-spacing: 0;
}

.phase1-stage-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.phase1-stage-tab:hover {
  border-color: #9ab8dc;
  color: #153c63;
}

.phase1-stage-tab.active {
  border-color: #2f6fae;
  background: #eef6ff;
  color: #153c63;
}

.phase1-stage-tab strong {
  min-width: 24px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e8edf5;
  color: #153c63;
  font-size: 12px;
}

.phase1-stage-tab.active strong {
  background: #2f6fae;
  color: #fff;
}

.customer-stage-counts {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 0 0 auto;
}

.customer-stage-update {
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dock-item.has-order-update .dock-dot {
  opacity: 1;
  background: #e53e3e;
  box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.16);
}

.dock-item.has-order-update .dock-label::after {
  content: "更新";
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  vertical-align: middle;
}

.phase1-order-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  max-width: min(320px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #ffffff;
  color: #153c63;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(15, 35, 60, 0.18);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.phase1-order-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.phase1-order-item strong {
  font-size: 13px;
  color: #153c63;
}

.phase1-order-item small {
  display: block;
}

.phase1-order-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.phase1-order-row-main {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.phase1-order-row-note {
  display: grid;
  gap: 2px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid #cfe0f5;
  border-radius: 6px;
  background: #f8fbff;
}

.phase1-order-row-note b {
  color: #153c63;
  font-size: 12px;
  line-height: 16px;
}

.phase1-order-row-note span {
  color: #475569;
  font-size: 11px !important;
  line-height: 15px !important;
  word-break: break-word;
}

.phase1-order-row-note.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.phase1-order-row-note.success b {
  color: #047857;
}

.phase1-order-row-note.warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.phase1-order-row-note.warning b {
  color: #9a3412;
}

.phase1-order-row-note.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.phase1-order-row-note.danger b {
  color: #b91c1c;
}

.phase1-order-row-company {
  margin-top: 7px;
}

#recordsTab .record-list-row.phase1-list-success {
  border-left: 4px solid #16a34a;
}

#recordsTab .record-list-row.phase1-list-warning {
  border-left: 4px solid #f97316;
}

#recordsTab .record-list-row.phase1-list-danger {
  border-left: 4px solid #dc2626;
}

#recordsTab .record-list-row.phase1-list-info {
  border-left: 4px solid #2f6fae;
}

#recordsTab .record-list-row.active.phase1-list-success {
  background: #f0fdf4;
}

#recordsTab .record-list-row.active.phase1-list-warning {
  background: #fff7ed;
}

#recordsTab .record-list-row.active.phase1-list-danger {
  background: #fef2f2;
}

#recordsTab .record-list-row.active.phase1-list-info {
  background: #eff6ff;
}

.phase1-list-status-line {
  display: flex;
  align-items: center;
  margin-top: 5px;
}

.phase1-flow-marker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  gap: 6px;
  color: #172033;
  font-size: 12px;
  line-height: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.phase1-flow-marker i {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-style: normal;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
}

.phase1-flow-marker span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase1-flow-marker.success i {
  background: #bbf7d0;
  color: #047857;
}

.phase1-flow-marker.warning i {
  background: #fed7aa;
  color: #9a3412;
}

.phase1-flow-marker.danger i {
  background: #fecaca;
  color: #b91c1c;
}

/* Compact order list preview: order number/date, patient/status */
#recordsTab .record-list-row {
  border-left: 0 !important;
}

#recordsTab .record-list-row.active {
  background: #edf3ff !important;
}

#recordsTab .phase1-order-item {
  min-height: 42px;
  padding: 5px 12px;
  display: grid;
  align-content: center;
  gap: 1px;
}

#recordsTab .phase1-order-item strong,
#recordsTab .phase1-order-item span,
#recordsTab .phase1-order-item small,
#recordsTab .phase1-order-preview-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#recordsTab .phase1-order-preview-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

#recordsTab .phase1-order-preview-line.secondary {
  gap: 6px;
}

#recordsTab .phase1-order-item strong {
  font-size: 13px;
  line-height: 17px;
  font-weight: 800;
}

#recordsTab .phase1-order-item span {
  font-size: 12px;
  line-height: 15px;
  font-weight: 600;
  color: #172033;
}

#recordsTab .phase1-order-item small {
  font-size: 11px;
  line-height: 14px;
  color: #64748b;
}

#recordsTab .phase1-order-item .phase1-order-row-head,
#recordsTab .phase1-order-item .phase1-order-row-main,
#recordsTab .phase1-order-item .phase1-order-row-note,
#recordsTab .phase1-order-item .phase1-order-row-company {
  display: none;
}

#recordsTab .phase1-order-item .phase1-flow-marker {
  min-height: 18px;
  gap: 4px;
  font-size: 11px;
  line-height: 14px;
  max-width: 112px;
}

#recordsTab .phase1-order-item .phase1-flow-marker i {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border-radius: 6px;
  font-size: 12px;
}

.phase1-flow-detail {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #cfe0f5;
  border-left: 4px solid #2f6fae;
  border-radius: 6px;
  background: #f8fbff;
  color: #153c63;
}

.phase1-flow-detail.success {
  border-color: #bbf7d0;
  border-left-color: #16a34a;
  background: #f6fef9;
  color: #14532d;
}

.phase1-flow-detail.warning {
  border-color: #fed7aa;
  border-left-color: #f97316;
  background: #fffaf3;
  color: #7c2d12;
}

.phase1-flow-detail.danger {
  border-color: #fecaca;
  border-left-color: #dc2626;
  background: #fff7f7;
  color: #7f1d1d;
}

.phase1-flow-detail div {
  display: grid;
  gap: 4px;
}

.phase1-flow-detail strong {
  font-size: 15px;
  line-height: 22px;
  font-weight: 900;
}

.phase1-flow-detail span,
.phase1-flow-detail small,
.phase1-flow-detail em {
  font-size: 12px;
  line-height: 18px;
}

.phase1-flow-detail em {
  font-style: normal;
  font-weight: 800;
}

.phase1-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.phase1-flow-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  line-height: 18px;
  font-weight: 800;
}

.phase1-flow-steps span.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.phase1-flow-steps span.current {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.phase1-flow-steps span.muted {
  color: #94a3b8;
}

.phase1-flow-steps span.returned {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.phase1-status-card,
.phase1-history-card {
  margin-top: 14px;
}

.phase1-status-controls {
  display: grid;
  gap: 12px;
}

.phase1-current-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e7ef;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 13px;
}

.phase1-current-status span {
  color: #5d6b82;
  font-weight: 700;
}

.phase1-current-status strong {
  color: #153c63;
}

.phase1-status-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #5b6575;
  font-weight: 700;
}

.phase1-status-controls select,
.phase1-status-controls textarea {
  width: 100%;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  color: #172033;
  background: #fff;
}

.phase1-status-controls textarea {
  min-height: 82px;
  resize: vertical;
}

.phase1-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.phase1-status-history {
  display: grid;
  gap: 8px;
}

.phase1-status-history-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.8fr) minmax(130px, 1fr) minmax(80px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e2e7ef;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
}

.phase1-status-history-row strong {
  color: #153c63;
}

.phase1-status-history-row span {
  color: #5d6b82;
}

.phase1-status-history-row em {
  grid-column: 1 / -1;
  color: #475569;
  font-style: normal;
}

.record-status-pill.phase1-status-pending_confirmation {
  background: #fff7ed;
  color: #9a3412;
}

.record-status-pill.phase1-status-accepted {
  background: #ecfdf5;
  color: #047857;
}

.record-status-pill.phase1-status-in_production {
  background: #eff6ff;
  color: #1d4ed8;
}

.record-status-pill.phase1-status-completed {
  background: #f0fdf4;
  color: #15803d;
}

.record-status-pill.phase1-status-shipped,
.record-status-pill.phase1-status-signed {
  background: #eef2ff;
  color: #3730a3;
}

.record-status-pill.phase1-status-returned {
  background: #fef2f2;
  color: #b91c1c;
}

/* Advanced adjustment panel */
.advanced-adjust-panel {
  grid-column: 1 / -1;
}

.advanced-adjust-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.advanced-adjust-header h2 {
  margin: 0 0 4px;
}

.advanced-adjust-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d8dee8;
}

.advanced-adjust-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 12px;
}

.advanced-adjust-field {
  display: grid;
  gap: 6px;
  color: #172033;
  font-size: 12px;
  font-weight: 700;
}

.advanced-adjust-field select,
.advanced-adjust-field input[type="number"],
.advanced-adjust-field textarea {
  width: 100%;
  height: 34px;
  border: 1px solid #d1d8e5;
  border-radius: 4px;
  background: #fff;
  color: #0f172a;
  padding: 0 10px;
  font: inherit;
}

.processing-adjustment-card {
  margin-top: 14px;
}

.processing-adjustment-note {
  margin-top: 12px;
}

.processing-adjustment-note textarea {
  min-height: 74px;
  resize: vertical;
}

.processing-adjustment-history ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.processing-adjustment-history li + li {
  margin-top: 6px;
}

.processing-adjustment-preview {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}

.customer-output-version + .customer-output-version {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #d8dee8;
}

.customer-output-version > header {
  color: #172033;
  font-weight: 700;
}

.customer-output-version > .muted {
  margin: 4px 0 10px;
}

.advanced-adjust-field .advanced-quarter-step-input {
  padding-right: 4px;
}

.advanced-adjust-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .advanced-adjust-grid {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }
}

@media (max-width: 640px) {
  .advanced-adjust-header,
  .advanced-adjust-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .advanced-adjust-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}

/* Phase 2 order fields */
.phase2-order-extra-panel {
  border-left: 3px solid #2563eb;
}

.phase2-order-extra-grid,
.phase2-default-shipping-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.phase2-order-extra-grid textarea,
.phase2-default-shipping-form textarea {
  width: 100%;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  resize: vertical;
}

.phase2-address-field,
.phase2-address-detail-field,
.phase2-note-field {
  grid-column: span 2;
}

.shipping-region-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shipping-region-grid select {
  width: 100%;
}

.phase2-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #1e2d44;
  font-size: 13px;
  font-weight: 800;
}

.phase2-inline-check input {
  width: 16px;
  height: 16px;
}

.phase2-default-shipping-card {
  margin-top: 16px;
}

.phase2-default-shipping-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.record-list-row {
  position: relative;
}

.record-list-row .phase2-batch-check {
  position: absolute;
  left: 8px;
  top: 50%;
  z-index: 2;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
}

.record-list-row .phase2-batch-check + .record-item {
  padding-left: 34px;
}

.phase2-batch-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #dbe3ef;
  background: #f8fafc;
}

.phase2-batch-bar span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.phase2-batch-bar div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.phase2-batch-bar button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.phase2-workorder-card {
  margin-top: 14px;
}

.phase2-workorder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0;
  border-top: 1px solid #dbe3ef;
  border-left: 1px solid #dbe3ef;
}

.phase2-workorder-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.phase2-workorder-table th,
.phase2-workorder-table td {
  min-height: 32px;
  padding: 8px 10px;
  border-right: 1px solid #dbe3ef;
  border-bottom: 1px solid #dbe3ef;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.45;
}

.phase2-workorder-table th {
  width: 96px;
  background: #f1f5f9;
  color: #334155;
  text-align: left;
  font-weight: 800;
}

.phase2-workorder-table td {
  color: #0f172a;
  font-weight: 700;
  word-break: break-word;
}

.phase2-workorder-result-grid {
  align-items: start;
}

.phase2-shipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
}

.phase2-shipment-grid input {
  width: 100%;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  color: #172033;
  background: #fff;
}

@media (max-width: 1180px) {
  .phase2-workorder-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .phase2-order-extra-grid,
  .phase2-default-shipping-form,
  .phase2-shipment-grid {
    grid-template-columns: 1fr;
  }

  .phase2-address-field,
  .phase2-address-detail-field,
    .phase2-note-field {
    grid-column: auto;
  }

  .shipping-region-grid {
    grid-template-columns: 1fr;
  }

  .phase2-default-shipping-actions,
  .phase2-batch-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Commercial UI polish */
:root {
  --surface: #f5f7fb;
  --surface-subtle: #f8fafc;
  --surface-card: #ffffff;
  --border: #d9e1ec;
  --border-strong: #c8d3e2;
  --primary: #0f5bd7;
  --primary-container: #0b63e5;
  --primary-soft: #eaf2ff;
  --success: #16a36b;
  --warning: #f08a24;
  --danger: #d64545;
  --cyan: #0891b2;
  --indigo: #4f46e5;
  --text: #172033;
  --text-soft: #526071;
  --text-muted: #7a8697;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-card: 0 8px 24px rgba(15, 35, 70, 0.06);
  --shadow-soft: 0 1px 2px rgba(15, 35, 70, 0.05);
}

body,
body.login-shell,
.login-view,
.main-view {
  background: var(--surface);
}

.login-view {
  background-image: none;
}

.panel,
.login-card,
.mine-profile-card,
.mine-institution-card,
.mine-learn-card,
.mine-support-card,
.record-clinical-card,
.commercial-summary-card,
.phase1-flow-detail,
.records-panel,
.user-admin-card,
.user-system-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}

.app-header {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.page-title,
.record-detail-title-row h2,
.login-title-block h1 {
  color: var(--text);
  letter-spacing: 0;
}

.record-clinical-card > header,
.mine-institution-card h3,
.mine-support-card h3 {
  min-height: 42px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

input,
select,
textarea,
.record-search-input,
.user-search-input {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus,
.record-search-input:focus,
.user-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 91, 215, 0.12);
}

.required-label::after {
  content: " *";
  color: var(--danger);
  font-weight: 800;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  min-height: 34px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: none;
}

.primary-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  border-color: #0b4eba;
  background: #0b4eba;
}

.ghost-btn {
  border: 1px solid rgba(15, 91, 215, 0.42);
  background: #fff;
  color: var(--primary);
}

.ghost-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.danger-btn {
  border: 1px solid rgba(214, 69, 69, 0.45);
  background: #fff;
  color: var(--danger);
}

.danger-btn:hover {
  border-color: var(--danger);
  background: #fff1f1;
}

button:disabled,
.primary-btn:disabled,
.ghost-btn:disabled,
.danger-btn:disabled {
  border-color: var(--border);
  background: #eef2f6;
  color: var(--text-muted);
  cursor: not-allowed;
}

.records-workspace {
  background: var(--surface);
}

.records-stage-panel,
.records-sidebar {
  border-color: var(--border);
  background: #fff;
}

.records-stage-title,
.records-list-head {
  border-bottom-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  font-weight: 800;
}

#factoryStageTabs {
  padding: 14px 12px;
}

#factoryStageTabs button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

#factoryStageTabs button.active {
  border-color: rgba(15, 91, 215, 0.42);
  background: var(--primary-soft);
  color: var(--primary);
}

.commercial-order-item {
  width: 100%;
  min-height: 54px;
  padding: 8px 12px 8px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 0;
  background: #fff;
  grid-template-columns: minmax(0, 1fr);
  justify-content: start;
  justify-items: start;
  text-align: left;
}

.commercial-order-item:hover,
.record-list-row.active .commercial-order-item {
  background: #eef5ff;
}

.record-list-row.active .commercial-order-item {
  border-left-color: var(--primary);
}

.commercial-order-line,
.commercial-order-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
}

.commercial-order-line {
  width: 100%;
}

.commercial-order-line strong {
  min-width: 0;
  overflow: hidden;
  color: #003f9e;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commercial-order-meta {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 12px;
}

.commercial-order-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase1-flow-marker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.phase1-flow-marker i {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 6px;
  background: #e9edf3;
}

.phase1-flow-marker i::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
}

.phase1-flow-marker.warning { color: var(--warning); }
.phase1-flow-marker.success { color: var(--success); }
.phase1-flow-marker.danger { color: var(--danger); }
.phase1-flow-marker.info { color: var(--primary); }
.phase1-flow-marker.primary { color: var(--primary); }
.phase1-flow-marker.indigo { color: var(--indigo); }
.phase1-flow-marker.cyan { color: var(--cyan); }
.phase1-flow-marker.muted { color: var(--text-muted); }

.record-status-pill,
.record-status-pill.phase1-status-pending_confirmation,
.record-status-pill.phase1-status-accepted,
.record-status-pill.phase1-status-in_production,
.record-status-pill.phase1-status-completed,
.record-status-pill.phase1-status-shipped,
.record-status-pill.phase1-status-signed,
.record-status-pill.phase1-status-returned {
  border: 0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.record-status-pill.phase1-status-pending_confirmation { background: #fff3e5; color: #a34f00; }
.record-status-pill.phase1-status-accepted { background: #eaf2ff; color: var(--primary); }
.record-status-pill.phase1-status-in_production { background: #eef0ff; color: var(--indigo); }
.record-status-pill.phase1-status-completed { background: #e6f8fb; color: var(--cyan); }
.record-status-pill.phase1-status-shipped { background: #eaf2ff; color: var(--primary); }
.record-status-pill.phase1-status-signed { background: #e9f8f1; color: var(--success); }
.record-status-pill.phase1-status-returned { background: #fff0f0; color: var(--danger); }
.record-status-pill.phase1-status-cancelled { background: #eef2f7; color: var(--muted); }

.commercial-detail {
  gap: 16px;
}

.commercial-summary-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0;
  overflow: hidden;
}

.commercial-summary-item,
.summary-item.commercial-summary-item {
  min-height: 70px;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.commercial-summary-item span,
.summary-item.commercial-summary-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.commercial-summary-item strong,
.summary-item.commercial-summary-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  word-break: break-word;
}

.commercial-summary-item .is-strong {
  color: #003f9e;
  font-size: 15px;
}

.commercial-stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.commercial-step {
  position: relative;
  min-height: 72px;
  padding: 10px 10px 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.commercial-step-dot {
  position: absolute;
  left: 12px;
  top: 13px;
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: #dbe3ef;
}

.commercial-step.done .commercial-step-dot,
.commercial-step.current .commercial-step-dot {
  background: var(--primary);
}

.commercial-step.current {
  border-color: rgba(15, 91, 215, 0.42);
  background: #f6f9ff;
}

.commercial-step.done {
  background: #fbfdff;
}

.commercial-step.todo {
  color: var(--text-muted);
  background: #fafbfc;
}

.commercial-step.returned {
  border-color: rgba(214, 69, 69, 0.35);
  background: #fff7f7;
}

.commercial-step.returned .commercial-step-dot {
  background: var(--danger);
}

.commercial-step strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.commercial-step small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  line-height: 1.4;
}

.commercial-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.commercial-field {
  min-height: 66px;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.commercial-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.commercial-field strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.eye-param-table-wrap,
.commercial-table-scroll {
  overflow: auto;
  border-color: var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.eye-param-table,
.record-eye-param-table,
.phase2-workorder-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.eye-param-table th,
.eye-param-table td,
.record-eye-param-table th,
.record-eye-param-table td,
.phase2-workorder-table th,
.phase2-workorder-table td {
  border-color: var(--border);
  font-size: 13px;
  line-height: 1.45;
}

.eye-param-table th,
.record-eye-param-table th,
.phase2-workorder-table th {
  background: var(--surface-subtle);
  color: var(--text);
  font-weight: 800;
}

.eye-column-inactive,
.eye-param-table .eye-column-inactive,
.record-eye-param-table .eye-column-inactive {
  background: #f2f5f9 !important;
  color: #98a3b3 !important;
}

.phase2-batch-bar {
  border-bottom-color: var(--border);
  background: #fff;
}

.commercial-no-batch {
  color: var(--text-muted);
  font-size: 12px;
}

.phase2-order-extra-grid,
.phase2-default-shipping-form,
.phase2-shipment-grid {
  gap: 14px;
}

.phase2-default-shipping-card,
.mine-support-card,
.mine-profile-card,
.mine-institution-card {
  box-shadow: var(--shadow-card);
}

.mine-dashboard {
  align-items: start;
  gap: 20px;
}

.mine-avatar,
.header-avatar {
  border: 1px solid var(--border);
  background: var(--primary-soft);
  object-fit: cover;
}

.avatar-upload-box {
  gap: 10px;
}

.mine-profile-field,
.mine-institution-table div,
.support-block {
  border-color: var(--border);
  background: #fff;
}

.mine-support-card {
  padding-bottom: 16px;
}

.mine-support-card h3 {
  margin: 0;
}

.support-block {
  margin: 0 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.support-block span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.support-block strong,
.support-block p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.support-qr-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
  margin: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.support-qr-row img {
  width: 92px;
  height: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  object-fit: cover;
}

.logout-action {
  border-color: var(--border);
  color: var(--text-soft);
}

.header-logout-btn {
  height: 30px;
  min-width: 76px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 28px;
}

@media (max-width: 1280px) {
  .commercial-summary-card,
  .commercial-field-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .commercial-stepper {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .commercial-summary-card,
  .commercial-field-grid,
  .commercial-stepper {
    grid-template-columns: 1fr;
  }

  .commercial-order-meta {
    flex-wrap: wrap;
  }

  .support-qr-row {
    grid-template-columns: 1fr;
  }
}

/* Restore the original service support card treatment. */
.mine-support-card {
  min-height: 420px;
  padding: 28px 24px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #0b57d0, #073b91);
  color: #fff;
  box-shadow: 0 14px 36px rgba(15, 35, 70, 0.12);
}

.mine-support-card h3 {
  min-height: auto;
  margin: 0 0 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 26px;
  font-weight: 800;
}

.mine-support-card .support-block {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  background: transparent;
}

.mine-support-card .support-block span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mine-support-card .support-block strong {
  margin: 0;
  color: #fff;
  font-size: 17px;
  line-height: 24px;
  font-weight: 800;
}

.mine-support-card .support-block p {
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
}

.mine-support-card .support-divider {
  height: 1px;
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.22);
}

.mine-support-card .support-qr-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 34px 0 0;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background: transparent;
}

.mine-support-card .support-qr-row img {
  width: 108px;
  height: 108px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}

.mine-support-card .support-qr-row span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}

/* After-sales workflow */
#afterSalesTab {
  gap: 0;
}

#afterSalesTab > .after-sales-panel {
  height: calc(100vh - var(--header-height) - 16px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.after-sales-workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px 360px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #fff;
}

#afterSalesTab .records-stage-panel,
#afterSalesTab .records-sidebar {
  min-height: 0;
  border-right: 1px solid var(--border);
  background: #fff;
}

#afterSalesTab .records-stage-panel {
  background: #f8fafc;
}

#afterSalesStageTabs {
  display: grid;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
}

#afterSalesTab .record-search-input {
  width: calc(100% - 32px);
  height: 34px;
  margin: 16px;
}

#afterSalesTab .records-list {
  min-height: 0;
  overflow-y: auto;
}

#afterSalesTab .record-detail-panel {
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: var(--surface);
  overflow-y: auto;
}

#afterSalesTab .record-detail-shell {
  min-height: 100%;
  padding: 24px;
}

.commercial-order-badges {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  min-width: 0;
  text-align: left;
}

.after-sales-mini-badge,
.after-sales-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.after-sales-mini-badge {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 11px;
}

.after-sales-status.warning,
.after-sales-mini-badge.warning {
  background: #fff3e5;
  color: #a34f00;
}

.after-sales-status.indigo,
.after-sales-mini-badge.indigo {
  background: #eef0ff;
  color: var(--indigo);
}

.after-sales-status.primary,
.after-sales-mini-badge.primary {
  background: #eaf2ff;
  color: var(--primary);
}

.after-sales-status.success,
.after-sales-mini-badge.success {
  background: #e9f8f1;
  color: var(--success);
}

.after-sales-status.muted,
.after-sales-mini-badge.muted {
  background: #eef2f6;
  color: var(--text-muted);
}

.after-sales-order-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.after-sales-history-list {
  display: grid;
  gap: 10px;
}

.after-sales-compact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.after-sales-compact-item strong {
  display: block;
  color: #003f9e;
  font-size: 14px;
  font-weight: 900;
}

.after-sales-compact-item span {
  color: var(--text-soft);
  font-size: 12px;
}

.after-sales-compact-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.after-sales-create-form {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.after-sales-policy-notice {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe8f7;
  border-radius: 6px;
  background: #f7fbff;
}

.after-sales-policy-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.after-sales-policy-title strong {
  color: #183b5c;
  font-size: 13px;
}

.after-sales-policy-title span {
  color: #64748b;
  font-size: 11px;
}

.after-sales-policy-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.after-sales-policy-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-left: 8px;
  border-left: 3px solid #94bfe8;
}

.after-sales-policy-item strong {
  color: #1e3a5f;
  font-size: 12px;
}

.after-sales-policy-item span {
  color: #42617d;
  font-size: 11px;
  line-height: 1.4;
}

.after-sales-policy-item.expired {
  border-left-color: #cbd5e1;
}

.after-sales-policy-item.expired strong,
.after-sales-policy-item.expired span {
  color: #94a3b8;
}

.after-sales-policy-item.pending {
  border-left-color: #d6a24a;
}

.after-sales-type-row {
  width: min(100%, 320px);
}

.after-sales-type-row label {
  display: grid;
  gap: 6px;
}

.after-sales-type-row span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.after-sales-type-row select {
  width: 100%;
}

@media (max-width: 640px) {
  .after-sales-policy-list {
    grid-template-columns: 1fr;
  }
}

.after-sales-full-field {
  display: grid;
  gap: 6px;
}

.after-sales-full-field span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.after-sales-list-item {
  width: 100%;
  text-align: left;
}

.after-sales-list-item.active {
  border-left-color: var(--primary);
  background: #eef5ff;
}

.after-sales-text-block {
  padding: 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.after-sales-fulfillment-card > header {
  border-bottom: 1px solid #dce7f4;
}

.after-sales-fulfillment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.after-sales-fulfillment-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.after-sales-fulfillment-grid span {
  color: #64748b;
  font-size: 12px;
}

.after-sales-fulfillment-grid strong {
  overflow: hidden;
  color: #0f4f9d;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.after-sales-fulfillment-empty,
.after-sales-fulfillment-compact {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 20px;
}

.after-sales-fulfillment-empty {
  padding: 14px 16px;
}

.after-sales-fulfillment-compact {
  padding-top: 4px;
}

@media (max-width: 760px) {
  .after-sales-fulfillment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .after-sales-fulfillment-grid > button {
    justify-self: start;
  }
}

.after-sales-action-card .phase1-status-controls {
  padding: 16px;
}

.phase1-required-action {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 91, 215, 0.22);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: #f5f9ff;
}

.phase1-required-action strong {
  color: #003f9e;
  font-size: 15px;
  line-height: 20px;
  font-weight: 900;
}

.phase1-required-action span {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 18px;
}

.phase1-required-action.indigo {
  border-color: rgba(79, 70, 229, 0.24);
  border-left-color: var(--indigo);
  background: #f7f7ff;
}

.phase1-required-action.indigo strong {
  color: var(--indigo);
}

.phase1-required-grid {
  padding: 12px;
  border: 1px solid rgba(15, 91, 215, 0.22);
  border-radius: var(--radius-sm);
  background: #fbfdff;
}

.phase1-required-field span::after {
  content: " *";
  color: var(--danger);
  font-weight: 900;
}

.phase1-required-field input {
  border-color: rgba(15, 91, 215, 0.42);
  background: #fff;
  font-weight: 700;
}

.phase1-required-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 91, 215, 0.14);
}

.backup-data-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.notification-count {
  position: absolute;
  top: 5px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 900;
}

.notification-panel {
  position: fixed;
  top: 48px;
  right: 20px;
  z-index: 80;
  width: 360px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.16);
  overflow: hidden;
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.notification-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notification-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1;
}

.notification-close-btn:hover {
  border-color: #9ab9e7;
  color: var(--primary);
  background: #f7fbff;
}

.notification-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}

.notification-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  text-align: left;
}

.notification-item.unread {
  background: #f2f7ff;
}

.notification-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.notification-item span,
.notification-item small {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.record-filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.record-filter-bar select,
.record-filter-bar input {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.record-filter-bar .ghost-btn {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.order-address-selector {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.order-address-selector label {
  display: grid;
  gap: 6px;
}

.order-address-selector span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.shipping-readonly-input {
  border-color: #d8e1ef !important;
  background: #f6f8fb !important;
  color: #475569 !important;
  cursor: not-allowed;
}

.address-book-card {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.address-book-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.address-book-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.address-book-list {
  display: grid;
  gap: 10px;
}

.address-book-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.address-book-item strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.address-book-item span,
.address-book-item p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.address-book-item > div:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 760px) {
  .after-sales-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  #afterSalesTab > .after-sales-panel {
    height: auto;
  }

  .after-sales-compact-item {
    grid-template-columns: 1fr;
  }

  .commercial-order-badges {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .record-filter-bar,
  .address-book-item {
    grid-template-columns: 1fr;
  }
}
.dock-count-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.dock-count-badge.factory-new-badge {
  background: #dc2626;
  font-size: 12px;
}

.phase3-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.32);
}

.phase3-modal {
  width: min(1120px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #d8e1ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.phase3-modal-head,
.phase3-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5ebf4;
}

.phase3-modal-actions {
  border-top: 1px solid #e5ebf4;
  border-bottom: 0;
  justify-content: flex-end;
}

.phase3-modal-head h2 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.phase3-modal-head p {
  margin: 5px 0 0;
  color: #64748b;
}

.app-dialog-overlay {
  z-index: 1200;
}

.app-confirm-modal {
  width: min(460px, calc(100vw - 36px));
  overflow: hidden;
}

.app-confirm-head {
  align-items: flex-start;
  border-bottom: 0;
  padding-bottom: 10px;
}

.app-confirm-head h2 {
  font-size: 18px;
}

.app-confirm-head p {
  color: #334155;
  line-height: 1.7;
  white-space: pre-line;
}

.app-dialog-form {
  display: grid;
  gap: 12px;
  padding: 0 20px 18px;
}

.app-dialog-form label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.app-dialog-form input,
.app-dialog-form textarea {
  width: 100%;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  padding: 9px 10px;
  color: #0f172a;
  background: #fff;
}

.phase3-review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 20px 8px;
}

.phase3-review-summary div,
.phase3-review-table-card {
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  background: #fff;
}

.phase3-review-summary div {
  padding: 10px 12px;
}

.phase3-review-summary span,
.phase3-review-check span {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.phase3-review-summary strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 13px;
}

#orderSearchTab .record-search-input {
  width: 100%;
  height: 32px;
  margin: 0;
  border-radius: 2px;
  background-color: #fff;
  font-size: 13px;
}

.order-search-status {
  min-height: 30px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: #64748b;
  font-size: 12px;
  line-height: 14px;
}

.order-search-results {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.order-search-empty {
  padding: 18px 12px;
  color: #64748b;
  font-size: 13px;
}

.order-search-table-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.order-search-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.order-search-table th,
.order-search-table td {
  min-height: 34px;
  padding: 7px 8px;
  border-right: 1px solid #dbe4ef;
  border-bottom: 1px solid #dbe4ef;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  vertical-align: middle;
}

.order-search-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.order-search-table th:nth-child(1),
.order-search-table td:nth-child(1) {
  width: 86px;
}

.order-search-table th:nth-child(2),
.order-search-table td:nth-child(2) {
  width: 128px;
}

.order-search-table th:nth-child(3),
.order-search-table td:nth-child(3) {
  width: 220px;
}

.order-search-table th:nth-child(6),
.order-search-table td:nth-child(6),
.order-search-table th:nth-child(7),
.order-search-table td:nth-child(7),
.order-search-table th:nth-child(8),
.order-search-table td:nth-child(8) {
  word-break: break-all;
}

.order-search-table th:nth-child(9),
.order-search-table td:nth-child(9) {
  width: 112px;
}

.order-search-table th:nth-child(10),
.order-search-table td:nth-child(10) {
  width: 104px;
  text-align: center;
}

.order-search-table td:nth-child(10) .compact-btn {
  margin-right: 0;
  white-space: nowrap;
}

.order-search-table tbody tr.active,
.order-search-table tbody tr:hover {
  background: #f8fbff;
}

.order-search-table td small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.order-search-hit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.order-search-hit-tag {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid #c8d7ea;
  border-radius: 6px;
  background: #eef6ff;
  color: #153c63;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.order-search-detail .order-search-hit-list {
  padding: 10px;
}

.phase3-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 12px 20px;
}

.phase3-review-table-card header {
  padding: 10px 12px;
  border-bottom: 1px solid #e5ebf4;
  color: #0f172a;
  font-weight: 700;
}

.phase3-review-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 20px 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.phase3-review-policy-note {
  margin: 2px 20px 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

.phase3-review-check span {
  color: #0f172a;
  font-size: 14px;
}

#orderReviewError {
  margin: 0 20px 12px;
}

.phase3-todo-card {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.phase3-todo-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.phase3-todo-body strong,
.phase3-message-meta strong {
  display: block;
  color: #0f172a;
}

.phase3-todo-body span {
  display: block;
  margin-top: 4px;
  color: #475569;
}

.phase3-message-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phase3-message-list {
  display: grid;
  gap: 10px;
}

.phase3-message-item {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.phase3-message-item.customer {
  border-left: 3px solid #2563eb;
}

.phase3-message-item.admin {
  border-left: 3px solid #64748b;
  background: #f8fafc;
}

.phase3-message-item.system {
  border-style: dashed;
  background: #f9fafb;
}

.phase3-message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.phase3-message-item p {
  margin: 8px 0 0;
  color: #1f2937;
  line-height: 1.6;
  white-space: pre-wrap;
}

.phase3-message-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.phase3-message-form textarea {
  width: 100%;
  resize: vertical;
}

.phase3-message-form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phase3-unread-badge,
.phase3-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.phase3-tag.urgent {
  background: #fff7ed;
  color: #c2410c;
}

.phase3-order-item {
  border-left: 3px solid transparent;
}

.record-list-row.active .phase3-order-item {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.phase3-order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.phase3-order-line strong,
.phase3-order-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase3-order-line.secondary,
.phase3-order-line.tags {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}

.phase3-order-line.tags {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.phase3-empty-state {
  margin: 14px;
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
}

.phase3-empty-state strong,
.phase3-empty-state span {
  display: block;
}

.phase3-empty-state strong {
  color: #0f172a;
}

.phase3-admin-card .phase2-shipment-grid select,
.phase3-admin-card .phase2-shipment-grid input {
  min-height: 38px;
}

.phase3-production-check,
.phase3-shipping-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #475569;
}

.phase3-production-check strong,
.phase3-shipping-summary strong {
  color: #0f172a;
}

.shipment-compact-table-wrap {
  overflow: auto;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.shipment-compact-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.shipment-compact-toolbar strong {
  color: #0f172a;
  font-size: 14px;
}

.shipment-required-alert {
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid #f3b4ae;
  border-radius: 6px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  background: #fff7f7;
}

.shipping-merge-group {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.shipping-merge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5ebf4;
  background: #f6f8fb;
}

.shipping-merge-head > div {
  min-width: 0;
}

.shipping-merge-head strong,
.shipping-merge-head span {
  display: block;
}

.shipping-merge-head strong {
  color: #0f172a;
  font-size: 13px;
}

.shipping-merge-head span {
  margin-top: 3px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipping-merge-head > div:last-child {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.shipping-merge-single {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.merge-shipment-modal {
  width: min(980px, 96vw);
}

.merge-shipment-body {
  display: grid;
  gap: 14px;
  padding: 16px 20px;
}

.merge-shipment-modal [data-merge-shipment-record] {
  min-width: 12px;
  min-height: 12px;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  vertical-align: middle;
}

.merge-shipment-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

#recordsTab .phase2-batch-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 8px 10px;
  padding: 8px 10px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fbff;
}

#recordsTab .phase2-batch-action-bar > div {
  min-width: 0;
}

#recordsTab .phase2-batch-action-bar strong,
#recordsTab .phase2-batch-action-bar span {
  display: block;
}

#recordsTab .phase2-batch-action-bar strong {
  color: #0f172a;
  font-size: 13px;
}

#recordsTab .phase2-batch-action-bar span {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

#recordsTab .phase2-batch-action-bar button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  white-space: nowrap;
}

#recordsTab .review-order-visibility-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 8px 0;
}

#recordsTab .review-order-visibility-btn {
  margin-right: 0;
}

#recordsTab .review-order-visibility-btn.is-hidden {
  border-color: #94a3b8;
  background: #e2e8f0;
  color: #475569;
}

#recordsTab .order-month-list .record-list-row:has(.phase2-batch-check) {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: stretch;
  column-gap: 6px;
}

#recordsTab .order-month-list .record-list-row .phase2-batch-check {
  position: static;
  align-self: center;
  justify-self: center;
  z-index: auto;
  width: 15px;
  height: 15px;
  transform: none;
}

#recordsTab .order-month-list .record-list-row .phase2-batch-check + .record-item {
  min-width: 0;
  padding-left: 10px;
}

#recordsTab .order-month-list {
  padding: 5px 6px;
}

#recordsTab .order-month-list .record-list-row {
  margin: 0 0 5px;
}

#recordsTab .order-month-list .record-list-row:has(.phase2-batch-check) {
  display: block;
  position: relative;
}

#recordsTab .phase3-order-item {
  min-height: 40px;
  gap: 2px;
  padding: 5px 34px 5px 8px;
}

#recordsTab .phase3-order-line {
  gap: 6px;
  line-height: 1.2;
}

#recordsTab .phase3-order-line strong {
  font-size: 13px;
}

#recordsTab .phase3-order-line.secondary {
  margin-top: 2px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
  color: #334155;
  font-size: 12px;
}

#recordsTab .phase3-order-line.secondary span {
  flex: 0 1 auto;
  min-width: 0;
}

#recordsTab .phase3-order-line.secondary span:first-child {
  max-width: 56px;
}

#recordsTab .phase3-order-line.secondary .production-mini-badge,
#recordsTab .phase3-order-line.secondary .phase3-tag {
  flex: 0 0 auto;
}

#recordsTab .phase2-batch-check {
  position: absolute;
  top: 8px;
  right: 10px;
  left: auto;
  z-index: 3;
  margin: 0;
  transform: none;
}

#recordsTab .production-mini-badge {
  min-height: 18px;
  padding: 1px 6px;
  font-size: 11px;
}

#recordsTab .order-month-list .record-list-row:has(.phase2-batch-check) {
  display: block;
  position: relative;
}

#recordsTab .order-month-list .record-list-row .phase2-batch-check {
  position: absolute;
  top: 8px;
  right: 10px;
  left: auto;
  z-index: 4;
  width: 14px;
  height: 14px;
  margin: 0;
  transform: none;
}

#recordsTab .order-month-list .record-list-row .phase2-batch-check + .record-item {
  width: 100%;
  padding-right: 34px;
  padding-left: 8px;
}

.shipment-compact-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.shipment-compact-table th,
.shipment-compact-table td {
  height: 36px;
  padding: 7px 9px;
  border-right: 1px solid #d8e2ef;
  border-bottom: 1px solid #d8e2ef;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.shipment-compact-table th {
  min-width: 80px;
  max-width: 10em;
  background: #f6f8fb;
  color: #0f172a;
  font-weight: 800;
}

.shipment-compact-table td {
  color: #0f172a;
}

.shipment-compact-table td:not(.shipment-address-cell) {
  white-space: nowrap;
}

.shipment-compact-table th:last-child,
.shipment-compact-table td:last-child {
  border-right: 0;
}

.shipment-compact-table tbody tr:last-child td {
  border-bottom: 0;
}

.shipment-compact-table select,
.shipment-compact-table input {
  width: 100%;
  min-width: 118px;
  height: 30px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
}

.shipment-compact-table input.shipment-required-input,
.shipment-compact-table select.shipment-required-input {
  border-color: #d54941;
  background: #fff7f7;
  box-shadow: 0 0 0 2px rgba(213, 73, 65, 0.1);
}

.shipment-compact-table input.shipment-required-input::placeholder {
  color: #b42318;
}

.shipment-compact-table input.shipment-input-error,
.shipment-compact-table input.shipment-required-input:focus,
.shipment-compact-table select.shipment-input-error,
.shipment-compact-table select.shipment-required-input:focus {
  border-color: #d54941;
  box-shadow: 0 0 0 3px rgba(213, 73, 65, 0.16);
}

.shipment-compact-table td:has(.shipment-required-input) {
  box-shadow: inset 0 -3px 0 #d54941;
}

.shipment-compact-table .shipment-address-cell {
  min-width: 10em;
  max-width: 10em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  text-align: left;
}

.phase3-copy-tracking {
  align-self: end;
}

@media (max-width: 900px) {
  .phase3-review-summary,
  .phase3-review-grid {
    grid-template-columns: 1fr;
  }

  .phase3-todo-body,
  .phase3-message-form > div {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Compact order-entry layout */
#calcTab {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(330px, 1fr) minmax(380px, 1.15fr);
  gap: 10px;
  align-content: start;
  align-items: start;
}

#calcTab > .toolbar,
#calcTab > .eye-table-panel,
#calcTab > .calc-action-panel {
  grid-column: 1 / -1;
}

#calcTab > .toolbar {
  min-height: auto;
  margin: 0;
  padding: 6px 2px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#calcTab .page-title {
  font-size: 20px;
  line-height: 1.2;
}

#calcTab .page-subtitle {
  margin-top: 2px;
  font-size: 12px;
}

#calcTab .toolbar-actions {
  gap: 6px;
}

#calcTab .toolbar-actions .ghost-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

#calcTab > .info-panel,
#calcTab > .phase2-order-extra-panel,
#calcTab > .eye-table-panel,
#calcTab > .calc-action-panel {
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 35, 70, 0.06);
}

#calcTab > .info-panel {
  grid-column: 1 / span 2;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#calcTab > .info-panel > h2 {
  display: none;
}

#calcTab .info-two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 10px;
  height: 100%;
}

#calcTab .info-block,
#calcTab > .phase2-order-extra-panel {
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

#calcTab .info-block h3,
#calcTab > .phase2-order-extra-panel > h2,
#calcTab > .eye-table-panel > h2 {
  min-height: 26px;
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e5ebf4;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

#calcTab .info-block h3::before,
#calcTab .info-block h3::after,
#calcTab > .phase2-order-extra-panel > h2::before,
#calcTab > .phase2-order-extra-panel > h2::after,
#calcTab > .eye-table-panel > h2::before {
  content: none;
  display: none;
}

#calcTab .field span::before,
#calcTab .field span::after,
#calcTab .phase2-inline-check span::before,
#calcTab .phase2-inline-check span::after {
  content: none;
  display: none;
}

#calcTab .basic-info-grid,
#calcTab .phase2-order-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 9px;
}

#calcTab .info-block:first-child .basic-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#calcTab .info-block:first-child #dateInput {
  max-width: 100%;
}

#calcTab .field {
  gap: 3px;
}

#calcTab .field span,
#calcTab .phase2-inline-check span {
  font-size: 11px;
  line-height: 1.25;
}

#calcTab input,
#calcTab select,
#calcTab textarea {
  min-height: 30px;
  height: 30px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
}

#calcTab textarea {
  height: 44px;
  min-height: 44px;
  resize: vertical;
}

#calcTab > .phase2-order-extra-panel {
  grid-column: 3;
}

#calcTab .phase2-order-extra-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 8px;
}

#calcTab .phase2-address-field,
#calcTab .phase2-address-detail-field {
  grid-column: 1 / -1;
}

#calcTab .phase2-note-field {
  grid-column: auto;
}

#calcTab .phase2-inline-check {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

#calcTab .phase2-inline-check input {
  width: 14px;
  height: 14px;
  min-height: 14px;
}

#calcTab .order-address-selector {
  margin-bottom: 7px;
  padding: 5px 8px;
  border-radius: 6px;
}

#calcTab .order-address-selector label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

#calcTab .order-address-selector span {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

#calcTab .order-address-selector select {
  min-height: 26px;
  height: 26px;
}

#calcTab > .eye-table-panel {
  padding: 12px;
}

#calcTab > .eye-table-panel > h2 {
  margin-bottom: 8px;
}

#calcTab .eye-param-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.cornea-k-unit-note {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 1120px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
  color: #536173;
  font-size: 12px;
  line-height: 1.4;
}

.cornea-k-unit-note strong {
  flex: 0 0 auto;
  color: #1f3555;
  font-weight: 700;
}

.cornea-k-unit-note span {
  min-width: 0;
}

.cornea-k-validation-message {
  min-width: 1120px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #f0b7b2;
  border-radius: 4px;
  background: #fff5f4;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

#calcTab .eye-entry-table input.cornea-k-input-error {
  border-color: #d54941;
  box-shadow: 0 0 0 3px rgba(213, 73, 65, 0.16);
}

#calcTab .eye-entry-table {
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

#calcTab .eye-entry-table th,
#calcTab .eye-entry-table td {
  height: 34px;
  padding: 5px 6px;
  border-width: 0 1px 1px 0;
}

#calcTab .eye-entry-table thead th {
  height: 32px;
  background: #f6f8fb;
  color: #263244;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

#calcTab .eye-entry-table thead th:first-child {
  width: 56px;
}

#calcTab .eye-entry-table tbody th {
  width: 56px;
  background: #fff;
  font-size: 13px;
}

#calcTab .eye-entry-table input,
#calcTab .eye-entry-table select {
  width: 100%;
  min-height: 28px;
  height: 28px;
  padding: 3px 7px;
  font-size: 12px;
}

#calcTab .eye-entry-table tbody tr:hover td,
#calcTab .eye-entry-table tbody tr:hover th {
  background: #fff !important;
}

#calcTab .eye-entry-table input:hover,
#calcTab .eye-entry-table select:hover {
  border-color: var(--primary);
}

#calcTab .calc-action-panel {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 10px 12px;
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

#calcTab .calc-action-panel .actions-row {
  justify-content: flex-end;
}

#calcTab #calculateBtn {
  min-width: 128px;
}

@media (max-width: 1180px) {
  #calcTab {
    grid-template-columns: 1fr;
  }

  #calcTab > .info-panel,
  #calcTab > .phase2-order-extra-panel {
    grid-column: 1 / -1;
  }

  #calcTab .info-two-column,
  #calcTab .basic-info-grid,
  #calcTab .phase2-order-extra-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  #calcTab .info-two-column,
  #calcTab .basic-info-grid,
  #calcTab .phase2-order-extra-grid,
  #calcTab .info-block:first-child .basic-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Product-line order framework */
#calcTab {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
}

#calcTab > .product-series-panel {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 35, 70, 0.06);
}

.product-series-panel header {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5ebf4;
}

.product-series-panel header strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.product-series-panel header span {
  color: var(--muted);
  font-size: 12px;
}

.product-series-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.product-series-item:hover {
  border-color: #9ab9e7;
  background: #f7fbff;
}

.product-series-item.active {
  border-color: var(--primary);
  background: #eef5ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.product-series-item span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-series-item strong {
  font-size: 14px;
  line-height: 1.2;
}

.product-series-item em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-series-item b {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--primary);
  font-size: 11px;
  line-height: 1.3;
}

.product-series-item.developing b {
  background: #f1f4f8;
  color: #64748b;
}

#calcTab > .product-order-content,
#calcTab > .product-line-placeholder {
  grid-column: 2;
  min-width: 0;
}

#primeOrderForm {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(330px, 1fr) minmax(380px, 1.15fr);
  gap: 10px;
  align-content: start;
  align-items: start;
}

#primeOrderForm > .toolbar,
#primeOrderForm > .eye-table-panel,
#primeOrderForm > .calc-action-panel {
  grid-column: 1 / -1;
}

#primeOrderForm > .toolbar {
  min-height: auto;
  margin: 0;
  padding: 6px 2px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#primeOrderForm > .info-panel,
#primeOrderForm > .phase2-order-extra-panel,
#primeOrderForm > .eye-table-panel,
#primeOrderForm > .calc-action-panel {
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 35, 70, 0.06);
}

#primeOrderForm > .info-panel {
  grid-column: 1 / span 2;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#primeOrderForm > .info-panel > h2 {
  display: none;
}

#primeOrderForm > .phase2-order-extra-panel {
  grid-column: 3;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

#primeOrderForm > .phase2-order-extra-panel > h2,
#primeOrderForm > .eye-table-panel > h2 {
  min-height: 26px;
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e5ebf4;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

#primeOrderForm > .phase2-order-extra-panel > h2::before,
#primeOrderForm > .phase2-order-extra-panel > h2::after,
#primeOrderForm > .eye-table-panel > h2::before {
  content: none;
  display: none;
}

#primeOrderForm > .eye-table-panel {
  padding: 12px;
}

#primeOrderForm > .eye-table-panel > h2 {
  margin-bottom: 8px;
}

.product-line-placeholder {
  min-height: calc(100vh - var(--header-height) - 40px);
}

.product-placeholder-card {
  display: grid;
  gap: 8px;
  max-width: 560px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 35, 70, 0.06);
}

.product-placeholder-card strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.product-placeholder-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1380px) {
  #primeOrderForm {
    grid-template-columns: minmax(0, 1fr);
  }

  #primeOrderForm > .info-panel,
  #primeOrderForm > .phase2-order-extra-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  #calcTab {
    grid-template-columns: 1fr;
  }

  #calcTab > .product-series-panel,
  #calcTab > .product-order-content,
  #calcTab > .product-line-placeholder {
    grid-column: 1 / -1;
  }

  #calcTab > .product-series-panel {
    position: static;
  }
}

/* Production scheduling */
.production-workspace {
  min-height: calc(100vh - 150px);
}

#productionTab {
  gap: 0;
}

#productionTab > .records-panel {
  height: calc(100vh - var(--header-height) - 16px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#productionTab .production-workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #fff;
}

#productionTab .records-sidebar {
  min-height: 0;
  border-right: 1px solid var(--border);
  background: #fff;
}

#productionTab .record-search-input {
  width: calc(100% - 32px);
  height: 34px;
  margin: 16px;
}

#productionTab .records-list {
  min-height: 0;
  overflow-y: auto;
}

#productionTab .record-detail-panel {
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: var(--surface);
  overflow-y: auto;
}

#productionTab .record-detail-shell {
  min-height: 100%;
  padding: 24px;
}

.production-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.production-mini-badge.subtle {
  border-color: #d8dee8;
  background: #f8fafc;
  color: #475569;
}

.production-batch-action-bar {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.order-month-group {
  margin: 10px 0;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.order-month-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
  background: #f8fbff;
  list-style: none;
}

.order-month-group summary::-webkit-details-marker {
  display: none;
}

.order-month-group summary::before {
  content: "›";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 2px;
  color: #64748b;
  font-size: 18px;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.order-month-group[open] summary::before {
  transform: rotate(90deg);
}

.order-month-group summary span {
  flex: 1;
}

.order-month-group summary strong {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 12px;
}

.order-month-list {
  padding: 8px;
}

.order-month-list .record-list-row {
  margin: 0 0 8px;
}

.order-month-list .record-list-row:last-child {
  margin-bottom: 0;
}

.compact-order-detail {
  gap: 12px;
}

.compact-order-top {
  padding-bottom: 10px;
}

.compact-info-card,
.compact-param-card {
  margin-top: 12px;
}

.compact-info-table-wrap,
.compact-param-scroll {
  overflow: auto;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.compact-info-table,
.compact-param-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.compact-info-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.compact-info-table th,
.compact-info-table td {
  height: 34px;
  padding: 7px 10px;
  border-right: 1px solid #d8e2ef;
  border-bottom: 1px solid #d8e2ef;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.compact-info-table th {
  min-width: 86px;
  max-width: 10em;
  background: #f6f8fb;
  color: #0f172a;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

.compact-info-table td {
  min-width: 86px;
  max-width: 10em;
  color: #0f172a;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-info-table td:nth-child(10) {
  min-width: 10em;
  max-width: 10em;
  text-align: left;
  word-break: break-all;
}

.compact-info-table td:not(:nth-child(10)):not(:nth-child(14)) {
  white-space: nowrap;
}

.compact-info-table td:nth-child(14) {
  min-width: 10em;
  max-width: 10em;
  text-align: left;
  word-break: break-all;
}

.compact-info-table td:nth-child(12) {
  min-width: 10em;
  max-width: 10em;
  text-align: left;
  word-break: break-all;
}

.compact-info-table td.compact-info-address-cell {
  width: 10em;
  min-width: 10em;
  max-width: 10em;
  text-align: left;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-info-table th:last-child,
.compact-info-table td:last-child {
  border-right: 0;
}

.compact-info-table tbody tr:last-child td {
  border-bottom: 0;
}

.compact-param-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.compact-param-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.compact-param-table th,
.compact-param-table td {
  min-width: 86px;
  max-width: 11em;
  height: 34px;
  padding: 7px 9px;
  border-right: 1px solid #d8e2ef;
  border-bottom: 1px solid #d8e2ef;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-param-table thead th {
  background: #f6f8fb;
  color: #0f172a;
  font-weight: 800;
}

.compact-param-table .eye-col,
.compact-param-table tbody th {
  width: 86px;
  min-width: 86px;
  background: #f8fafc;
  color: #1e293b;
  font-weight: 800;
  position: sticky;
  left: 0;
  z-index: 1;
}

.compact-param-table thead .eye-col {
  z-index: 2;
}

.compact-param-table tr:last-child th,
.compact-param-table tr:last-child td {
  border-bottom: 0;
}

.compact-param-table th:last-child,
.compact-param-table td:last-child {
  border-right: 0;
}

.compact-param-table .inactive-eye-row th,
.compact-param-table .inactive-eye-row td {
  color: #94a3b8;
  background: #fafafa;
}

.compact-detail-section {
  margin-top: 12px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.compact-detail-section summary {
  min-height: 38px;
  padding: 10px 12px;
  cursor: pointer;
  background: #f8fbff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
}

.compact-detail-section > *:not(summary) {
  margin: 12px;
}

.production-stage-notice {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #dbe5f2;
  border-left: 4px solid #2f6fdd;
  border-radius: 8px;
  background: #f8fbff;
}

.production-stage-notice span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.production-stage-notice strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  margin-top: 2px;
}

.production-stage-notice p {
  margin: 4px 0 0;
  color: #475569;
  line-height: 1.5;
}

.production-stage-notice.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.production-stage-notice.indigo {
  border-left-color: #4f46e5;
  background: #f5f7ff;
}

.production-serials {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 210px;
  padding: 10px 12px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #ffffff;
}

.production-serials span {
  color: #334155;
  font-size: 13px;
  font-weight: 500;
}

.production-serials strong {
  display: inline;
  font-size: 13px;
  color: #0f172a;
}

.production-summary-card {
  margin-top: 14px;
}

.production-note-card {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.production-note-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.production-note-card p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.production-lens-card {
  margin-top: 14px;
}

.production-lens-table-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.production-lens-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #ffffff;
}

.production-lens-table th,
.production-lens-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f7;
  color: #334155;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.production-lens-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.production-lens-table tr:last-child td {
  border-bottom: 0;
}

.compact-btn {
  min-height: 28px;
  height: 28px;
  padding: 0 8px;
  margin-right: 4px;
  font-size: 12px;
}

.production-modal,
.lens-task-modal {
  width: min(980px, calc(100vw - 32px));
}

.lens-task-modal .record-result-grid {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .production-stage-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .production-serials {
    min-width: 0;
  }
}

/* Workspace width normalization: keep list areas compact and give details more room. */
#recordsTab .records-workspace {
  grid-template-columns: 300px minmax(0, 1fr);
}

#recordsTab .records-workspace.factory-three-column {
  grid-template-columns: 160px 300px minmax(0, 1fr);
}

.after-sales-workspace {
  grid-template-columns: 160px 300px minmax(0, 1fr);
}

#productionTab .production-workspace {
  grid-template-columns: 300px minmax(0, 1fr);
}

#recordsTab .record-search-input,
#afterSalesTab .record-search-input,
#productionTab .record-search-input {
  width: calc(100% - 24px);
  margin-left: 12px;
  margin-right: 12px;
}

.records-stage-title,
#recordsTab .record-list-title,
#afterSalesTab .record-list-title,
#productionTab .record-list-title {
  padding-left: 12px;
  padding-right: 12px;
}

#factoryStageTabs,
#afterSalesStageTabs {
  padding-left: 10px;
  padding-right: 10px;
}

#recordsTab .record-item,
#afterSalesTab .record-item,
#productionTab .record-item {
  padding-left: 12px;
  padding-right: 12px;
}

#recordsTab .order-month-list {
  padding-left: 0;
  padding-right: 0;
}

#recordsTab .order-month-list .record-list-row {
  margin-left: 0;
  margin-right: 0;
}

#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) .record-item,
#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) .phase3-order-item {
  padding-left: 8px;
  padding-right: 8px;
}

#productionTab .production-month-group {
  margin: 6px 0;
  border-radius: 6px;
}

#productionTab .production-month-group summary {
  min-height: 32px;
  padding-left: 10px;
  padding-right: 10px;
}

#productionTab .production-month-list {
  padding: 5px 6px;
}

#productionTab .production-batch-item {
  min-height: 44px;
  padding-top: 5px;
  padding-bottom: 5px;
  gap: 2px;
}

#productionTab .production-batch-line,
#productionTab .production-batch-meta {
  gap: 6px;
  line-height: 1.2;
}

#productionTab .production-batch-line strong {
  font-size: 13px;
}

#productionTab .production-batch-meta {
  margin-top: 2px;
}

.production-udi-table-wrap,
.lens-info-table-wrap {
  overflow: auto;
  margin: 8px 0 10px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.production-udi-table,
.lens-info-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: #ffffff;
}

.production-udi-alert {
  margin: 8px 0 6px;
  padding: 7px 9px;
  border: 1px solid #f3b4ae;
  border-radius: 6px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  background: #fff7f7;
}

.production-udi-table th,
.production-udi-table td,
.lens-info-table th,
.lens-info-table td {
  height: 32px;
  padding: 6px 8px;
  border-right: 1px solid #d8e2ef;
  border-bottom: 1px solid #d8e2ef;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.production-udi-table th,
.lens-info-table th {
  background: #f6f8fb;
  font-weight: 800;
}

.production-udi-table td:last-child,
.production-udi-table th:last-child,
.lens-info-table td:last-child,
.lens-info-table th:last-child {
  border-right: 0;
}

.production-udi-table tr:last-child td,
.lens-info-table tr:last-child td {
  border-bottom: 0;
}

.lens-info-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.production-udi-table input {
  min-height: 28px;
  height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.production-udi-table input.production-required-input {
  border-color: #d54941;
  background: #fff7f7;
  box-shadow: 0 0 0 2px rgba(213, 73, 65, 0.1);
}

.production-udi-table input.production-required-input::placeholder {
  color: #b42318;
}

.production-udi-table input.production-input-error,
.production-udi-table input.production-required-input:focus {
  border-color: #d54941;
  box-shadow: 0 0 0 3px rgba(213, 73, 65, 0.16);
}

.production-udi-table tr:has(input.production-required-input) td:first-child {
  box-shadow: inset 3px 0 0 #d54941;
}

.production-quality-failed {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  color: #a33a33;
  font-size: 12px;
  font-weight: 700;
  background: #fff1f0;
  border: 1px solid #f2c2bf;
}

.lens-info-card {
  margin-top: 10px;
}

.side-brand {
  gap: 8px;
  padding-left: 6px;
  padding-right: 6px;
}

.dock-item {
  gap: 10px;
  padding-left: 10px;
  padding-right: 10px;
}

.main-view.workspace-locked {
  overflow: hidden;
  padding-bottom: 16px;
}

.main-view.workspace-locked #recordsTab,
.main-view.workspace-locked #orderSearchTab,
.main-view.workspace-locked #productionTab,
.main-view.workspace-locked #afterSalesTab {
  height: 100%;
  min-height: 0;
}

.main-view.workspace-locked #recordsTab > .records-panel,
.main-view.workspace-locked #orderSearchTab > .records-panel,
.main-view.workspace-locked #productionTab > .records-panel,
.main-view.workspace-locked #afterSalesTab > .after-sales-panel {
  height: 100%;
  min-height: 0;
}

.customer-progress-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
  text-align: left;
}

.customer-progress-card:hover,
.customer-progress-card.active {
  border-color: #8bb8f8;
  background: #eef6ff;
}

.customer-progress-card div {
  min-width: 0;
}

.customer-order-section {
  margin: 8px 0 10px;
}

.customer-order-section-head {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.customer-order-section-head span {
  min-width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d4ed8;
  font-size: 12px;
}

.customer-order-section-empty {
  margin: 4px 8px 8px;
  padding: 10px 12px;
  border: 1px dashed #cbd8e8;
  border-radius: 8px;
  color: #64748b;
  font-size: 12px;
  background: #f8fafc;
}

.customer-progress-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.customer-progress-card strong,
.customer-progress-summary-card strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-progress-detail {
  gap: 12px;
}

.customer-progress-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.customer-progress-summary-card {
  padding: 14px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.customer-progress-summary-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.customer-progress-summary-card strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.1;
}

.customer-progress-summary-card p {
  margin: 8px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.customer-recent-orders-list {
  display: grid;
}

.customer-recent-order-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) 150px;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid #e5ebf4;
  background: #fff;
  color: #0f172a;
  text-align: left;
}

.customer-recent-order-row:hover {
  background: #f8fbff;
}

.customer-recent-order-row:last-child {
  border-bottom: 0;
}

.customer-recent-order-row strong,
.customer-recent-order-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Order workspace refresh: compact navigation, stage filters, and two-line order list. */
.dock-nav {
  background: #ffffff;
  gap: 6px;
}

.dock-item {
  min-height: 44px;
  border-radius: 4px;
  color: #0f2742;
}

.dock-item:hover {
  background: #eef5ff;
  color: #075cc7;
}

.dock-item.active {
  background: #064989;
  color: #ffffff;
}

.dock-icon {
  width: 20px;
  height: 20px;
}

.dock-icon::before {
  width: 17px;
  height: 17px;
}

.dock-item[data-tab="orderSearch"] .dock-icon::before {
  -webkit-mask-image: var(--icon-scan);
  mask-image: var(--icon-scan);
}

.dock-item[data-tab="dashboard"] .dock-icon::before {
  -webkit-mask-image: var(--icon-info);
  mask-image: var(--icon-info);
}

.dock-item[data-tab="production"] .dock-icon::before,
.dock-item[data-tab="afterSales"] .dock-icon::before {
  -webkit-mask-image: var(--icon-record);
  mask-image: var(--icon-record);
}

#dashboardTab {
  min-height: 100%;
}

.dashboard-panel {
  min-height: 100%;
  padding: 18px;
  background: #f7f9fc;
}

.dashboard-content {
  max-width: 1280px;
  margin: 0 auto;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 14px;
}

.dashboard-head strong {
  display: block;
  color: #0f172a;
  font-size: 20px;
  line-height: 26px;
}

.dashboard-head span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-summary-card {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid #d9e2ef;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.dashboard-summary-card:hover {
  border-color: #9fc4f8;
  background: #f4f8ff;
}

.dashboard-summary-card span {
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary-card strong {
  color: #064989;
  font-size: 30px;
  line-height: 34px;
}

.dashboard-summary-new-count {
  margin-left: 6px;
  color: var(--danger);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  vertical-align: 3px;
}

.billing-page { padding: 22px 24px; }
.billing-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.billing-head h2 { margin: 0; color: #0f172a; font-size: 21px; }
.billing-head p, .billing-rule-note { margin: 5px 0 0; color: #64748b; font-size: 13px; }
.billing-actions { display: flex; align-items: center; gap: 8px; }
.billing-actions input { height: 34px; padding: 0 8px; border: 1px solid #cfdbea; background: #fff; }
.billing-rule-note { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #d5e3f5; background: #f7fbff; }
.billing-table-wrap { overflow: auto; border: 1px solid #d8e2ef; background: #fff; }
.billing-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.billing-table th, .billing-table td { padding: 10px; border-right: 1px solid #e0e7f0; border-bottom: 1px solid #e0e7f0; font-size: 13px; text-align: center; }
.billing-table th { background: #f6f8fb; color: #334155; font-weight: 800; }
.billing-table td:first-child { text-align: left; }
.billing-table td small { display: block; margin-top: 3px; color: #64748b; }
.billing-table input, .billing-table select { width: 92px; height: 30px; padding: 4px 6px; border: 1px solid #cfdbea; background: #fff; }
.billing-table select { width: 82px; }
.billing-series-line, .billing-price-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; white-space: nowrap; }
.billing-series-line span, .billing-price-line span { color: #64748b; font-size: 12px; }
.billing-price-line input { width: 72px; }
.billing-table .compact-btn + .compact-btn { margin-left: 6px; }
.billing-empty { padding: 28px !important; color: #64748b; text-align: center !important; }

.default-lens-colour {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #d8e0ea;
  border-radius: 3px;
  cursor: not-allowed;
  user-select: none;
}

.pricing-policy-panel { margin: 0 0 14px; border: 1px solid #d5e3f5; background: #fff; }
.pricing-policy-panel > summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; cursor: pointer; color: #163e7a; font-weight: 800; }
.pricing-policy-panel > summary small { color: #64748b; font-size: 12px; font-weight: 500; }
.pricing-policy-body { padding: 0 14px 14px; }
.pricing-policy-body .billing-rule-note { margin-bottom: 12px; }
.pricing-form-grid { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pricing-form-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 12px; border: 1px solid #d8e2ef; background: #f8fbff; }
.pricing-form-card h3 { grid-column: 1 / -1; margin: 0; color: #163e7a; font-size: 14px; }
.pricing-form-card label { display: grid; gap: 4px; color: #475569; font-size: 12px; font-weight: 700; }
.pricing-form-card input, .pricing-form-card select { width: 100%; height: 32px; box-sizing: border-box; border: 1px solid #cfdbea; background: #fff; padding: 4px 6px; }
.pricing-form-card small { color: #64748b; font-size: 11px; font-weight: 500; }
.pricing-form-card button { justify-self: start; }
.pricing-wide { grid-column: 1 / -1; }
.pricing-history-grid { display: grid; gap: 14px; }
.pricing-history-grid section > h3 { margin: 0 0 8px; color: #334155; font-size: 14px; }

@media (max-width: 1180px) {
  .pricing-form-grid { grid-template-columns: 1fr; }
}

.dashboard-summary-card small {
  color: #64748b;
  font-size: 12px;
  line-height: 17px;
}

.dashboard-todo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-todo-card {
  min-width: 0;
  border: 1px solid #d9e2ef;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.dashboard-todo-card header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid #d9e2ef;
  background: #f8fafc;
}

.dashboard-todo-card header strong {
  color: #0f172a;
  font-size: 14px;
}

.dashboard-todo-card header span {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-todo-list {
  display: grid;
  gap: 7px;
  padding: 8px;
}

.dashboard-todo-row {
  min-width: 0;
  min-height: 64px;
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid #edf2f7;
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.dashboard-todo-row:hover {
  border-color: #b8d4fb;
  border-left-color: #2563eb;
  background: #f0f7ff;
}

.dashboard-todo-row div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.dashboard-todo-row strong {
  min-width: 0;
  overflow: hidden;
  color: #075cc7;
  font-size: 13px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-todo-row span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef3fb;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-todo-row p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-empty,
.dashboard-empty-line {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  padding: 20px;
  border: 1px dashed #cbd8e8;
  border-radius: 6px;
  background: #ffffff;
  color: #64748b;
  text-align: center;
}

.dashboard-empty strong {
  color: #0f172a;
  font-size: 16px;
}

.dashboard-empty-line {
  min-height: 92px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .dashboard-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-todo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-panel {
    padding: 12px;
  }

  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#recordsTab .records-workspace.factory-three-column {
  grid-template-columns: 132px 252px minmax(0, 1fr);
  min-width: 980px;
  background: #f7f9fc;
}

#recordsTab > .records-panel {
  overflow-x: auto;
  overflow-y: hidden;
}

.main-view.workspace-locked #recordsTab {
  width: calc(100% + 24px);
  margin-left: -24px;
}

.main-view.workspace-locked #afterSalesTab,
.main-view.workspace-locked #productionTab {
  width: calc(100% + 24px);
  margin-left: -24px;
}

@media (max-width: 900px) {
  .main-view.workspace-locked #recordsTab {
    width: calc(100% + 12px);
    margin-left: -12px;
  }

  .main-view.workspace-locked #afterSalesTab,
  .main-view.workspace-locked #productionTab {
    width: calc(100% + 12px);
    margin-left: -12px;
  }
}

#recordsTab .records-stage-panel,
#recordsTab .records-sidebar {
  background: #ffffff;
}

#recordsTab .records-stage-title,
#recordsTab .records-sidebar-toolbar {
  min-height: 38px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #d9e2ef;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

#factoryStageTabs {
  gap: 8px;
  padding: 10px 6px;
}

#factoryStageTabs button.phase1-stage-tab {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

#factoryStageTabs button.phase1-stage-tab:hover {
  background: #eef5ff;
  color: #075cc7;
}

#factoryStageTabs button.phase1-stage-tab.active {
  background: #064989;
  color: #ffffff;
  box-shadow: none;
}

#factoryStageTabs button.phase1-stage-tab span {
  min-width: 0;
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#factoryStageTabs button.phase1-stage-tab strong {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #edf2f7;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
}

#factoryStageTabs button.phase1-stage-tab.active strong {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

#afterSalesTab > .after-sales-panel,
#productionTab > .records-panel {
  overflow-x: auto;
  overflow-y: hidden;
}

#afterSalesTab .after-sales-workspace {
  grid-template-columns: 132px minmax(0, 1fr);
  min-width: 980px;
  background: #f7f9fc;
}

#productionTab .production-workspace {
  grid-template-columns: 132px minmax(0, 1fr);
  min-width: 848px;
  background: #f7f9fc;
}

#afterSalesTab .records-stage-panel,
#afterSalesTab .records-sidebar,
#productionTab .records-stage-panel,
#productionTab .records-sidebar {
  background: #ffffff;
}

#afterSalesTab .records-stage-title,
#afterSalesTab .records-list-head,
#productionTab .records-stage-title,
#productionTab .records-list-head {
  min-height: 38px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #d9e2ef;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

#afterSalesStageTabs {
  gap: 8px;
  padding: 10px 6px;
  overflow-x: hidden;
}

#afterSalesStageTabs button.phase1-stage-tab,
#productionMonthTabs button.phase1-stage-tab {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

#productionMonthTabs {
  display: grid;
  gap: 8px;
  padding: 10px 6px;
  overflow-x: hidden;
}

#afterSalesStageTabs button.phase1-stage-tab:hover,
#productionMonthTabs button.phase1-stage-tab:hover {
  background: #eef5ff;
  color: #075cc7;
}

#afterSalesStageTabs button.phase1-stage-tab.active,
#productionMonthTabs button.phase1-stage-tab.active {
  background: #064989;
  color: #ffffff;
  box-shadow: none;
}

#afterSalesStageTabs button.phase1-stage-tab span,
#productionMonthTabs button.phase1-stage-tab span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#afterSalesStageTabs button.phase1-stage-tab strong,
#productionMonthTabs button.phase1-stage-tab strong {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #edf2f7;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
}

#afterSalesStageTabs button.phase1-stage-tab.active strong,
#productionMonthTabs button.phase1-stage-tab.active strong {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.production-month-empty {
  padding: 10px 8px;
  color: #64748b;
  font-size: 12px;
}

#afterSalesTab .records-list,
#productionTab .records-list {
  background: #fbfdff;
}

#afterSalesTab .record-search-input,
#productionTab .record-search-input {
  width: calc(100% - 16px);
  height: 32px;
  margin: 8px;
  border-radius: 4px;
  font-size: 12px;
}

#afterSalesTab .after-sales-list-item,
#productionTab .production-batch-item {
  min-height: 64px;
  margin: 6px;
  padding: 7px 8px 7px 9px;
  border: 1px solid #edf2f7;
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: #ffffff;
}

#afterSalesTab .after-sales-list-item.active,
#productionTab .production-batch-item.active {
  border-color: #b8d4fb;
  border-left-color: #2563eb;
  background: #f0f7ff;
}

#afterSalesTab .commercial-order-line,
#productionTab .production-batch-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

#afterSalesTab .commercial-order-meta,
#productionTab .production-batch-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  color: #334155;
  font-size: 12px;
  line-height: 18px;
}

#afterSalesTab .commercial-order-meta span,
#productionTab .production-batch-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#afterSalesTab .record-detail-panel {
  display: none;
  min-width: 0;
  overflow: auto;
}

#afterSalesTab .after-sales-workspace.after-sales-detail-open .records-sidebar {
  display: none;
}

#afterSalesTab .after-sales-workspace.after-sales-detail-open .record-detail-panel {
  display: block;
  animation: records-detail-slide-in 0.16s ease-out both;
}

#afterSalesTab .after-sales-table-list {
  display: grid;
  gap: 3px;
  padding: 8px 6px;
}

#afterSalesTab .after-sales-table-head,
#afterSalesTab .after-sales-table-row {
  display: grid !important;
  grid-template-columns: 144px 70px 118px 80px 140px 118px minmax(122px, 1fr) !important;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

#afterSalesTab .after-sales-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e7edf5;
  border-radius: 5px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

#afterSalesTab .after-sales-table-row {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #edf2f7;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  flex-direction: unset;
  justify-content: unset;
}

#afterSalesTab .after-sales-table-row:hover,
#afterSalesTab .after-sales-table-row.active {
  border-color: #b8d4fb;
  border-left-color: #2563eb;
  background: #f0f7ff;
}

#afterSalesTab .after-sales-table-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 18px;
}

#afterSalesTab .after-sales-table-row .after-sale-no {
  color: #075cc7;
  font-weight: 900;
}

.after-sales-action-card .phase1-action-feedback {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 18px;
}

.after-sales-review-handoff {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #b8d4fb;
  border-left: 3px solid #2563eb;
  background: #f5f9ff;
  color: #1e3a5f;
  font-size: 13px;
  line-height: 20px;
}

.after-sales-review-handoff strong {
  color: #0f4f9d;
}

.after-sale-free-order-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid #76b4ea;
  background: #edf7ff;
  color: #075cc7;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

#recordsTab .order-list-cell.status.after-sale-free-status {
  display: grid;
  gap: 1px;
  justify-items: start;
  overflow: visible;
  white-space: normal;
  line-height: 16px;
}

#recordsTab .order-list-cell.status.after-sale-free-status .after-sale-free-order-tag {
  max-width: 100%;
  margin-left: 0;
  padding: 0 3px;
  font-size: 10px;
  line-height: 14px;
}

#productionTab .record-detail-panel {
  display: none;
  min-width: 0;
  overflow: auto;
}

#productionTab .production-workspace.production-detail-open .records-sidebar {
  display: none;
}

#productionTab .production-workspace.production-detail-open .record-detail-panel {
  display: block;
  animation: records-detail-slide-in 0.16s ease-out both;
}

#productionTab .production-archive-list {
  --production-archive-columns: 136px 66px 52px 52px 96px 132px 92px;
  display: grid;
  gap: 3px;
  padding: 8px 6px;
}

#productionTab .production-archive-header,
#productionTab .production-archive-row {
  display: grid !important;
  grid-template-columns: var(--production-archive-columns) !important;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

#productionTab .production-archive-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e7edf5;
  border-radius: 5px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

#productionTab .production-archive-row {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  appearance: none;
  border: 1px solid #edf2f7;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#productionTab .production-archive-row:hover {
  border-color: #b8d4fb;
  border-left-color: #2563eb;
  background: #f0f7ff;
}

#productionTab .production-archive-row.active {
  border-color: #b8d4fb;
  border-left-color: #2563eb;
  background: #f0f7ff;
}

#productionTab .production-archive-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 18px;
}

#productionTab .production-archive-row .archive-batch-no {
  color: #075cc7;
  font-weight: 900;
}

#productionTab .archive-exported {
  color: #047857;
  font-weight: 800;
}

#productionTab .archive-unexported {
  color: #b42318;
  font-weight: 800;
}

#recordsTab .records-list {
  background: #fbfdff;
}

#recordsTab .order-month-group {
  margin: 8px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

#recordsTab .order-month-group summary {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f5f9ff;
  color: #0f172a;
  font-size: 13px;
}

#recordsTab .order-month-group summary strong {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  background: #e8f1ff;
  color: #1d4ed8;
}

#recordsTab .order-month-list {
  display: grid;
  gap: 6px;
  padding: 6px 0 0;
}

#recordsTab .order-month-list .record-list-row {
  min-width: 0;
  margin: 0;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

#recordsTab .order-month-list .record-list-row.active {
  border-color: #b8d4fb;
  background: #f0f7ff;
}

#recordsTab .order-month-list .record-list-row.recently-viewed {
  border-color: #9fc4f8;
  background: #eaf4ff;
}

#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) {
  display: block;
}

#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) .record-item,
#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) .phase3-order-item {
  min-height: 64px;
  padding: 7px 8px 7px 9px;
  border-left-width: 3px;
}

#recordsTab .order-month-list .record-list-row.active .phase3-order-item {
  border-left-color: #2563eb;
  background: transparent;
}

#recordsTab .order-month-list .record-list-row.recently-viewed .phase3-order-item {
  border-left-color: #0f5bd7;
  background: transparent;
}

#recordsTab .phase3-order-line.primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

#recordsTab .phase3-order-line.primary strong {
  min-width: 0;
  color: #075cc7;
  font-size: 13px;
  line-height: 18px;
}

#recordsTab .phase3-order-line.primary .phase1-flow-marker {
  justify-self: end;
}

#recordsTab .phase3-order-line.secondary {
  display: grid;
  grid-template-columns: minmax(42px, 0.7fr) minmax(96px, 1.3fr) auto;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: #334155;
  font-size: 12px;
  line-height: 18px;
}

#recordsTab .phase3-order-line.secondary span:first-child {
  max-width: none;
}

#recordsTab .phase3-order-line.secondary .production-mini-badge {
  justify-self: end;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: #eef3fb;
  color: #334155;
  font-size: 11px;
}

#recordsTab .phase3-order-line.secondary .phase3-tag {
  justify-self: end;
}

#recordsTab .phase1-order-item .phase1-flow-marker,
#recordsTab .phase3-order-line.primary .phase1-flow-marker {
  min-height: 18px;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e9f8f1;
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
}

#recordsTab .phase1-order-item .phase1-flow-marker i,
#recordsTab .phase3-order-line.primary .phase1-flow-marker i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

#recordsTab .phase1-order-item .phase1-flow-marker i::before,
#recordsTab .phase3-order-line.primary .phase1-flow-marker i::before {
  content: none;
}

#recordsTab .phase1-order-item .phase1-flow-marker.warning {
  background: #fff7ed;
  color: #c2410c;
}

#recordsTab .phase1-order-item .phase1-flow-marker.info,
#recordsTab .phase1-order-item .phase1-flow-marker.primary,
#recordsTab .phase1-order-item .phase1-flow-marker.indigo,
#recordsTab .phase1-order-item .phase1-flow-marker.cyan {
  background: #eff6ff;
  color: #1d4ed8;
}

#recordsTab .phase1-order-item .phase1-flow-marker.danger,
#recordsTab .phase1-order-item .phase1-flow-marker.muted {
  background: #f1f5f9;
  color: #64748b;
}

@media (max-width: 1100px) {
  .customer-progress-card,
  .customer-progress-summary-grid {
    grid-template-columns: 1fr;
  }

  .customer-recent-order-row {
    grid-template-columns: 1fr;
    gap: 2px;
    min-height: 52px;
    padding: 6px 10px;
  }
}

/* Orders workbench: list-first mode with detail view opened on demand. */
#recordsTab .records-workspace,
#recordsTab .records-workspace.factory-three-column {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

#recordsTab .records-workspace.factory-three-column {
  grid-template-columns: 132px minmax(0, 1fr);
}

#recordsTab .records-workspace.customer-three-column {
  grid-template-columns: 132px minmax(0, 1fr);
  min-width: 1040px;
  background: #f7f9fc;
}

#recordsTab .record-detail-panel {
  display: none;
  min-width: 0;
  overflow: auto;
}

#recordsTab .records-workspace.records-detail-open .records-sidebar {
  display: none;
}

#recordsTab .records-workspace.records-detail-open .record-detail-panel {
  display: block;
  animation: records-detail-slide-in 0.16s ease-out both;
}

#recordsTab .records-workspace.records-detail-open .record-detail-panel,
#afterSalesTab .after-sales-workspace.after-sales-detail-open .record-detail-panel,
#productionTab .production-workspace.production-detail-open .record-detail-panel {
  animation-fill-mode: none;
}

#recordsTab .records-sidebar {
  min-width: 0;
  border-right: 0;
}

#recordsTab .records-sidebar-toolbar {
  min-height: 40px;
  height: auto;
  gap: 8px;
  padding: 6px 10px;
}

#recordsTab .records-sidebar-toolbar .record-search-input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 28px;
  margin: 0;
  font-size: 12px;
}

#recordsTab .records-list {
  overflow: auto;
}

#recordsTab .records-workspace.customer-three-column .records-stage-panel,
#recordsTab .records-workspace.customer-three-column .records-sidebar {
  background: #ffffff;
}

#recordsTab .order-month-list {
  gap: 3px;
}

#recordsTab .order-list-header,
#recordsTab .phase3-order-item {
  display: grid;
  grid-template-columns: 108px 64px 58px 148px 78px 96px 118px 88px 38px 44px 62px;
  align-items: center;
  gap: 8px;
}

#recordsTab .records-workspace.customer-three-column .order-list-header,
#recordsTab .records-workspace.customer-three-column .phase3-order-item {
  grid-template-columns: 118px 70px 90px 110px 128px 86px 42px 50px 68px;
}

#recordsTab .records-workspace.customer-three-column.company-main-orders {
  min-width: 1130px;
}

#recordsTab .records-workspace.customer-three-column.company-main-orders .order-list-header,
#recordsTab .records-workspace.customer-three-column.company-main-orders .phase3-order-item {
  grid-template-columns: 118px 70px 92px 90px 110px 128px 86px 42px 50px 68px;
}

#recordsTab .order-list-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e7edf5;
  border-radius: 5px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

#recordsTab .order-list-header.has-check {
  grid-template-columns: 108px 64px 58px 148px 78px 96px 118px 88px 38px 44px 62px 34px;
}

#recordsTab .order-list-header.has-batch {
  grid-template-columns: 132px 108px 64px 58px 148px 78px 96px 118px 88px 38px 44px 62px 126px;
}

#recordsTab .order-list-header.has-check span:last-child {
  justify-self: center;
}

#recordsTab .order-month-list .record-list-row,
#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) {
  display: block;
  margin: 0;
  border-radius: 4px;
}

#recordsTab .order-month-list .record-list-row:has(.phase2-batch-check) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px !important;
  align-items: center;
  padding-left: 0;
}

#recordsTab .order-month-list .record-list-row .phase2-batch-check,
#recordsTab .order-month-list .record-list-row:has(.phase2-batch-check) .phase2-batch-check {
  position: static;
  justify-self: center;
  width: 14px;
  height: 14px;
}

#recordsTab .order-month-list .record-list-row .record-item,
#recordsTab .order-month-list .record-list-row .phase3-order-item,
#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) .record-item,
#recordsTab .order-month-list .record-list-row:not(:has(.phase2-batch-check)) .phase3-order-item {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-left-width: 3px;
  text-align: left;
}

#recordsTab .order-month-list .record-list-row:has(.phase2-batch-check) .phase3-order-item {
  min-height: 34px;
}

#recordsTab .order-list-cell,
#recordsTab .phase3-order-item .after-sales-mini-badge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 18px;
}

#recordsTab .order-list-cell.order-no,
#recordsTab .order-list-cell.patient {
  color: #075cc7;
  font-weight: 800;
}

#recordsTab .order-list-cell.order-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#recordsTab .customer-order-update-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: #e5534b;
  box-shadow: 0 0 0 3px rgba(229, 83, 75, 0.12);
}

#recordsTab .order-month-list .record-list-row.has-customer-update .phase3-order-item {
  border-left-color: #8ab8e6;
  background: #f4f9ff;
}

#recordsTab .order-month-list .record-list-row.has-customer-update.active .phase3-order-item {
  border-left-color: var(--primary);
  background: #eaf4ff;
}

/* Order lists are paginated directly; month accordions are no longer used. */
#recordsTab .order-list-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 6px;
}

#recordsTab .order-list-body .record-list-row,
#recordsTab .order-list-body .record-list-row:not(:has(.phase2-batch-check)) {
  display: block;
  min-width: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 4px;
}

#recordsTab .order-list-body .record-list-row:has(.phase2-batch-check) {
  display: block !important;
  position: relative;
}

#recordsTab .order-list-body .record-list-row .phase2-batch-check {
  position: absolute !important;
  top: 50%;
  right: 12px;
  left: auto;
  z-index: 4;
  width: 14px;
  height: 14px;
  margin: 0;
  transform: translateY(-50%);
}

#recordsTab .order-list-body .record-list-row .record-item,
#recordsTab .order-list-body .record-list-row .phase3-order-item {
  width: 100%;
  min-height: 34px;
  padding: 7px 40px 7px 9px;
  border-left: 3px solid transparent;
}

#recordsTab .order-list-header.has-check {
  grid-template-columns: 108px 64px 58px 148px 78px 96px 118px 88px 38px 44px 62px minmax(0, 1fr) 34px;
}

#recordsTab .order-list-selection-header {
  justify-self: center;
}

#recordsTab .order-list-body .record-list-row.active {
  border-color: #b8d4fb;
  background: #f0f7ff;
}

#recordsTab .order-list-body .record-list-row.recently-viewed {
  border-color: #9fc4f8;
  background: #eaf4ff;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e3eaf3;
  background: #fff;
  color: #64748b;
  font-size: 12px;
}

.list-pagination-meta {
  margin-right: auto;
  white-space: nowrap;
}

.list-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.list-pagination-page {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid #d7e1ed;
  border-radius: 4px;
  background: #fff;
  color: #3d526b;
  cursor: pointer;
}

.list-pagination-page:hover,
.list-pagination-page.active {
  border-color: #075cc7;
  background: #075cc7;
  color: #fff;
}

.list-pagination-ellipsis {
  padding: 0 2px;
  color: #94a3b8;
}

.list-pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.list-pagination-jump input {
  width: 50px;
  height: 28px;
  padding: 2px 5px;
  border: 1px solid #d7e1ed;
  border-radius: 4px;
  color: #1e293b;
}

@media (max-width: 720px) {
  .list-pagination {
    justify-content: center;
  }

  .list-pagination-meta {
    width: 100%;
    margin-right: 0;
    text-align: center;
  }
}

#recordsTab .order-list-cell.company-id,
#recordsTab .order-list-cell.patient-id {
  font-weight: 700;
}

#recordsTab .order-list-cell.status {
  color: #9a3412;
  font-weight: 800;
}

#recordsTab .order-list-cell.company {
  color: #0f172a;
  font-weight: 700;
}

#recordsTab .order-list-cell.orderer {
  color: #334155;
  font-weight: 700;
}

#recordsTab .order-list-cell.urgent {
  color: #b42318;
  font-weight: 800;
}

#recordsTab .order-list-cell.muted {
  color: #64748b;
}

#recordsTab .phase3-order-item .after-sales-mini-badge {
  justify-self: start;
  max-width: 100%;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 4px;
}

#recordsTab .production-batch-order-list {
  gap: 4px;
}

#recordsTab .production-batch-order-group {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 126px;
  min-width: 0;
  border: 1px solid #edf2f7;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

#recordsTab .production-batch-number-cell {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 10px;
  border-right: 1px solid #d8e2ef;
  background: #f8fafc;
}

#recordsTab .production-batch-export-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding: 6px 10px;
  border-left: 1px solid #d8e2ef;
  background: #ffffff;
}

#recordsTab .production-batch-number-cell strong,
#recordsTab .production-batch-number-cell .production-batch-number-button,
#recordsTab .production-batch-number-cell span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#recordsTab .production-batch-number-cell strong,
#recordsTab .production-batch-number-cell .production-batch-number-button {
  color: #075cc7;
  font-size: 12px;
  font-weight: 900;
}

#recordsTab .production-batch-number-cell span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

#recordsTab .production-batch-export-cell .batch-export-btn {
  min-height: 24px;
  width: 104px;
  padding: 0 7px;
  font-size: 11px;
  line-height: 22px;
}

.batch-export-btn.pending {
  border-color: #dc2626;
  background: #dc2626;
  color: #ffffff;
}

.batch-export-btn.pending:hover {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

.batch-export-btn.exported {
  border-color: #bfd0e7;
  background: #ffffff;
  color: #0f5bd7;
}

.batch-export-history-card {
  margin-top: 12px;
}

.batch-export-history {
  display: grid;
  gap: 6px;
}

.batch-export-history-row {
  display: grid;
  grid-template-columns: 80px 100px 160px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid #dbe6f4;
  border-radius: 4px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
}

.batch-export-history-row strong {
  color: #0f172a;
}

.batch-export-history-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-export-history.empty {
  padding: 10px 12px;
  border: 1px dashed #c9d8eb;
  border-radius: 4px;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
}

#recordsTab .production-batch-order-rows {
  display: grid;
  min-width: 0;
}

#recordsTab .production-batch-order-row {
  min-width: 0;
  border-bottom: 1px solid #edf2f7;
}

#recordsTab .production-batch-order-row:last-child {
  border-bottom: 0;
}

#recordsTab .production-batch-order-row.active {
  background: #f0f7ff;
}

#recordsTab .production-batch-order-group.active,
#recordsTab .production-batch-order-row.batch-active {
  background: #eaf4ff;
}

#recordsTab .production-batch-order-row.recently-viewed {
  background: #eaf4ff;
}

#recordsTab .shipping-merge-select-row {
  position: relative;
  display: block !important;
}

#recordsTab .shipping-merge-check {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 2;
  transform: translateY(-50%);
  justify-self: center;
  width: 14px;
  height: 14px;
}

#recordsTab .shipping-merge-select-row .record-item {
  width: 100%;
  padding-right: 40px;
}

#recordsTab .shipping-merge-order-list .order-list-header {
  margin-left: 0;
  padding-right: 40px;
}

#recordsTab .shipping-merge-select-header {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

#recordsTab .shipping-merge-select-all {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#recordsTab .shipping-merge-select-all input {
  width: 14px;
  height: 14px;
}

#recordsTab .shipping-merge-select-all span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

#recordsTab .shipping-merge-select-all em {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#recordsTab .production-batch-number-button {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

#recordsTab .production-batch-number-button:hover {
  text-decoration: underline;
}

#recordsTab .production-batch-order-item {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-left: 0;
  background: transparent;
  text-align: left;
}

.production-workorder-detail .record-detail-top {
  margin-bottom: 14px;
}

.production-work-card {
  margin-top: 14px;
}

.production-work-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.production-work-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
}

.production-work-table th,
.production-work-table td {
  height: 36px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f7;
  color: #0f172a;
  font-size: 12px;
  line-height: 16px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

.production-work-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
}

.production-work-table tr:last-child td {
  border-bottom: 0;
}

.production-work-lens-table input {
  width: 180px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}

.production-work-order-list {
  display: grid;
  gap: 12px;
}

.production-work-order-block {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.production-work-order-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.production-work-order-block > header strong {
  color: var(--primary);
  font-size: 13px;
}

.production-work-order-block > header span {
  color: #64748b;
  font-size: 12px;
}

.production-work-order-block .compact-param-grid {
  margin: 0;
  gap: 0;
}

.production-work-order-block .compact-param-card {
  border: 0;
  border-radius: 0;
}

@keyframes records-detail-slide-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Global square UI: data panels, form controls, buttons, tables, and dialogs use sharp corners. */
:root {
  --radius: 0;
  --radius-sm: 0;
}

button,
input,
select,
textarea,
table,
fieldset,
details,
summary,
.panel,
.card,
.login-card,
.user-system-card,
.records-panel,
.records-workspace,
.records-stage-panel,
.records-sidebar,
.records-list,
.records-list-head,
.records-sidebar-toolbar,
.records-stage-title,
.record-detail-panel,
.record-detail-shell,
.record-clinical-card,
.record-detail-empty,
.record-list-row,
.record-item,
.phase1-stage-tab,
.phase1-order-item,
.phase3-order-item,
.order-month-group,
.order-month-group summary,
.order-list-header,
.production-batch-item,
.production-work-order-block,
.production-work-table-wrap,
.production-lens-table-wrap,
.commercial-summary-card,
.commercial-summary-item,
.compact-detail-section,
.phase3-modal,
.phase3-modal-overlay .phase3-modal,
.shipment-compact-table-wrap,
.shipment-compact-table,
.dashboard-summary-card,
.dashboard-todo-card,
.dashboard-todo-row,
.dashboard-empty,
.dashboard-empty-line,
.after-sales-list-item,
.after-sales-table-head,
.after-sales-table-row,
.production-archive-header,
.production-archive-row,
.product-line-card,
.output-panel,
.output-card,
.mine-institution-card,
.mine-support-card,
.user-row,
.staff-role-pill,
.record-status-pill,
.phase1-flow-marker,
.production-mini-badge,
.after-sales-status,
.after-sales-mini-badge,
.phase3-tag,
.dock-count-badge,
.primary-btn,
.ghost-btn,
.danger-btn,
.compact-btn {
  border-radius: 0 !important;
}

/* Output workspace: keep the clinical review flow legible before an order is submitted. */
#outputTab {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#outputTab > .output-info-panel,
#outputTab > .lens-model-panel,
#outputTab > .action-panel,
#outputTab > .parameter-trial-adjustment-panel {
  grid-column: 1 / -1;
  grid-row: auto;
}

#outputTab > .output-input-panel {
  grid-column: 1;
  grid-row: auto;
}

#outputTab > .output-result-panel {
  grid-column: 2;
  grid-row: auto;
}

#outputTab .toolbar {
  padding-bottom: 2px;
}

#outputTab .page-subtitle {
  margin-bottom: 0;
}

#outputTab .compact-panel > h2 {
  padding: 14px 16px;
  color: #17345d;
  font-size: 16px;
  letter-spacing: 0;
}

#outputCaseInfoGrid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

#outputCaseInfoGrid .summary-item.commercial-summary-item {
  position: static;
  min-height: 70px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

#outputCaseInfoGrid .summary-item.commercial-summary-item::before {
  display: none;
}

#outputCaseInfoGrid .summary-item.commercial-summary-item span {
  margin-bottom: 6px;
  color: #61738f;
  font-size: 12px;
  font-weight: 700;
}

#outputCaseInfoGrid .summary-item.commercial-summary-item strong {
  color: #17345d;
  font-size: 14px;
  font-weight: 800;
}

#outputTab .output-input-panel,
#outputTab .output-result-panel {
  min-width: 0;
}

#outputTab .output-input-panel .eye-param-table,
#outputTab .output-result-panel .eye-param-table {
  table-layout: fixed;
}

#outputTab .output-input-panel .eye-param-table th,
#outputTab .output-result-panel .eye-param-table th {
  background: #f5f8fc;
  color: #24466f;
}

#outputTab .output-input-panel .eye-param-table td,
#outputTab .output-result-panel .eye-param-table td {
  color: #203b60;
}

#outputTab .parameter-trial-adjustment-panel {
  padding-bottom: 16px;
}

#outputTab .parameter-trial-adjustment-panel > h2 {
  margin-bottom: 6px;
}

#outputTab .parameter-trial-adjustment-panel > .muted {
  margin: 0 0 14px;
}

.output-visibility-column {
  width: 104px;
  text-align: center;
}

.output-visibility-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.output-visibility-badge.customer-visible {
  border-color: #a7d8c0;
  background: #eaf8f0;
  color: #17633f;
}

.output-visibility-badge.internal-only {
  border-color: #e3c48c;
  background: #fff6e5;
  color: #8a5710;
}

@media (max-width: 980px) {
  #outputTab {
    grid-template-columns: 1fr;
  }

  #outputTab > .toolbar,
  #outputTab > .output-info-panel,
  #outputTab > .output-input-panel,
  #outputTab > .output-result-panel,
  #outputTab > .parameter-trial-adjustment-panel,
  #outputTab > .lens-model-panel,
  #outputTab > .action-panel {
    grid-column: 1;
    grid-row: auto;
  }

  #outputCaseInfoGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #outputCaseInfoGrid {
    grid-template-columns: 1fr;
  }
}
