:root {
  --navy-950: #08233c;
  --navy-900: #0b2d4a;
  --navy-800: #123d5d;
  --navy-700: #1d4d6d;
  --teal-700: #087c70;
  --teal-600: #0b9484;
  --teal-500: #15a894;
  --teal-100: #dff5f0;
  --teal-50: #effaf7;
  --ink: #162c3a;
  --muted: #6b7c88;
  --subtle: #93a1aa;
  --line: #dfe7e9;
  --line-soft: #ebf0f1;
  --canvas: #f3f6f5;
  --surface: #ffffff;
  --warm: #fff9ed;
  --warning: #d88317;
  --warning-soft: #fff2d9;
  --danger: #c84e4e;
  --danger-soft: #ffebeb;
  --success: #17835d;
  --success-soft: #e2f4eb;
  --purple: #6e59a8;
  --purple-soft: #eee9fb;
  --blue: #3576b8;
  --blue-soft: #e8f1fa;
  --shadow-sm: 0 2px 9px rgba(11, 45, 74, 0.055);
  --shadow-md: 0 14px 38px rgba(11, 45, 74, 0.14);
  --control-edge: rgba(19, 54, 71, 0.2);
  --control-shadow: rgba(12, 43, 59, 0.14);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 19px;
  --sidebar-width: 224px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
}

body {
  min-width: 760px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(11, 148, 132, 0.2);
  outline-offset: 1px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 30;
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 13px 15px;
  color: #dbe8ee;
  background:
    radial-gradient(circle at 0 2%, rgba(28, 135, 133, 0.23), transparent 30%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  box-shadow: 5px 0 18px rgba(6, 28, 48, 0.1);
}

.brand {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px;
  -webkit-app-region: drag;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(209, 242, 255, 0.58);
  border-radius: 13px;
  background: #a8ddff;
  box-shadow: 0 8px 20px rgba(3, 20, 37, 0.3), inset 0 1px rgba(255, 255, 255, 0.8);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-copy {
  min-width: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  max-width: 145px;
  overflow: hidden;
  color: #eefaff;
  font-family: "Segoe UI Variable Display", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 800;
  font-variant-ligatures: none;
  line-height: 1.05;
  letter-spacing: 0.075em;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(28, 169, 230, 0.28);
  white-space: nowrap;
}

.brand-wordmark {
  background: linear-gradient(180deg, #ffffff 10%, #c8ecff 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand span {
  max-width: 145px;
  margin-top: 3px;
  overflow: hidden;
  color: #9fc8d9;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
  overflow-y: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.nav-item {
  position: relative;
  width: 100%;
  height: 43px;
  flex: 0 0 43px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  color: #b9ccd5;
  background: transparent;
  text-align: left;
  transition: 0.17s ease;
  -webkit-app-region: no-drag;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 7px;
  width: 3px;
  height: 29px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.nav-item span {
  flex: 1;
  font-size: 14px;
}

.nav-item em {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  color: #fff;
  background: #cf5a55;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(17, 161, 143, 0.26), rgba(17, 161, 143, 0.1));
  box-shadow: inset 0 0 0 1px rgba(116, 223, 204, 0.1);
}

.nav-item.is-active::before {
  background: #38c3ab;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 13px 10px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.safety-dot {
  position: relative;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(27, 190, 159, 0.13);
}

.safety-dot::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #39c9a9;
  box-shadow: 0 0 0 3px rgba(57, 201, 169, 0.15);
}

.sidebar-foot strong,
.sidebar-foot span {
  display: block;
}

.sidebar-foot strong {
  color: #d8e5ea;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-foot span {
  color: #7897a5;
  font-size: 10px;
}

.workspace {
  min-width: 0;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.titlebar {
  position: relative;
  z-index: 20;
  height: 66px;
  flex: 0 0 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px 0 27px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-app-region: drag;
}

.titlebar-copy,
.titlebar-side {
  display: flex;
  align-items: center;
}

.titlebar-copy {
  gap: 12px;
}

.app-menu-bar {
  height: 32px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1px;
}

.app-menu-bar button {
  min-width: 42px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: #3a3a3c;
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: default;
}

.app-menu-bar button:hover,
.app-menu-bar button.is-open {
  color: #1d1d1f;
  background: rgba(60, 60, 67, .09);
}

.titlebar h1,
.titlebar p {
  margin: 0;
}

.titlebar h1 {
  color: var(--navy-900);
  font-size: 16px;
  line-height: 1.25;
}

.titlebar p {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 11px;
}

.titlebar-side {
  height: 100%;
  gap: 13px;
}

.no-drag,
.no-drag * {
  -webkit-app-region: no-drag;
}

.date-chip {
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  color: var(--muted);
  background: #f8faf9;
  font-size: 11px;
}

.window-controls {
  height: 100%;
  display: flex;
  align-items: center;
}

.window-controls button {
  width: 40px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #72818a;
  background: transparent;
}

.window-controls button:hover {
  color: var(--navy-900);
  background: #eef3f3;
}

.window-controls button.danger:hover {
  color: #fff;
  background: #d84d4d;
}

.window-controls svg {
  width: 12px;
  height: 12px;
  stroke-width: 1.1;
}

.mobile-menu {
  width: 38px;
  height: 38px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #edf3f2;
}

.mobile-menu svg {
  width: 20px;
  height: 20px;
}

.main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.main-content::-webkit-scrollbar,
.dialog-body::-webkit-scrollbar {
  width: 9px;
}

.main-content::-webkit-scrollbar-thumb,
.dialog-body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #bdcbce;
  background-clip: padding-box;
}

.view {
  display: none;
  min-height: 100%;
  padding: 23px 27px 34px;
  animation: view-in 0.17s ease both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.welcome-card {
  position: relative;
  min-height: 136px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 90% 35%, rgba(42, 196, 169, 0.28), transparent 31%),
    linear-gradient(120deg, #0b3455, #10566e);
  box-shadow: 0 10px 27px rgba(11, 52, 85, 0.14);
}

.welcome-card::after {
  content: "";
  position: absolute;
  right: -65px;
  bottom: -135px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(127, 233, 211, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 27px rgba(119, 224, 203, 0.04), 0 0 0 55px rgba(119, 224, 203, 0.025);
}

.welcome-copy,
.quick-actions {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 3px;
  color: #91dacb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.welcome-card h2,
.welcome-card p {
  margin: 0;
}

.welcome-card h2 {
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.welcome-card p {
  margin-top: 7px;
  color: #bed2db;
  font-size: 12px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
  box-shadow: 0 5px 12px rgba(8, 124, 112, 0.17);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0da38f, #087569);
  box-shadow: 0 6px 15px rgba(8, 124, 112, 0.23);
}

.welcome-card .btn-primary {
  color: var(--navy-950);
  background: #55d5bc;
  box-shadow: 0 5px 15px rgba(4, 31, 50, 0.24);
}

.btn-soft {
  color: #eafffa;
  border-color: rgba(221, 250, 244, 0.19);
  background: rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(4px);
}

.btn-soft:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-secondary {
  color: var(--navy-800);
  border-color: #d6e1e2;
  background: #fff;
}

.btn-secondary:hover {
  border-color: #afc8ca;
  background: #f9fbfb;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-danger:hover {
  background: #b63e3e;
}

.btn.compact {
  min-height: 35px;
  padding: 0 13px;
  font-size: 12px;
}

.btn.block {
  width: 100%;
  margin-top: 9px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(115px, 1fr));
  gap: 12px;
  margin-top: 17px;
}

.stat-card {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  padding: 15px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -23px;
  bottom: -31px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--stat-soft, var(--teal-50));
}

.stat-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.stat-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--stat-color, var(--teal-700));
  background: var(--stat-soft, var(--teal-50));
  font-size: 13px;
  font-weight: 700;
}

.stat-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: var(--navy-900);
  font-size: 25px;
  font-weight: 750;
  line-height: 1;
}

.stat-hint {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 5px;
  color: var(--subtle);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.23fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-grid > .panel {
  min-height: 262px;
  padding: 19px 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3,
.panel-head p {
  margin: 0;
}

.panel-head h3 {
  color: var(--navy-900);
  font-size: 15px;
}

.section-kicker {
  display: block;
  margin-bottom: 1px;
  color: var(--teal-600);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.text-btn {
  padding: 3px 0;
  border: 0;
  color: var(--teal-700);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.text-btn:hover {
  color: var(--teal-500);
}

.schedule-list,
.compact-list,
.attention-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 50px 3px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  padding: 5px 3px;
}

.schedule-time {
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.schedule-line {
  align-self: stretch;
  margin: 1px 0;
  border-radius: 3px;
  background: var(--item-color, var(--teal-500));
}

.schedule-copy {
  min-width: 0;
}

.schedule-copy strong,
.schedule-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.schedule-copy span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.compact-item {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 5px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.compact-item:last-child {
  border-bottom: 0;
}

.compact-marker {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid var(--marker-color, var(--teal-600));
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--marker-soft, var(--teal-50));
}

.compact-copy {
  min-width: 0;
  flex: 1;
}

.compact-copy strong,
.compact-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-copy strong {
  font-size: 12px;
}

.compact-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.mini-progress {
  width: 60px;
  flex: 0 0 auto;
}

.mini-progress strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy-800);
  font-size: 10px;
  text-align: right;
}

.progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 5px;
  background: #e8eeee;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-600), #30bca4);
  transition: width 0.25s ease;
}

.attention-item {
  min-height: 53px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 5px;
  border-bottom: 1px solid var(--line-soft);
}

.attention-item:last-child {
  border-bottom: 0;
}

.attention-symbol {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 13px;
  font-weight: 800;
}

.attention-copy {
  min-width: 0;
  flex: 1;
}

.attention-copy strong,
.attention-copy span {
  display: block;
}

.attention-copy strong {
  font-size: 11px;
}

.attention-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.mini-empty {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--subtle);
  text-align: center;
}

.mini-empty .empty-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--teal-50);
  font-weight: 700;
}

.mini-empty strong {
  color: var(--muted);
  font-size: 12px;
}

.mini-empty span {
  margin-top: 2px;
  font-size: 10px;
}

.content-heading {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.content-heading h2,
.content-heading p {
  margin: 0;
}

.content-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.content-heading h2 {
  color: var(--navy-900);
  font-size: 22px;
}

.content-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  min-height: 61px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  padding: 10px 12px;
}

.search-box {
  min-width: 240px;
  max-width: 410px;
  height: 39px;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--subtle);
  background: #fbfcfc;
}

.search-box:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(21, 168, 148, 0.1);
}

.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.toolbar select,
.field select,
.field input,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.toolbar select {
  height: 39px;
  padding: 0 31px 0 11px;
  font-size: 12px;
}

.toolbar-count {
  margin-left: auto;
  padding-right: 5px;
  color: var(--subtle);
  font-size: 11px;
  white-space: nowrap;
}

.upcoming-toolbar {
  flex-wrap: wrap;
}

.inline-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.toolbar-note {
  color: var(--subtle);
  font-size: 10px;
}

.upcoming-list {
  overflow: hidden;
}

.upcoming-item {
  display: grid;
  grid-template-columns: 42px 104px minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line-soft);
}

.upcoming-item:last-child {
  border-bottom: 0;
}

.upcoming-item.is-overdue {
  background: linear-gradient(90deg, rgba(198, 77, 70, 0.045), transparent 42%);
}

.upcoming-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--item-color);
  background: var(--item-soft);
  font-size: 13px;
  font-weight: 800;
}

.upcoming-time strong,
.upcoming-time span,
.upcoming-copy h3,
.upcoming-copy p {
  display: block;
  margin: 0;
}

.upcoming-time strong {
  color: var(--navy-900);
  font-size: 11px;
}

.upcoming-time span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.upcoming-copy {
  min-width: 0;
}

.upcoming-copy > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upcoming-type {
  font-size: 9px;
  font-weight: 700;
}

.upcoming-copy h3,
.upcoming-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-copy h3 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
}

.upcoming-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.upcoming-actions {
  min-width: 35px;
}

.summary-toolbar {
  flex-wrap: wrap;
}

.summary-mode-switch,
.summary-period-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.summary-period-label {
  margin-left: auto;
  color: var(--navy-800);
  font-size: 11px;
}

.summary-print-period {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-left: 3px solid var(--teal-600);
  border-radius: 7px;
  color: var(--navy-800);
  background: var(--teal-50);
  font-size: 11px;
  font-weight: 700;
}

.summary-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.summary-stat-card {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.summary-stat-card > span,
.summary-symbol {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
}

.summary-stat-card strong,
.summary-stat-card small {
  display: block;
}

.summary-stat-card strong {
  color: var(--navy-900);
  font-size: 22px;
}

.summary-stat-card small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.summary-list {
  overflow: hidden;
}

.summary-item {
  min-height: 82px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 105px 36px;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.summary-item:last-child {
  border-bottom: 0;
}

.summary-symbol {
  color: var(--item-color);
  background: var(--item-soft);
}

.summary-item-copy {
  min-width: 0;
}

.summary-item-copy span,
.summary-item-copy h3,
.summary-item-copy p,
.summary-item time strong,
.summary-item time span {
  display: block;
  margin: 0;
}

.summary-item-copy span {
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 700;
}

.summary-item-copy h3 {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item-copy p {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item time {
  text-align: right;
}

.summary-item time strong {
  color: var(--navy-800);
  font-size: 10px;
}

.summary-item time span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
}

.data-panel {
  min-height: 260px;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th {
  height: 45px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  color: #71838d;
  background: #f8faf9;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-align: left;
}

.data-table td {
  height: 70px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.13s ease;
}

.data-table tbody tr:hover {
  background: #fbfdfc;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.task-table th:nth-child(1) { width: 25%; }
.task-table th:nth-child(2) { width: 11%; }
.task-table th:nth-child(3) { width: 14%; }
.task-table th:nth-child(4) { width: 9%; }
.task-table th:nth-child(5) { width: 15%; }
.task-table th:nth-child(6) { width: 11%; }
.task-table th:nth-child(7) { width: 15%; }

.purchase-table { min-width: 1050px; }
.purchase-table th:nth-child(1) { width: 21%; }
.purchase-table th:nth-child(2) { width: 15%; }
.purchase-table th:nth-child(3) { width: 10%; }
.purchase-table th:nth-child(4) { width: 13%; }
.purchase-table th:nth-child(5) { width: 11%; }
.purchase-table th:nth-child(6) { width: 9%; }
.purchase-table th:nth-child(7) { width: 9%; }
.purchase-table th:nth-child(8) { width: 12%; }

.employee-table { min-width: 1040px; }
.employee-table th:nth-child(1) { width: 17%; }
.employee-table th:nth-child(2) { width: 13%; }
.employee-table th:nth-child(3) { width: 15%; }
.employee-table th:nth-child(4) { width: 12%; }
.employee-table th:nth-child(5) { width: 16%; }
.employee-table th:nth-child(6) { width: 11%; }
.employee-table th:nth-child(7) { width: 7%; }
.employee-table th:nth-child(8) { width: 9%; }

.employee-submodule-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px;
  background: #eef4f4;
}

.employee-submodule-tab {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.employee-submodule-tab > span {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--teal-700);
  background: rgba(255, 255, 255, .7);
  font-size: 13px;
  font-weight: 800;
}

.employee-submodule-tab strong {
  align-self: end;
  color: var(--navy-800);
  font-size: 12px;
}

.employee-submodule-tab small {
  align-self: start;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
}

.employee-submodule-tab:hover {
  color: var(--teal-700);
  background: rgba(255, 255, 255, .55);
}

.employee-submodule-tab.is-active {
  border-color: #c8dddd;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.employee-submodule-tab.is-active > span {
  color: #fff;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  box-shadow: 0 5px 12px rgba(11, 116, 104, .2);
}

.customer-submodule-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px;
  background: #eef4f4;
}

.customer-submodule-tab {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.customer-submodule-tab > span {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--teal-700);
  background: rgba(255, 255, 255, .7);
  font-size: 13px;
  font-weight: 800;
}

.customer-submodule-tab strong {
  align-self: end;
  color: var(--navy-800);
  font-size: 12px;
}

.customer-submodule-tab small {
  align-self: start;
  overflow: hidden;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-submodule-tab:hover {
  color: var(--teal-700);
  background: rgba(255, 255, 255, .55);
}

.customer-submodule-tab.is-active {
  border-color: #c8dddd;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.customer-submodule-tab.is-active > span {
  color: #fff;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  box-shadow: 0 5px 12px rgba(11, 116, 104, .2);
}

.employee-submodule-panel {
  min-width: 0;
}

.submodule-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 12px;
}

.submodule-heading h3,
.submodule-heading p {
  margin: 0;
}

.submodule-heading h3 {
  color: var(--navy-900);
  font-size: 16px;
}

.submodule-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.payroll-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.payroll-summary-card {
  position: relative;
  min-height: 91px;
  overflow: hidden;
  padding: 14px 48px 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.payroll-summary-card span,
.payroll-summary-card strong,
.payroll-summary-card small {
  display: block;
}

.payroll-summary-card span {
  color: var(--muted);
  font-size: 9px;
}

.payroll-summary-card strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--navy-900);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-summary-card small {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 8px;
}

.payroll-summary-card i {
  position: absolute;
  right: 12px;
  top: 14px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.payroll-toolbar {
  gap: 9px;
}

.payroll-month-control {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.payroll-month-control input {
  width: 125px;
  height: 30px;
  padding: 0 7px;
  border: 0;
  color: var(--navy-800);
  background: transparent;
  outline: 0;
  font-size: 10px;
  font-weight: 700;
}

.month-step-button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 11px;
  font-weight: 700;
}

.month-step-button:hover {
  background: #dff3ef;
}

.payroll-batch-bar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 9px 13px;
  color: #4b6772;
  background: linear-gradient(90deg, #f7fbfa, #eef8f6);
  font-size: 10px;
}

.payroll-batch-bar > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.payroll-batch-bar strong {
  color: var(--teal-700);
  font-size: 11px;
}

.payroll-batch-bar span,
.payroll-batch-bar small {
  display: block;
}

.payroll-batch-bar small {
  color: var(--subtle);
  font-size: 9px;
}

.payroll-table {
  min-width: 1490px;
}

.payroll-table th:nth-child(1) { width: 12%; }
.payroll-table th:nth-child(2) { width: 10%; }
.payroll-table th:nth-child(3),
.payroll-table th:nth-child(4),
.payroll-table th:nth-child(5),
.payroll-table th:nth-child(6),
.payroll-table th:nth-child(7) { width: 9%; }
.payroll-table th:nth-child(8) { width: 13%; }
.payroll-table th:nth-child(9) { width: 8%; }
.payroll-table th:nth-child(10) { width: 12%; }

.money-cell strong,
.money-cell span {
  display: block;
  white-space: nowrap;
}

.money-cell strong {
  color: var(--navy-800);
  font-size: 11px;
}

.money-cell span,
.payment-date {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 8px;
}

.money-cell.deduction strong {
  color: #a45d25;
}

.money-cell.net strong {
  color: var(--teal-700);
  font-size: 12px;
}

.cell-title {
  min-width: 0;
}

.cell-title strong,
.cell-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-title strong {
  color: var(--ink);
  font-size: 12px;
}

.cell-title span {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 9px;
}

.assignee-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--teal-100);
  font-size: 10px;
  font-weight: 700;
}

.date-cell {
  color: var(--muted);
  font-size: 10px;
}

.date-cell strong,
.date-cell span {
  display: block;
}

.date-cell strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
}

.date-cell.is-overdue strong,
.date-cell.is-overdue span {
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--badge-color, var(--muted));
  background: var(--badge-bg, #edf1f1);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
}

.priority-urgent { --badge-color: #ba3333; --badge-bg: #ffe6e6; }
.priority-high { --badge-color: #c96a13; --badge-bg: #fff0dc; }
.priority-medium { --badge-color: #3576a8; --badge-bg: #e8f2fa; }
.priority-low { --badge-color: #6d7c83; --badge-bg: #edf1f1; }
.status-pending { --badge-color: #627681; --badge-bg: #edf2f3; }
.status-progress { --badge-color: #087e72; --badge-bg: #ddf5ef; }
.status-blocked { --badge-color: #bc4e42; --badge-bg: #ffebe8; }
.status-review { --badge-color: #6c55a1; --badge-bg: #eee9fa; }
.status-completed { --badge-color: #23815e; --badge-bg: #e3f4ec; }
.status-cancelled { --badge-color: #7e8589; --badge-bg: #ecefef; }
.status-confirmed { --badge-color: #2c70aa; --badge-bg: #e6f1fa; }
.status-arrived { --badge-color: #6d55a4; --badge-bg: #eee9fa; }
.status-waiting { --badge-color: #b46b16; --badge-bg: #fff0dc; }

.table-progress {
  min-width: 75px;
}

.table-progress span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.actions-col {
  text-align: right !important;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.quick-action-button {
  min-width: 0;
  height: 30px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid #8fd3c7;
  border-radius: 7px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.quick-action-button:hover {
  color: #fff;
  border-color: var(--teal-600);
  background: var(--teal-600);
}

.quick-action-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.icon-button:hover {
  color: var(--teal-700);
  border-color: var(--line);
  background: #fff;
}

.icon-button.delete:hover {
  color: var(--danger);
  border-color: #f1d2d2;
  background: var(--danger-soft);
}

.empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px;
  color: var(--subtle);
  text-align: center;
}

.empty-state-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 18px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 22px;
  font-weight: 700;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state h3 {
  color: var(--muted);
  font-size: 14px;
}

.empty-state p {
  max-width: 330px;
  margin-top: 4px;
  font-size: 11px;
}

.empty-state .btn {
  margin-top: 14px;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.customer-grid,
.supplier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.customer-card,
.supplier-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.customer-card.is-overdue::before {
  content: "待跟进";
  position: absolute;
  top: 0;
  right: 18px;
  padding: 3px 9px;
  border-radius: 0 0 7px 7px;
  color: #fff;
  background: #c64d46;
  font-size: 8px;
  font-weight: 700;
}

.supplier-card.is-overdue::before {
  content: "待联系";
  position: absolute;
  top: 0;
  right: 18px;
  padding: 3px 9px;
  border-radius: 0 0 7px 7px;
  color: #fff;
  background: #c64d46;
  font-size: 8px;
  font-weight: 700;
}

.customer-avatar,
.supplier-avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 12px;
  font-weight: 800;
}

.supplier-avatar {
  color: #5f6eaa;
  background: #eceefa;
}

.customer-badges {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.customer-details,
.supplier-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 9px;
  background: #f7faf9;
}

.customer-details .full,
.supplier-details .full {
  grid-column: 1 / -1;
}

.is-clickable-card,
.is-clickable-row,
.schedule-item {
  cursor: pointer;
}

.is-clickable-card {
  transition: border-color 0.17s ease, box-shadow 0.17s ease, transform 0.17s ease;
}

.is-clickable-card:hover,
.is-clickable-card:focus-visible {
  border-color: #a9d9d1;
  outline: 0;
  box-shadow: 0 8px 24px rgba(7, 58, 68, 0.1);
  transform: translateY(-1px);
}

.is-clickable-row:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: -2px;
}

.inline-link-button {
  width: fit-content;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid #b9ddd6;
  border-radius: 5px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 9px;
  font-weight: 700;
}

.inline-link-button:hover {
  color: #fff;
  border-color: var(--teal-600);
  background: var(--teal-600);
}

.money-cell {
  color: var(--navy-900);
  font-size: 11px;
  white-space: nowrap;
}

.visit-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.visit-card.is-today {
  border-color: #bde4dc;
  box-shadow: 0 4px 17px rgba(8, 124, 112, 0.08);
}

.visit-card.is-today::before {
  content: "今日";
  position: absolute;
  top: 0;
  right: 18px;
  padding: 3px 9px;
  border-radius: 0 0 7px 7px;
  color: #fff;
  background: var(--teal-600);
  font-size: 8px;
  font-weight: 700;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.visit-timebox {
  width: 68px;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--navy-900);
  background: #eef5f4;
}

.visit-timebox strong {
  font-size: 18px;
  line-height: 1.1;
}

.visit-timebox span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.card-main {
  min-width: 0;
  flex: 1;
}

.card-main h3,
.card-main p {
  margin: 0;
}

.card-main h3 {
  overflow: hidden;
  color: var(--navy-900);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-main p {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.detail-item {
  min-width: 0;
}

.detail-item span,
.detail-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-item span {
  color: var(--subtle);
  font-size: 9px;
}

.detail-item strong {
  margin-top: 1px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.card-footer > .date-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sample-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.sample-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 3px;
  height: 38px;
  border-radius: 0 3px 3px 0;
  background: var(--sample-color, var(--teal-500));
}

.sample-code {
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sample-card h3 {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--navy-900);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-company {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 15px;
}

.sample-flow::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 6px;
  height: 2px;
  background: #e4ebeb;
}

.flow-step {
  position: relative;
  z-index: 1;
  color: var(--subtle);
  font-size: 8px;
  text-align: center;
}

.flow-step::before {
  content: "";
  width: 10px;
  height: 10px;
  display: block;
  margin: 1px auto 6px;
  border: 2px solid #dbe4e4;
  border-radius: 50%;
  background: #fff;
}

.flow-step.is-done {
  color: var(--teal-700);
}

.flow-step.is-done::before {
  border-color: var(--teal-500);
  background: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-100);
}

.sample-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 11px;
  border-radius: 9px;
  background: #f7faf9;
}

.sample-meta .detail-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.sample-card .card-footer {
  margin-top: 12px;
}

.notification-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: -2px 0 13px;
}

.filter-pill {
  height: 31px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}

.filter-pill:hover,
.filter-pill.is-active {
  color: var(--teal-700);
  border-color: #acdcd3;
  background: var(--teal-50);
}

.notification-list {
  overflow: hidden;
}

.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-height: 78px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.is-unread {
  background: #fbfefd;
}

.notification-item.is-unread::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-500);
  transform: translateY(-50%);
}

.notification-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--note-color, var(--teal-700));
  background: var(--note-soft, var(--teal-50));
  font-size: 15px;
  font-weight: 700;
}

.notification-copy h3,
.notification-copy p {
  margin: 0;
}

.notification-copy h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
}

.notification-group-count {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 8px;
  font-weight: 600;
}

.notification-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.notification-time {
  color: var(--subtle);
  font-size: 9px;
  white-space: nowrap;
}

.version-label {
  padding: 5px 10px;
  border-radius: 15px;
  color: var(--muted);
  background: #e9efef;
  font-size: 10px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  align-items: start;
  gap: 14px;
}

.settings-stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.settings-card {
  padding: 19px 20px;
}

.settings-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
}

.settings-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 12px;
  font-weight: 800;
}

.settings-card h3,
.settings-card p {
  margin: 0;
}

.settings-card h3 {
  color: var(--navy-900);
  font-size: 14px;
}

.settings-card-head p {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 10px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.one-col {
  grid-template-columns: minmax(0, 1fr);
}

.address-block {
  grid-column: 1 / -1;
  min-width: 0;
}

.address-block > span {
  display: block;
  margin-bottom: 6px;
  color: #556b77;
  font-size: 11px;
  font-weight: 700;
}

.address-grid {
  display: grid;
  grid-template-columns: .9fr .9fr 1fr 1.25fr 1.9fr;
  gap: 8px;
}

.address-grid label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.address-grid label > small {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 600;
}

.address-grid input,
.address-grid select {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: var(--soft-surface, #f5f8f8);
  outline: 1px solid var(--line-soft);
  font-size: 11px;
}

.address-grid input:focus,
.address-grid select:focus {
  outline: 2px solid rgba(10, 136, 120, .25);
}

.address-copy-action {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--teal-700);
  border-color: #bfe6df;
  background: #eaf8f5;
}

.security-note {
  margin: -4px 0 13px !important;
  padding: 9px 10px;
  border-radius: 8px;
  color: #765311;
  background: #fff7df;
  font-size: 10px;
  line-height: 1.6;
}

.salary-total {
  min-height: 39px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 7px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 14px;
}

.payroll-money-field input {
  color: var(--navy-900);
  font-weight: 650;
}

.payroll-money-field.is-deduction input {
  color: #9b5624;
  background: #fffaf4;
}

.payroll-dialog-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.payroll-dialog-summary article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #f7faf9;
}

.payroll-dialog-summary span,
.payroll-dialog-summary strong {
  display: block;
}

.payroll-dialog-summary span {
  color: var(--muted);
  font-size: 9px;
}

.payroll-dialog-summary strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--navy-900);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-dialog-summary article.is-deduction strong {
  color: #9b5624;
}

.payroll-dialog-summary article.is-net {
  border-color: #acdcd3;
  background: var(--teal-50);
}

.payroll-dialog-summary article.is-net strong {
  color: var(--teal-700);
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field > span {
  color: #556b77;
  font-size: 11px;
  font-weight: 600;
}

.field > span small {
  margin-left: 4px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  outline: none;
  font-size: 12px;
}

.field input,
.field select {
  height: 36px;
}

.field textarea {
  min-height: 66px;
  padding-top: 8px;
  resize: vertical;
}

.field textarea.compact-textarea {
  min-height: 54px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(21, 168, 148, 0.09);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b2bdc2;
}

.field.full {
  grid-column: 1 / -1;
}

.field-hint {
  color: var(--subtle);
  font-size: 9px;
}

.quick-time-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.quick-time-button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #cfe1de;
  border-radius: 6px;
  color: var(--teal-700);
  background: #f5fbfa;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.quick-time-button:hover,
.quick-time-button.is-selected {
  color: #fff;
  border-color: var(--teal-600);
  background: var(--teal-600);
}

.quick-time-button.is-clear {
  color: var(--muted);
  border-color: var(--line);
  background: #f7f8f8;
}

.quick-time-button.is-clear:hover,
.quick-time-button.is-clear.is-selected {
  color: #fff;
  border-color: var(--muted);
  background: var(--muted);
}

.switch-row {
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
}

.switch-row:first-of-type {
  border-top: 0;
}

.switch-row span {
  min-width: 0;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  color: var(--ink);
  font-size: 11px;
}

.switch-row small {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-row i {
  position: relative;
  width: 39px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #c8d2d4;
  transition: 0.17s ease;
}

.switch-row i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 45, 65, 0.25);
  transition: 0.17s ease;
}

.switch-row input:checked + i {
  background: var(--teal-600);
}

.switch-row input:checked + i::after {
  transform: translateX(17px);
}

.switch-row input:focus-visible + i {
  outline: 3px solid rgba(11, 148, 132, 0.2);
}

.settings-submit {
  display: flex;
  justify-content: flex-end;
}

.data-location-card {
  border-color: #c9e1dc;
  background: linear-gradient(155deg, #fff, #f5fbfa);
}

.data-folder-path {
  margin: 3px 0 11px;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid #d4e3e0;
  border-radius: 8px;
  color: var(--navy-800);
  background: #fff;
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-location-card .btn + .btn {
  margin-top: 8px;
}

.data-folder-note {
  margin: 9px 0 0 !important;
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.6;
}

.backup-card {
  text-align: left;
}

.backup-illustration {
  width: 90px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 0 auto 7px;
  border-radius: 24px;
  color: var(--teal-700);
  background: var(--teal-50);
}

.backup-illustration svg {
  width: 65px;
  height: 65px;
  stroke-width: 1.5;
}

.backup-note {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.text-btn.center {
  display: block;
  margin: 11px auto 0;
}

.last-backup {
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--subtle);
  font-size: 9px;
  text-align: center;
}

.info-card {
  border-color: #f0e3c8;
  background: var(--warm);
}

.info-card h3 {
  font-size: 12px;
}

.info-card p {
  margin-top: 6px;
  color: #806f52;
  font-size: 10px;
}

.sidebar-backdrop {
  position: fixed;
  z-index: 25;
  inset: 0;
  display: none;
  background: rgba(3, 22, 36, 0.48);
}

dialog {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

dialog::backdrop {
  background: rgba(5, 26, 42, 0.54);
  backdrop-filter: blur(2px);
}

.editor-dialog {
  position: fixed;
  width: min(1040px, calc(100vw - 42px));
  max-height: calc(100vh - 46px);
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.editor-dialog > form {
  max-height: calc(100vh - 46px);
  display: flex;
  flex-direction: column;
}

.sample-sub-dialog {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  border-radius: inherit;
  background: rgba(5, 26, 42, .56);
  backdrop-filter: blur(2px);
}

.sample-sub-dialog[hidden] {
  display: none !important;
}

.sample-sub-dialog > form {
  width: min(930px, 100%);
  max-height: calc(100% - 4px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(4, 23, 35, .35);
}

.sample-sub-head {
  flex: 0 0 auto;
  padding: 13px 17px 11px;
  background: linear-gradient(90deg, #fff, #f7fbfa);
}

.sample-sub-close {
  width: 46px;
  min-width: 46px;
  height: 46px;
  color: var(--navy-700);
  border-color: var(--line);
  background: #eef4f3;
}

.sample-sub-close svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.sample-sub-body {
  min-height: 120px;
  flex: 1;
  overflow-y: auto;
  padding: 13px 17px 15px;
  background: #fff;
}

.sample-sub-body::-webkit-scrollbar { width: 8px; }
.sample-sub-body::-webkit-scrollbar-thumb { border-radius: 8px; background: #c9d8d6; }

.sample-sub-actions {
  min-height: 61px;
  flex: 0 0 auto;
}

.sample-sub-actions #sample-sub-print {
  margin-right: auto;
}

.sample-sub-body > .sample-report-section {
  margin-top: 0;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-head > div {
  min-width: 0;
  flex: 1;
}

.dialog-head h2,
.dialog-head p {
  margin: 0;
}

.dialog-head h2 {
  color: var(--navy-900);
  font-size: 18px;
}

.dialog-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dialog-kicker {
  display: block;
  margin-bottom: 1px;
  color: var(--teal-600);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.dialog-close {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border-color: var(--line);
  color: var(--navy-700);
  background: #f3f6f5;
  font-size: 11px;
  font-weight: 700;
  touch-action: manipulation;
}

.dialog-close svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.print-preview-dialog {
  width: min(1180px, calc(100vw - 34px));
  height: min(860px, calc(100vh - 28px));
  max-width: none;
  max-height: none;
  overflow: hidden;
  border-radius: 16px;
  background: #eef2f2;
  box-shadow: var(--shadow-md);
}

.print-preview-dialog::backdrop {
  background: rgba(3, 19, 31, 0.68);
  backdrop-filter: blur(2px);
}

.print-preview-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px 13px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.print-preview-head > div {
  min-width: 0;
  flex: 1;
}

.print-preview-head h2,
.print-preview-head p {
  margin: 0;
}

.print-preview-head h2 {
  color: var(--navy-900);
  font-size: 18px;
}

.print-preview-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.print-preview-close {
  width: 46px;
  min-width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy-700);
  background: #f3f6f5;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.print-preview-close svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.print-preview-stage {
  height: calc(100% - 148px);
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #dce3e3;
}

.print-preview-page {
  width: min(100%, 1050px);
  aspect-ratio: 194 / 281;
  flex: 0 0 auto;
  padding: 22px;
  overflow: hidden;
  color: #111;
  background: #fff;
  box-shadow: 0 5px 25px rgba(10, 36, 50, 0.2);
}

.print-preview-print-area {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.print-preview-document {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  transform-origin: left top;
  color: #111;
  background: #fff;
}

.print-preview-document .print-document-heading {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0d776d;
}

.print-preview-document .print-document-heading h1,
.print-preview-document .print-document-heading p {
  margin: 0;
}

.print-preview-document .print-document-heading h1 {
  color: #102f3d;
  font-size: 21px;
}

.print-preview-document .print-document-heading p {
  margin-top: 4px;
  color: #60747d;
  font-size: 10px;
}

.print-preview-document .print-document-heading .print-document-meta {
  color: #84959c;
  font-size: 9px;
}

.print-preview-document .print-control-value {
  min-height: 30px;
  padding: 7px 9px;
  border: 1px solid #d9e0e1;
  border-radius: 5px;
  color: #182f39;
  background: #fff;
  font-size: 11px;
  white-space: pre-wrap;
}

.print-preview-document .quick-time-actions,
.print-preview-document .print-hidden-summary,
.print-preview-document .toolbar,
.print-preview-document .content-heading-actions,
.print-preview-document .row-actions,
.print-preview-document .quick-actions,
.print-preview-document .notification-filters,
.print-preview-document .attachment-actions,
.print-preview-document .inline-form,
.print-preview-document button {
  display: none !important;
}

.print-preview-document .view {
  display: block !important;
  padding: 0 !important;
}

.print-preview-document .panel,
.print-preview-document .customer-card,
.print-preview-document .supplier-card,
.print-preview-document .visit-card,
.print-preview-document .sample-card {
  box-shadow: none;
}

.print-preview-document .sample-report-section {
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  box-shadow: none;
}

.print-preview-document .sample-report-banner {
  min-height: 54px;
  margin: 0 0 10px;
  padding: 10px 13px;
  border-radius: 6px;
}

.print-preview-document .sample-report-banner h3 { font-size: 15px; }
.print-preview-document .sample-report-banner-side { display: none; }
.print-preview-document .report-summary-strip { margin-bottom: 6px; }
.print-preview-document .report-summary-strip > div { padding: 5px 6px; }
.print-preview-document .report-core-fields { gap: 5px; padding: 6px; }
.print-preview-document .report-items-heading { margin: 9px 0 5px; }
.print-preview-document .report-items-table { overflow: visible; }
.print-preview-document .report-items-columns,
.print-preview-document .report-item-row {
  min-width: 0;
  grid-template-columns: 28px 1.15fr 1.35fr 1.15fr .72fr;
  gap: 4px;
}
.print-preview-document .report-items-columns { padding: 5px 6px; }
.print-preview-document .report-item-row { padding: 5px 6px; }
.print-preview-document .report-item-row .print-control-value {
  min-height: 23px;
  padding: 5px;
  font-size: 8px;
}
.print-preview-document .report-simple-cell small { font-size: 6px; }
.print-preview-document .report-conclusion-fields { margin-top: 8px; gap: 6px; }
.print-preview-document .report-more-disclosure { margin-top: 6px; border: 1px solid #d9e5e3; }
.print-preview-document .report-more-disclosure .disclosure-content { padding: 6px; }
.print-preview-document .report-issued-meta { margin-top: 7px; padding-top: 6px; }

.print-preview-actions {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.print-preview-status {
  min-width: 0;
  margin-right: auto;
}

.print-preview-status strong,
.print-preview-status span {
  display: block;
}

.print-preview-status strong {
  color: var(--teal-700);
  font-size: 13px;
}

.print-preview-status span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.attachment-preview-dialog {
  width: min(1180px, calc(100vw - 34px));
  height: min(880px, calc(100vh - 28px));
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 14px;
  background: #eef1f4;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .30);
}

.attachment-preview-dialog::backdrop {
  background: rgba(0, 0, 0, .34);
  backdrop-filter: blur(9px);
}

.attachment-preview-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px 12px;
  border-bottom: 1px solid rgba(60, 60, 67, .12);
  background: rgba(250, 250, 251, .96);
}

.attachment-preview-head > div { min-width: 0; flex: 1; }
.attachment-preview-head h2,
.attachment-preview-head p { margin: 0; }
.attachment-preview-head h2 {
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-preview-head p {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-close {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: rgba(118, 118, 128, .10);
  cursor: pointer;
}
.attachment-preview-close:hover { background: rgba(118, 118, 128, .18); }
.attachment-preview-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.attachment-preview-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(60, 60, 67, .10);
  background: rgba(246, 246, 248, .94);
}
.attachment-preview-toolbar[hidden] { display: none; }
.attachment-preview-scale {
  min-width: 52px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.attachment-preview-stage {
  position: relative;
  height: calc(100% - 146px);
  overflow: hidden;
  background-color: #dfe3e7;
  background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.22) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.22) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.22) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.attachment-preview-dialog.is-image .attachment-preview-stage { height: calc(100% - 194px); }
.attachment-preview-pdf-pages {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 24px;
  background: #dfe3e7;
}
.attachment-preview-pdf-pages[hidden],
.attachment-preview-image-stage[hidden] { display: none; }
.attachment-preview-pdf-page {
  position: relative;
  width: max-content;
  margin: 0 auto 22px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .22);
}
.attachment-preview-pdf-page:last-child { margin-bottom: 0; }
.attachment-preview-pdf-page canvas { display: block; max-width: none; background: #fff; }
.attachment-preview-pdf-page figcaption {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 10px;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  font-size: 9px;
}
.attachment-preview-image-stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 24px;
  text-align: center;
}
.attachment-preview-image {
  display: block;
  max-width: none;
  margin: 0 auto;
  transform-origin: top center;
  transition: width .14s ease, transform .14s ease;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 10px 35px rgba(0, 0, 0, .20);
}
.attachment-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  background: rgba(238, 241, 244, .92);
}
.attachment-preview-loading[hidden] { display: none; }
.attachment-preview-loading strong { color: var(--ink); font-size: 13px; }
.attachment-preview-loading small { font-size: 9px; }

.attachment-preview-actions {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px 18px;
  border-top: 1px solid rgba(60, 60, 67, .11);
  background: rgba(250, 250, 251, .98);
}
.attachment-preview-status { min-width: 0; margin-right: auto; }
.attachment-preview-status strong,
.attachment-preview-status span { display: block; }
.attachment-preview-status strong { color: #007aff; font-size: 13px; }
.attachment-preview-status span { margin-top: 2px; color: var(--muted); font-size: 9px; }

.dialog-body {
  min-height: 160px;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 14px 18px 17px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
  background: #fafcfc;
}

.dialog-actions .dialog-print {
  margin-right: auto;
}

.employee-contract-shortcut {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #b9ddd6;
  border-radius: 10px;
  background: var(--teal-50);
}

.employee-contract-shortcut strong,
.employee-contract-shortcut span {
  display: block;
}

.employee-contract-shortcut strong {
  color: var(--navy-900);
  font-size: 11px;
}

.employee-contract-shortcut span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.contract-period-list {
  display: grid;
  gap: 9px;
}

.contract-period-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(180px, 1.3fr) 34px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cfe1de;
  border-radius: 10px;
  background: #f8fbfb;
}

.contract-period-row .field {
  margin: 0;
}

.contract-period-remove {
  margin-bottom: 1px;
}

.dialog-section {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.dialog-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.dialog-section-title {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.dialog-section-title > div:first-child {
  min-width: 0;
  flex: 1 1 220px;
}

.compact-dialog-body .form-grid.two-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-dialog-body .dialog-section-title p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialog-disclosure {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #d7e4e2;
  border-radius: 10px;
  background: #fbfdfd;
}

.dialog-disclosure[open] {
  overflow: visible;
}

.dialog-disclosure > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  color: var(--navy-900);
  background: linear-gradient(90deg, #f8fbfb, #f1f7f6);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.dialog-disclosure > summary::-webkit-details-marker {
  display: none;
}

.dialog-disclosure > summary::after {
  content: "⌄";
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--teal-700);
  background: #e4f3f0;
  font-size: 15px;
  font-weight: 800;
  transition: transform .16s ease;
}

.dialog-disclosure[open] > summary::after {
  transform: rotate(180deg);
}

.dialog-disclosure > summary strong,
.dialog-disclosure > summary span {
  display: block;
}

.dialog-disclosure > summary strong {
  font-size: 11px;
}

.dialog-disclosure > summary span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 8px;
}

.dialog-disclosure[open] > summary {
  border-bottom: 1px solid #dce8e6;
  background: #f1f8f6;
}

.disclosure-content {
  padding: 11px 12px 12px;
  background: #fff;
}

.disclosure-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 9px;
}

.compact-field-disclosure .address-copy-action {
  grid-column: 1 / -1;
}

.compact-log-form {
  margin-top: 10px;
}

.sample-customer-more,
.sample-log-more {
  display: block;
  overflow: hidden;
  border: 1px solid #dce8e6;
  border-radius: 9px;
  background: #f8fbfb;
}

.sample-customer-more > summary,
.sample-log-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 39px;
  padding: 7px 10px;
  color: var(--navy-900);
  cursor: pointer;
  list-style: none;
}

.sample-customer-more > summary::-webkit-details-marker,
.sample-log-more > summary::-webkit-details-marker {
  display: none;
}

.sample-customer-more > summary::after,
.sample-log-more > summary::after {
  content: "展开";
  flex: 0 0 auto;
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 700;
}

.sample-customer-more[open] > summary::after,
.sample-log-more[open] > summary::after {
  content: "收起";
}

.sample-customer-more > summary strong,
.sample-customer-more > summary span,
.sample-log-more > summary strong,
.sample-log-more > summary span {
  display: block;
}

.sample-customer-more > summary strong,
.sample-log-more > summary strong {
  font-size: 10px;
}

.sample-customer-more > summary span,
.sample-log-more > summary span {
  margin-top: 1px;
  color: var(--subtle);
  font-size: 8px;
}

.sample-customer-more-grid,
.sample-log-more > .form-grid {
  padding: 10px;
  border-top: 1px solid #dce8e6;
  background: #fff;
}

.sample-log-editor {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d7e4e2;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdfd, #f6faf9);
}

.sample-log-editor-head strong,
.sample-log-editor-head span {
  display: block;
}

.sample-log-editor-head strong {
  color: var(--navy-900);
  font-size: 11px;
}

.sample-log-editor-head span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 8px;
}

.sample-log-edit-actions,
.sample-log-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sample-log-edit-actions {
  margin-top: 9px;
}

.sample-log-row {
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.sample-log-row:hover,
.sample-log-row:focus-visible {
  border-color: #9ed4cb;
  outline: 0;
  background: #f1faf8;
  box-shadow: 0 3px 12px rgba(7, 58, 68, .08);
}

.sample-log-open-label {
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 700;
}

.dialog-section-title h3,
.dialog-section-title p {
  margin: 0;
}

.dialog-section-title h3 {
  color: var(--navy-900);
  font-size: 12px;
}

.dialog-section-title p {
  margin-top: 1px;
  color: var(--subtle);
  font-size: 9px;
}

.steps-list,
.logs-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.step-row,
.log-row,
.history-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fafcfc;
}

.step-check {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--teal-600);
}

.step-copy,
.log-copy,
.history-copy {
  min-width: 0;
}

.step-copy strong,
.step-copy span,
.log-copy strong,
.log-copy span,
.history-copy strong,
.history-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-copy strong,
.log-copy strong,
.history-copy strong {
  font-size: 10px;
}

.step-copy span,
.log-copy span,
.history-copy span {
  margin-top: 1px;
  color: var(--subtle);
  font-size: 8px;
}

.inline-empty {
  padding: 13px;
  border: 1px dashed #d8e3e3;
  border-radius: 9px;
  color: var(--subtle);
  background: #fbfcfc;
  font-size: 10px;
  text-align: center;
}

.sample-hub-dialog-body {
  padding-top: 11px;
}

.sample-hub-dialog-body .sample-primary-section {
  padding: 11px 12px;
  border: 1px solid #dce8e6;
  border-radius: 11px;
  background: #fbfdfd;
}

.sample-hub-dialog-body .sample-main-fields {
  gap: 8px;
}

.sample-action-hub-section {
  margin-top: 10px;
  padding: 11px 12px 12px;
  border: 1px solid #cce2de;
  border-radius: 11px;
  background: linear-gradient(180deg, #fbfffe, #f5faf9);
}

.sample-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sample-action-tile {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #cfe2df;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: .15s ease;
}

.sample-action-tile:hover,
.sample-action-tile:focus-visible {
  border-color: #79c2b5;
  outline: 0;
  background: #f2fbf9;
  box-shadow: 0 4px 13px rgba(8, 78, 76, .09);
}

.sample-action-tile[aria-disabled="true"] {
  opacity: .58;
}

.sample-action-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #0c665c;
  background: #dff4ef;
  font-size: 15px;
  font-weight: 800;
}

.sample-action-icon.report { color: #815818; background: #fff0cf; }
.sample-action-icon.files { color: #305b86; background: #e5f0fa; }

.sample-action-tile > span:nth-child(2),
.sample-action-tile strong,
.sample-action-tile small {
  min-width: 0;
  display: block;
}

.sample-action-tile strong {
  overflow: hidden;
  color: var(--navy-900);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-action-tile small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-action-tile > b,
.sample-trial-tile > b {
  color: var(--teal-600);
  font-size: 19px;
  font-weight: 500;
}

.sample-trial-heading {
  margin: 11px 0 7px;
}

.sample-trial-heading h4,
.sample-trial-heading p {
  margin: 0;
}

.sample-trial-heading h4 { color: var(--navy-900); font-size: 11px; }
.sample-trial-heading p { margin-top: 1px; color: var(--subtle); font-size: 8px; }

.sample-trial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sample-trial-tile-wrap {
  position: relative;
  min-width: 0;
}

.sample-trial-tile {
  width: 100%;
  min-height: 61px;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto 12px;
  align-items: center;
  gap: 7px;
  padding: 8px 35px 8px 8px;
  border: 1px solid #d3e2e0;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.sample-trial-tile:hover { border-color: #83c6ba; background: #f4fbfa; }

.sample-trial-number {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  font-size: 11px;
  font-weight: 800;
}

.sample-trial-tile strong,
.sample-trial-tile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-trial-tile strong { color: var(--navy-900); font-size: 10px; }
.sample-trial-tile small { margin-top: 2px; color: var(--subtle); font-size: 7px; }
.sample-trial-tile .badge { font-size: 7px; }

.sample-trial-delete {
  position: absolute;
  z-index: 2;
  right: 7px;
  top: 7px;
  width: 25px;
  height: 25px;
}

.sample-trial-add {
  min-height: 61px;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  align-content: center;
  gap: 0 8px;
  padding: 8px 10px;
  border: 1px dashed #82bfb5;
  border-radius: 10px;
  color: var(--teal-700);
  background: #f2faf8;
  text-align: left;
  cursor: pointer;
}

.sample-trial-add > span { grid-row: 1 / 3; align-self: center; font-size: 24px; font-weight: 300; }
.sample-trial-add strong { font-size: 10px; }
.sample-trial-add small { color: var(--muted); font-size: 7px; }

.compact-sub-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.trial-entry-section {
  margin: 0;
  padding: 0;
  border: 0;
}

.trial-files-section {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid #d9e6e4;
  border-radius: 11px;
  background: #f9fcfb;
}

.sample-report-section {
  margin-top: 11px;
  padding: 12px;
  border: 1px solid #b8ded7;
  border-radius: 11px;
  background: linear-gradient(180deg, #fbfffe 0%, #f6fbfa 100%);
  box-shadow: 0 5px 16px rgba(17, 77, 75, 0.06);
}

.sample-report-banner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -12px -12px 9px;
  padding: 10px 12px;
  border-radius: 10px 10px 0 0;
  color: #fff;
  background: linear-gradient(128deg, #12384a 0%, #135f65 52%, #159281 100%);
}

.sample-report-banner h3,
.sample-report-banner p,
.report-items-heading h4,
.report-items-heading p {
  margin: 0;
}

.sample-report-banner h3 {
  margin-top: 1px;
  font-size: 15px;
  letter-spacing: .04em;
}

.sample-report-banner p {
  margin-top: 2px;
  color: rgba(255, 255, 255, .75);
  font-size: 9px;
}

.report-kicker {
  color: #8ce3d3;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .18em;
}

.sample-report-banner-side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.sample-report-banner-side > .badge {
  --badge-color: #d9fff7;
  --badge-bg: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .18);
}

.sample-report-actions {
  display: flex;
  gap: 7px;
}

.sample-report-actions .btn-secondary {
  color: #e8fffa;
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .09);
}

.sample-report-actions .btn-primary {
  color: #0b5b54;
  border-color: #fff;
  background: #fff;
}

.sample-report-actions .btn:disabled {
  color: rgba(255, 255, 255, .65);
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
}

.report-save-hint {
  max-width: 210px;
  color: rgba(255, 255, 255, .78);
  font-size: 9px;
  line-height: 1.5;
  text-align: right;
}

.report-summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid #d9e8e5;
  border-radius: 8px;
  background: #fff;
}

.report-summary-strip > div {
  min-width: 0;
  padding: 6px 7px;
  border-right: 1px solid #e5efed;
}

.report-summary-strip > div:last-child {
  border-right: 0;
}

.report-summary-strip span,
.report-summary-strip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-summary-strip span {
  color: var(--subtle);
  font-size: 7px;
}

.report-summary-strip strong {
  margin-top: 1px;
  color: var(--navy-900);
  font-size: 9px;
}

.report-auto-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 15px;
  border: 1px solid #d9e8e5;
  border-radius: 9px;
  background: #fff;
}

.report-auto-metadata > div {
  min-width: 0;
  padding: 9px 11px;
  border-right: 1px solid #e5efed;
  border-bottom: 1px solid #e5efed;
}

.report-auto-metadata > div:nth-child(3n) { border-right: 0; }
.report-auto-metadata > div:nth-last-child(-n + 3) { border-bottom: 0; }

.report-auto-metadata span,
.report-auto-metadata strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-auto-metadata span {
  color: var(--subtle);
  font-size: 8px;
}

.report-auto-metadata strong {
  margin-top: 2px;
  color: var(--navy-900);
  font-size: 10px;
}

.report-header-fields {
  padding: 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}

.report-core-fields {
  padding: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .74);
}

.report-items-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 9px 0 5px;
}

.report-items-heading h4 {
  color: var(--navy-900);
  font-size: 11px;
}

.report-items-heading p {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 8px;
}

.report-items-table {
  overflow-x: auto;
  padding-bottom: 2px;
}

.report-items-columns,
.report-item-row {
  min-width: 720px;
  display: grid;
  grid-template-columns: 32px 1.15fr 1.35fr 1.15fr .72fr 34px;
  align-items: center;
  gap: 5px;
}

.report-items-columns {
  padding: 5px 6px;
  color: #5f747c;
  background: #eaf4f2;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}

.report-item-row {
  padding: 5px 6px;
  border: 1px solid #e0eae8;
  border-top: 0;
  background: #fff;
}

.report-item-row:last-child {
  border-radius: 0 0 8px 8px;
}

.report-item-row input,
.report-item-row select {
  width: 100%;
  min-width: 0;
  height: 31px;
  padding: 0 6px;
  border: 1px solid #dbe6e4;
  border-radius: 6px;
  color: var(--ink);
  background: #fbfdfd;
  outline: 0;
  font-size: 9px;
}

.report-item-row input:focus,
.report-item-row select:focus {
  border-color: #80c9bd;
  box-shadow: 0 0 0 2px rgba(19, 146, 129, .12);
}

.report-item-index {
  color: var(--teal-700);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.report-simple-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-simple-cell small {
  overflow: hidden;
  color: var(--subtle);
  font-size: 7px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-item-delete {
  width: 32px;
  height: 32px;
}

.report-conclusion-fields {
  margin-top: 8px;
}

.report-more-disclosure {
  margin-top: 8px;
  border-color: #cde1dd;
}

.report-issued-meta {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #bfd6d2;
  color: var(--teal-700);
  font-size: 9px;
  text-align: right;
}

.attachment-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 300px;
  flex-wrap: wrap;
  gap: 7px;
}

.dialog-disclosure .attachment-actions {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.attachment-actions select {
  height: 35px;
  max-width: 180px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 10px;
}

.sample-file-manager {
  min-width: 0;
}

.sample-file-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.sample-file-button {
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-content: center;
  gap: 0 10px;
  padding: 10px 12px;
  border: 1px solid #bddbd5;
  border-radius: 11px;
  color: var(--navy-900);
  background: linear-gradient(145deg, #fff, #edf9f6);
  text-align: left;
  cursor: pointer;
  transition: .15s ease;
}

.sample-file-button.report {
  border-color: #e4d2aa;
  background: linear-gradient(145deg, #fff, #fff8e9);
}

.sample-file-button:hover,
.sample-file-button:focus-visible {
  transform: translateY(-1px);
  outline: 0;
  box-shadow: 0 5px 16px rgba(9, 66, 70, .1);
}

.sample-file-button > span {
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #1eb19d, #0c7067);
  font-size: 15px;
  font-weight: 800;
}

.sample-file-button.report > span {
  background: linear-gradient(145deg, #d9a646, #9c6d1b);
}

.sample-file-button strong,
.sample-file-button small { display: block; min-width: 0; }
.sample-file-button strong { align-self: end; font-size: 12px; }
.sample-file-button small { align-self: start; margin-top: 2px; color: var(--muted); font-size: 8px; }

.sample-file-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--subtle);
  font-size: 8px;
}

.sample-file-count strong {
  color: var(--navy-800);
  font-size: 10px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.attachment-row {
  min-height: 53px;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fafcfc;
}

.attachment-type {
  width: 39px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 8px;
  font-weight: 800;
}

.attachment-copy {
  min-width: 0;
}

.attachment-copy strong,
.attachment-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-copy strong {
  color: var(--ink);
  font-size: 10px;
}

.attachment-copy span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 8px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 92px auto;
  gap: 7px;
  margin-top: 8px;
}

.inline-form input,
.inline-form select {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  font-size: 10px;
}

.inline-form .btn {
  min-height: 34px;
  padding: 0 11px;
  font-size: 10px;
}

.confirm-dialog {
  position: relative;
  width: min(390px, calc(100vw - 40px));
  padding: 25px 27px 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.confirm-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 19px;
  font-weight: 800;
}

.confirm-dialog h2,
.confirm-dialog p {
  margin: 0;
}

.confirm-dialog h2 {
  color: var(--navy-900);
  font-size: 17px;
}

.confirm-dialog p {
  margin: 7px 0 19px;
  color: var(--muted);
  font-size: 11px;
}

.confirm-dialog .dialog-actions {
  margin: 0 -27px;
  border-radius: 0 0 16px 16px;
}

.dialog-x-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy-700);
  background: #f4f7f7;
  cursor: pointer;
}

.dialog-x-button:hover {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.dialog-x-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  pointer-events: none;
}

.password-dialog {
  position: relative;
  width: min(420px, calc(100vw - 40px));
  padding: 27px 29px 0;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.password-dialog h2,
.password-dialog p {
  margin: 0;
}

.password-dialog h2 {
  color: var(--navy-900);
  font-size: 17px;
}

.password-dialog > p:not(.password-error) {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

#delete-password-message {
  white-space: pre-line;
}

.password-dialog .lock-icon {
  color: var(--navy-700);
  background: #e9f3f8;
  font-size: 13px;
}

.password-entry {
  text-align: left;
}

.password-error {
  margin: 7px 0 0 !important;
  color: var(--danger);
  font-size: 10px;
  text-align: left;
}

.password-dialog .dialog-actions {
  margin: 20px -29px 0;
  border-radius: 0 0 16px 16px;
}

.after-sale-table {
  min-width: 1120px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  width: min(350px, calc(100vw - 44px));
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.dialog-toast-region {
  position: absolute;
  z-index: 120;
  top: 12px;
  right: 12px;
  width: min(350px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.dialog-toast-region .toast {
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

.toast {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 13px;
  border: 1px solid #cfe2de;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.22s ease both;
}

.toast.is-leaving {
  animation: toast-out 0.18s ease both;
}

.toast-symbol {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.toast.is-error {
  border-color: #efd0d0;
}

.toast.is-error .toast-symbol {
  background: var(--danger);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 11px;
}

.toast span {
  color: var(--muted);
  font-size: 9px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(7px); }
}

.loading-shell {
  position: fixed;
  z-index: 90;
  inset: 66px 0 0 var(--sidebar-width);
  display: grid;
  place-items: center;
  background: rgba(243, 246, 245, 0.86);
  backdrop-filter: blur(2px);
}

.loading-box {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 9px;
  border: 3px solid #d8e5e4;
  border-top-color: var(--teal-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 小字号增强：保持紧凑尺寸，同时提高中文细字的清晰度。 */
small,
.brand span,
.sidebar-foot span,
.titlebar p,
.date-chip,
.toolbar-count,
.inline-filter,
.toolbar-note,
.field-hint,
.data-folder-path,
.data-folder-note,
.backup-note,
.last-backup,
.dialog-head p,
.print-preview-head p,
.dialog-kicker,
.table-progress span,
.date-cell,
.badge,
.toast span,
.loading-box {
  font-weight: 600;
}

.data-table th,
.field > span,
.field > span small,
.address-grid label > small,
.quick-time-button,
.quick-action-button,
.filter-pill,
.inline-link-button,
.text-btn {
  font-weight: 700;
}

/* 全局立体按钮：高光上沿、实体下沿和明确的按压反馈。 */
button {
  --control-edge: rgba(18, 55, 72, 0.22);
  --control-shadow: rgba(9, 40, 57, 0.14);
  border: 1px solid #b9c9cd;
  border-bottom-color: #91a7ad;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7f7 46%, #e4ecec 100%);
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(20, 58, 74, 0.07),
    0 2px 0 var(--control-edge),
    0 5px 10px var(--control-shadow);
  transition:
    transform 0.12s ease,
    filter 0.14s ease,
    color 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

button:not(:disabled):not([aria-disabled="true"]):hover {
  transform: translateY(-1px);
  filter: brightness(1.025) saturate(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(20, 58, 74, 0.08),
    0 3px 0 var(--control-edge),
    0 7px 14px var(--control-shadow);
}

button:not(:disabled):not([aria-disabled="true"]):active {
  transform: translateY(2px);
  filter: brightness(0.98);
  box-shadow:
    inset 0 2px 4px rgba(8, 37, 52, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 0 var(--control-edge),
    0 2px 5px var(--control-shadow);
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  filter: grayscale(0.18);
  opacity: 0.58;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 0 rgba(17, 52, 69, 0.12);
}

.btn-primary,
.quick-action-button,
.quick-time-button.is-selected {
  --control-edge: #06655c;
  --control-shadow: rgba(7, 104, 94, 0.24);
  border-color: #08776c;
  border-bottom-color: #045b53;
  background: linear-gradient(180deg, #19b7a2 0%, #0b9484 48%, #077a6f 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(4, 66, 60, 0.65);
}

.btn-secondary,
.quick-time-button,
.filter-pill,
.month-step-button,
.icon-button,
.text-btn,
.inline-link-button,
.dialog-close,
.sample-sub-close,
.print-preview-close,
.dialog-x-button,
.mobile-menu {
  --control-edge: rgba(20, 57, 74, 0.2);
  --control-shadow: rgba(12, 43, 59, 0.13);
  border-color: #bdcdd1;
  border-bottom-color: #92a8ae;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7f7 46%, #e3ebeb 100%);
}

.btn-danger,
.icon-button.delete:hover,
.dialog-x-button:hover,
.window-controls button.danger:hover {
  --control-edge: #873434;
  --control-shadow: rgba(154, 49, 49, 0.24);
  border-color: #b94343;
  border-bottom-color: #873434;
  background: linear-gradient(180deg, #e96c6c 0%, #ca4d4d 50%, #ab3d3d 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(91, 27, 27, 0.55);
}

.btn-soft,
.welcome-card .btn-soft {
  --control-edge: rgba(2, 30, 46, 0.42);
  --control-shadow: rgba(2, 24, 38, 0.24);
  border-color: rgba(220, 249, 244, 0.42);
  border-bottom-color: rgba(2, 37, 52, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
}

.welcome-card .btn-primary {
  --control-edge: #168d79;
  --control-shadow: rgba(2, 26, 39, 0.28);
  border-color: #7ce3cf;
  border-bottom-color: #168d79;
  background: linear-gradient(180deg, #76e2cd 0%, #4ed0b7 55%, #2eb49d 100%);
  color: var(--navy-950);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.nav-item {
  --control-edge: rgba(1, 20, 32, 0.48);
  --control-shadow: rgba(1, 19, 30, 0.2);
  border: 1px solid rgba(191, 221, 232, 0.12);
  border-bottom-color: rgba(1, 18, 30, 0.62);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    0 2px 0 var(--control-edge),
    0 4px 8px var(--control-shadow);
}

.nav-item:hover {
  border-color: rgba(138, 226, 210, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(24, 131, 124, 0.1));
}

.nav-item.is-active {
  --control-edge: rgba(4, 67, 63, 0.82);
  border-color: rgba(93, 218, 195, 0.38);
  border-bottom-color: rgba(4, 67, 63, 0.9);
  background: linear-gradient(180deg, rgba(35, 185, 164, 0.43), rgba(10, 105, 101, 0.28));
}

.window-controls button {
  --control-edge: rgba(17, 51, 68, 0.18);
  --control-shadow: rgba(10, 38, 54, 0.1);
  border: 1px solid #c7d4d7;
  border-bottom-color: #9caeb3;
  background: linear-gradient(180deg, #fff, #e8efef);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 0 var(--control-edge),
    0 4px 7px var(--control-shadow);
}

.employee-submodule-tab,
.customer-submodule-tab,
.sample-action-tile,
.sample-trial-tile,
.sample-trial-add,
.sample-file-button {
  --control-edge: rgba(22, 66, 79, 0.2);
  --control-shadow: rgba(9, 55, 65, 0.13);
  border-bottom-color: #91aaa7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 46%, #e9f2f0 100%);
}

.employee-submodule-tab.is-active,
.customer-submodule-tab.is-active {
  --control-edge: #08766b;
  --control-shadow: rgba(7, 104, 94, 0.18);
  border-color: #69b9ab;
  border-bottom-color: #08766b;
  background: linear-gradient(180deg, #f5fffc 0%, #dbf3ee 55%, #c3e8e0 100%);
}

.sample-trial-add {
  border-style: solid;
  border-color: #7ebeb3;
  border-bottom-color: #4c9388;
  background: linear-gradient(180deg, #fbfffe 0%, #e9f7f4 48%, #d5ece7 100%);
}

.sample-file-button.report {
  --control-edge: rgba(121, 83, 21, 0.28);
  --control-shadow: rgba(116, 77, 18, 0.13);
  border-color: #dec58e;
  border-bottom-color: #b79249;
  background: linear-gradient(180deg, #fffdf8 0%, #fff7e6 48%, #f4e5c5 100%);
}

/* macOS-inspired productivity theme — calm hierarchy, translucent navigation and flat controls. */
:root {
  --navy-950: #1d1d1f;
  --navy-900: #1d1d1f;
  --navy-800: #2c2c2e;
  --navy-700: #3a3a3c;
  --teal-700: #006edb;
  --teal-600: #007aff;
  --teal-500: #0a84ff;
  --teal-100: #dbeeff;
  --teal-50: #eef6ff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --subtle: #8e8e93;
  --line: rgba(60, 60, 67, .16);
  --line-soft: rgba(60, 60, 67, .10);
  --canvas: #f5f5f7;
  --surface: rgba(255, 255, 255, .92);
  --warning: #ff9f0a;
  --warning-soft: #fff4df;
  --danger: #ff3b30;
  --danger-soft: #ffebe9;
  --success: #34c759;
  --success-soft: #e8f8ec;
  --blue: #007aff;
  --blue-soft: #e8f3ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .025), 0 7px 22px rgba(0, 0, 0, .035);
  --shadow-md: 0 24px 70px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-width: 232px;
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  background: var(--canvas);
}

body {
  color: var(--ink);
  background: radial-gradient(circle at 75% -25%, rgba(0, 122, 255, .055), transparent 38%), var(--canvas);
  font-weight: 400;
}

button {
  --control-edge: transparent;
  --control-shadow: transparent;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 500;
  box-shadow: none;
  text-shadow: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease, opacity .16s ease, transform .12s ease;
}

button:not(:disabled):not([aria-disabled="true"]):hover {
  transform: none;
  filter: none;
  box-shadow: none;
}

button:not(:disabled):not([aria-disabled="true"]):active {
  transform: scale(.985);
  filter: none;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .22);
  outline-offset: 1px;
}

.sidebar {
  padding: 0 10px 14px;
  color: var(--ink);
  border-right: 1px solid rgba(60, 60, 67, .12);
  background: rgba(235, 235, 240, .76);
  box-shadow: none;
  backdrop-filter: blur(28px) saturate(150%);
}

.brand {
  height: 72px;
  gap: 10px;
  padding: 4px 9px 8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .13);
}

.brand strong {
  color: var(--ink);
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.01em;
  text-shadow: none;
  -webkit-text-fill-color: currentColor;
  background: none;
}

.brand span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
}

.nav-list {
  gap: 2px;
  padding: 0 0 8px;
  border-top: 0;
}

.nav-section-label {
  display: block;
  flex: 0 0 auto;
  padding: 12px 10px 3px;
  color: #7b7b80;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .01em;
}

.nav-item,
.nav-item:hover,
.nav-item.is-active {
  --control-edge: transparent;
  --control-shadow: transparent;
  height: 34px;
  flex-basis: 34px;
  gap: 9px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #333336;
  background: transparent;
  box-shadow: none;
}

.nav-item::before { display: none; }
.nav-item:hover { background: rgba(120, 120, 128, .10); }
.nav-item.is-active { color: #1d1d1f; background: rgba(0, 122, 255, .14); }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.75; }
.nav-item.is-active svg { color: #007aff; }
.nav-item span { font-size: 12px; font-weight: 450; }
.nav-item em {
  min-width: 18px;
  height: 18px;
  color: #fff;
  background: #ff453a;
  font-size: 9px;
}

.sidebar-foot {
  margin: auto 5px 0;
  padding: 11px 8px 2px;
  border-top: 1px solid rgba(60, 60, 67, .12);
}
.sidebar-foot strong { color: #3a3a3c; font-weight: 500; }
.sidebar-foot span { color: #8e8e93; font-weight: 400; }
.safety-dot { background: #34c759; box-shadow: 0 0 0 5px rgba(52, 199, 89, .11); }

.titlebar {
  height: 62px;
  flex-basis: 62px;
  padding: 0 22px 0 24px;
  border-bottom: 1px solid rgba(60, 60, 67, .11);
  background: rgba(250, 250, 252, .78);
  backdrop-filter: blur(24px) saturate(150%);
}

.titlebar h1 { color: var(--ink); font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
.titlebar p { margin-top: 1px; color: var(--subtle); font-size: 10px; font-weight: 400; }
.titlebar-side { gap: 10px; }
.date-chip {
  padding: 5px 9px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 400;
}

.global-search-wrap {
  position: relative;
  z-index: 90;
}

.global-search {
  width: 182px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(60, 60, 67, .13);
  border-radius: 8px;
  color: #8e8e93;
  background: rgba(118, 118, 128, .07);
}
.global-search svg { width: 14px; height: 14px; }
.global-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--muted); background: transparent; font-size: 11px; }
.global-search:focus-within {
  border-color: rgba(0, 122, 255, .42);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .1);
}

.global-search-panel {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  width: min(430px, calc(100vw - 36px));
  max-height: min(540px, calc(100vh - 92px));
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, .18);
  border-radius: 13px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 22px 60px rgba(13, 32, 45, .22), 0 2px 8px rgba(13, 32, 45, .08);
  backdrop-filter: blur(28px) saturate(170%);
  transform: translateX(-50%);
}

.global-search-hint {
  padding: 11px 13px 8px;
  border-bottom: 1px solid rgba(60, 60, 67, .08);
  color: var(--subtle);
  font-size: 9px;
}

.global-search-results {
  max-height: min(486px, calc(100vh - 142px));
  overflow: auto;
  padding: 6px;
}

.global-search-result {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  text-align: left;
  background: transparent;
}

.global-search-result:hover,
.global-search-result.is-selected {
  background: rgba(0, 122, 255, .09);
}

.global-search-symbol {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #166bb8;
  background: #eaf3fc;
  font-size: 12px;
  font-weight: 700;
}

.global-search-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.global-search-copy strong,
.global-search-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-copy strong { color: var(--ink); font-size: 11px; }
.global-search-copy small { color: var(--muted); font-size: 9px; }
.global-search-result em {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(118, 118, 128, .08);
  font-size: 8px;
  font-style: normal;
}

.global-search-empty {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 18px;
  color: var(--subtle);
  font-size: 9px;
  text-align: center;
}

.global-search-empty strong,
.global-search-empty span { display: block; }
.global-search-empty kbd {
  min-width: 23px;
  padding: 2px 5px;
  border: 1px solid rgba(60, 60, 67, .18);
  border-radius: 5px;
  color: var(--muted);
  background: #f7f7f8;
  box-shadow: 0 1px 0 rgba(60, 60, 67, .12);
  font-family: inherit;
  font-size: 8px;
}

.windows-titlebar-controls {
  height: 62px;
  display: flex;
  align-items: stretch;
  margin: 0 -22px 0 4px;
}
.windows-titlebar-controls button {
  width: 46px;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #3a3a3c;
  background: transparent;
}
.windows-titlebar-controls button:hover { color: #1d1d1f; background: rgba(60, 60, 67, .09); }
.windows-titlebar-controls .windows-close:hover { color: #fff; background: #e81123; }
.windows-titlebar-controls svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1; }
.windows-titlebar-controls .windows-close svg { stroke-width: 1.15; }
.windows-titlebar-controls .window-icon-restore { display: none; }
.windows-titlebar-controls #window-maximize.is-maximized .window-icon-maximize { display: none; }
.windows-titlebar-controls #window-maximize.is-maximized .window-icon-restore { display: block; }

.main-content { background: transparent; }
.view { max-width: 1500px; margin: 0 auto; padding: 26px 30px 38px; }

.welcome-card {
  min-height: 112px;
  justify-content: flex-start;
  gap: 18px;
  overflow: visible;
  padding: 19px 22px;
  border: 1px solid rgba(60, 60, 67, .10);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}
.welcome-card::after { display: none; }
.welcome-copy { min-width: 250px; flex: 1; }
.eyebrow { margin-bottom: 1px; color: #007aff; font-size: 10px; font-weight: 600; letter-spacing: .03em; }
.welcome-card h2 { color: var(--ink); font-size: clamp(18px, 1.8vw, 23px); font-weight: 650; letter-spacing: -.025em; }
.welcome-card p { margin-top: 5px; color: var(--muted); font-size: 11px; }

.dashboard-new-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 13px;
  border-radius: 8px;
  color: #fff;
  background: #007aff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-new-button:hover { background: #0873df; }
.dashboard-new-button span { font-size: 16px; font-weight: 400; }

.quick-actions {
  max-width: 380px;
  justify-content: flex-end;
  gap: 5px;
}
.btn,
.btn-secondary,
.btn-soft,
.welcome-card .btn-soft,
.quick-action-button,
.quick-time-button,
.filter-pill,
.month-step-button,
.icon-button,
.text-btn,
.inline-link-button,
.dialog-close,
.sample-sub-close,
.print-preview-close,
.dialog-x-button,
.mobile-menu {
  --control-edge: transparent;
  --control-shadow: transparent;
  min-height: 34px;
  border: 1px solid rgba(60, 60, 67, .14);
  border-bottom-color: rgba(60, 60, 67, .14);
  border-radius: 8px;
  color: #343436;
  background: rgba(118, 118, 128, .075);
  box-shadow: none;
  text-shadow: none;
  font-weight: 500;
}
.btn:hover,
.btn-secondary:hover,
.btn-soft:hover,
.welcome-card .btn-soft:hover { background: rgba(118, 118, 128, .13); border-color: rgba(60, 60, 67, .18); }
.welcome-card .btn-soft { min-height: 28px; padding: 0 9px; border: 0; color: #55555a; background: rgba(118, 118, 128, .08); font-size: 10px; }
.welcome-card .btn-soft span { color: #007aff; }
.btn-primary,
.welcome-card .btn-primary,
.quick-action-button,
.quick-time-button.is-selected {
  --control-edge: transparent;
  --control-shadow: transparent;
  border-color: #007aff;
  color: #fff;
  background: #007aff;
  box-shadow: none;
  text-shadow: none;
}
.btn-primary:hover { background: #0873df; border-color: #0873df; box-shadow: none; }
.btn-danger,
.icon-button.delete:hover,
.dialog-x-button:hover {
  border-color: #ff3b30;
  color: #fff;
  background: #ff3b30;
  box-shadow: none;
  text-shadow: none;
}

.stat-grid { gap: 10px; margin-top: 12px; }
.stat-card {
  min-height: 90px;
  padding: 13px 14px;
  border-color: rgba(60, 60, 67, .095);
  border-radius: 12px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-sm);
}
.stat-card::after { display: none; }
.stat-top { color: var(--muted); font-size: 10px; }
.stat-icon { width: 25px; height: 25px; border-radius: 7px; color: var(--stat-color, #007aff); background: color-mix(in srgb, var(--stat-soft, #e8f3ff) 75%, white); font-size: 11px; }
.stat-value { margin-top: 6px; color: var(--ink); font-size: 23px; font-weight: 650; letter-spacing: -.025em; }
.stat-hint { margin-top: 3px; color: var(--subtle); font-size: 9px; }

.dashboard-grid { gap: 11px; margin-top: 11px; }
.panel,
.customer-card,
.supplier-card {
  border-color: rgba(60, 60, 67, .10);
  border-radius: 12px;
  background: rgba(255, 255, 255, .90);
  box-shadow: var(--shadow-sm);
}
.dashboard-grid > .panel { min-height: 245px; padding: 17px 18px; }
.panel-head { margin-bottom: 11px; }
.panel-head h3 { color: var(--ink); font-size: 14px; font-weight: 600; }
.section-kicker { color: #8e8e93; font-size: 8px; font-weight: 600; letter-spacing: .12em; }
.text-btn { min-height: 0; padding: 2px 4px; border: 0; color: #007aff; background: transparent; font-size: 10px; }

.content-heading { min-height: 53px; margin-bottom: 13px; }
.content-heading h2 { color: var(--ink); font-size: 21px; font-weight: 650; letter-spacing: -.025em; }
.content-heading p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.toolbar { min-height: 54px; margin-bottom: 10px; padding: 8px 10px; }
.search-box { height: 34px; border-color: rgba(60, 60, 67, .14); border-radius: 8px; background: rgba(118, 118, 128, .065); }
.search-box:focus-within { border-color: #007aff; box-shadow: 0 0 0 3px rgba(0, 122, 255, .13); }
.toolbar select { height: 34px; border-color: rgba(60, 60, 67, .14); background: rgba(255, 255, 255, .9); }

.data-panel { border-radius: 12px; }
.data-table th { height: 38px; border-bottom-color: rgba(60, 60, 67, .12); color: #76767b; background: rgba(246, 246, 248, .88); font-weight: 600; letter-spacing: 0; }
.data-table td { height: 62px; border-bottom-color: rgba(60, 60, 67, .08); }
.data-table tbody tr:hover { background: rgba(0, 122, 255, .035); }
.card-list, .customer-grid, .supplier-grid { gap: 10px; }
.customer-card, .supplier-card { padding: 15px 16px; }
.customer-avatar, .supplier-avatar { border-radius: 10px; color: #007aff; background: #edf5ff; }

.field select,
.field input,
.field textarea {
  border-color: rgba(60, 60, 67, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .94);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .025);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: #007aff; box-shadow: 0 0 0 3px rgba(0, 122, 255, .12); }

dialog::backdrop { background: rgba(0, 0, 0, .28); backdrop-filter: blur(8px); }
.editor-dialog,
.sample-sub-dialog > form,
.confirm-dialog,
.password-dialog {
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 14px;
  background: rgba(252, 252, 253, .97);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(28px);
}
.sample-sub-dialog { background: rgba(0, 0, 0, .28); backdrop-filter: blur(8px); }
.dialog-head { padding: 14px 18px 11px; border-bottom-color: rgba(60, 60, 67, .11); background: rgba(248, 248, 250, .76); }
.dialog-head h2 { color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.dialog-kicker { color: #007aff; font-weight: 600; }
.dialog-close,
.sample-sub-close,
.dialog-x-button { width: 32px; min-width: 32px; height: 32px; border: 0; border-radius: 7px; background: rgba(118, 118, 128, .10); }
.dialog-close svg,
.sample-sub-close svg,
.dialog-x-button svg { width: 15px; height: 15px; }
.dialog-actions { border-top-color: rgba(60, 60, 67, .11); background: rgba(246, 246, 248, .86); }
.dialog-disclosure { border-color: rgba(60, 60, 67, .13); border-radius: 9px; background: rgba(255, 255, 255, .7); }
.dialog-disclosure > summary { color: var(--ink); background: rgba(118, 118, 128, .055); }
.dialog-disclosure > summary::after { color: #007aff; background: rgba(0, 122, 255, .09); }
.dialog-disclosure[open] > summary { border-bottom-color: rgba(60, 60, 67, .1); background: rgba(0, 122, 255, .045); }
.toast { border-color: rgba(60, 60, 67, .12); border-radius: 12px; background: rgba(255, 255, 255, .94); box-shadow: 0 16px 45px rgba(0, 0, 0, .16); backdrop-filter: blur(18px); }
.loading-shell { background: rgba(245, 245, 247, .75); backdrop-filter: blur(10px); }
.spinner { border-color: #d9d9dd; border-top-color: #007aff; }

.employee-submodule-tab,
.customer-submodule-tab,
.sample-action-tile,
.sample-trial-tile,
.sample-trial-add,
.sample-file-button,
.sample-file-button.report {
  --control-edge: transparent;
  --control-shadow: transparent;
  border: 1px solid rgba(60, 60, 67, .13);
  border-bottom-color: rgba(60, 60, 67, .13);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, .74);
  box-shadow: none;
  text-shadow: none;
}
.employee-submodule-tab:hover,
.customer-submodule-tab:hover,
.sample-action-tile:hover,
.sample-trial-tile:hover,
.sample-trial-add:hover,
.sample-file-button:hover { border-color: rgba(0, 122, 255, .32); background: rgba(0, 122, 255, .045); }
.employee-submodule-tab.is-active,
.customer-submodule-tab.is-active {
  border-color: rgba(0, 122, 255, .28);
  background: rgba(0, 122, 255, .09);
  box-shadow: none;
}
.sample-trial-add { border-style: dashed; border-color: rgba(0, 122, 255, .45); color: #007aff; background: rgba(0, 122, 255, .035); }
.sample-file-button.report { background: rgba(255, 159, 10, .045); }

@media (max-width: 1260px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .sample-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-card { align-items: flex-start; flex-direction: column; }
  .quick-actions { justify-content: flex-start; }
  .payroll-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  :root { --sidebar-width: 210px; }
  .view { padding-left: 20px; padding-right: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .panel { min-height: 230px; }
  .settings-layout { grid-template-columns: 1fr; }
  .card-list { grid-template-columns: 1fr; }
  .customer-grid, .supplier-grid { grid-template-columns: 1fr; }
  .summary-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-chip { display: none; }
}

@media (max-width: 900px) {
  body { min-width: 640px; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .mobile-menu { display: grid; }
  .loading-shell { left: 0; }
  .sample-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-box { max-width: none; flex-basis: 100%; }
  .toolbar-count { align-self: center; }
  .upcoming-item { grid-template-columns: 42px 94px minmax(160px, 1fr) auto; }
  .upcoming-status { display: none; }
  .summary-period-label { width: 100%; margin-left: 0; }
  .address-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .address-grid label:nth-child(4),
  .address-grid label:nth-child(5) { grid-column: span 3; }
  .form-grid.four-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-dialog-body .form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-action-grid,
  .sample-trial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payroll-dialog-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-period-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 34px; }
  .contract-period-notes { grid-column: span 2; }
}

@media (max-width: 720px) {
  .date-chip { display: none; }
  .global-search { width: 154px; }
  .view { padding: 18px 15px 28px; }
  .titlebar { padding-left: 14px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .form-grid.two-cols,
  .form-grid.three-cols,
  .form-grid.four-cols { grid-template-columns: 1fr; }
  .compact-dialog-body .form-grid.two-cols { grid-template-columns: 1fr; }
  .sample-action-grid,
  .sample-trial-grid,
  .sample-file-buttons,
  .compact-sub-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .content-heading { align-items: stretch; flex-direction: column; }
  .content-heading-actions { justify-content: flex-start; }
  .upcoming-item { grid-template-columns: 38px 84px minmax(130px, 1fr) auto; gap: 9px; padding: 12px; }
  .upcoming-item .quick-action-button { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .summary-stat-grid { grid-template-columns: 1fr 1fr; }
  .summary-item { grid-template-columns: 38px minmax(0, 1fr) 86px; }
  .summary-item > .icon-button { display: none; }
  .address-grid { grid-template-columns: 1fr; }
  .address-grid label:nth-child(4),
  .address-grid label:nth-child(5) { grid-column: auto; }
  .contract-period-row { grid-template-columns: 1fr 34px; }
  .contract-period-row .field,
  .contract-period-notes { grid-column: 1; }
  .contract-period-remove { grid-column: 2; grid-row: 1; }
  .employee-submodule-tabs,
  .customer-submodule-tabs,
  .payroll-summary-grid,
  .payroll-dialog-summary { grid-template-columns: 1fr; }
  .submodule-heading,
  .payroll-batch-bar { align-items: stretch; flex-direction: column; }
  .payroll-month-control { width: 100%; }
  .payroll-month-control input { flex: 1; }
  .sample-report-banner { align-items: flex-start; flex-direction: column; }
  .sample-report-banner-side { width: 100%; align-items: flex-start; }
  .report-save-hint { max-width: none; text-align: left; }
  .report-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary-strip > div { border-right: 1px solid #e5efed; border-bottom: 1px solid #e5efed; }
  .report-summary-strip > div:nth-child(2n) { border-right: 0; }
  .report-summary-strip > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .report-items-heading { align-items: flex-start; flex-direction: column; }
}

@media print {
  @page { margin: 8mm; size: A4 portrait; }
  html,
  body,
  .app-shell,
  .workspace,
  .main-content {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }
  body {
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sidebar,
  .titlebar,
  .sidebar-backdrop,
  .toast-region,
  .toolbar,
  .content-heading-actions,
  .row-actions,
  .quick-actions,
  .window-controls,
  .notification-filters,
  .btn,
  .icon-button,
  .inline-link-button {
    display: none !important;
  }
  .view {
    display: none !important;
    padding: 0 !important;
  }
  .view.is-active {
    display: block !important;
  }
  .panel,
  .customer-card,
  .supplier-card,
  .visit-card,
  .sample-card {
    break-inside: avoid;
    box-shadow: none !important;
  }
  .table-wrap {
    overflow: visible !important;
  }
  .data-table,
  .purchase-table {
    min-width: 0 !important;
    font-size: 9px;
  }
  body.printing-dialog .workspace,
  body.printing-dialog .sidebar {
    display: none !important;
  }
  body.printing-dialog #editor-dialog {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  body.printing-dialog #editor-dialog::backdrop,
  body.printing-dialog .dialog-actions,
  body.printing-dialog .dialog-close,
  body.printing-dialog .attachment-actions,
  body.printing-dialog .inline-form {
    display: none !important;
  }
  body.printing-dialog .dialog-body {
    max-height: none !important;
    overflow: visible !important;
  }

  body.printing-preview {
    width: 194mm !important;
    height: 281mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  body.printing-preview > *:not(#print-preview-dialog) {
    display: none !important;
  }
  body.printing-preview #print-preview-dialog {
    position: static !important;
    inset: auto !important;
    width: 194mm !important;
    height: 281mm !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  body.printing-preview #print-preview-dialog::backdrop,
  body.printing-preview .print-preview-head,
  body.printing-preview .print-preview-actions {
    display: none !important;
  }
  body.printing-preview .print-preview-stage {
    width: 194mm !important;
    height: 281mm !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
  }
  body.printing-preview .print-preview-page {
    width: 194mm !important;
    height: 281mm !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 6mm !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }
  body.printing-preview .print-preview-print-area {
    width: 182mm !important;
    height: 269mm !important;
    overflow: hidden !important;
  }
  body.printing-preview #print-preview-document .view {
    display: block !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Equipment, parts, inventory and supplier-price linkage */
.inventory-submodule-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px;
  background: #eef4f4;
}
.inventory-submodule-tab {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}
.inventory-submodule-tab > span {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--teal-700);
  background: rgba(255, 255, 255, .7);
  font-size: 13px;
  font-weight: 800;
}
.inventory-submodule-tab strong { align-self: end; color: var(--navy-800); font-size: 12px; }
.inventory-submodule-tab small { align-self: start; margin-top: 2px; color: var(--subtle); font-size: 9px; }
.inventory-submodule-tab:hover { color: var(--teal-700); background: rgba(255, 255, 255, .55); }
.inventory-submodule-tab.is-active { border-color: #c8dddd; background: #fff; box-shadow: var(--shadow-sm); }
.inventory-submodule-tab.is-active > span { color: #fff; background: linear-gradient(145deg, var(--teal-500), var(--teal-700)); box-shadow: 0 5px 12px rgba(11, 116, 104, .2); }
.inventory-submodule-panel { min-width: 0; }
.equipment-summary-grid,
.inventory-summary-grid,
.production-plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.equipment-summary-grid article,
.inventory-summary-grid article,
.production-plan-summary-grid article {
  min-height: 78px;
  padding: 13px 15px;
  border: 1px solid rgba(60, 60, 67, .11);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .035);
}
.equipment-summary-grid span,
.equipment-summary-grid strong,
.equipment-summary-grid small,
.inventory-summary-grid span,
.inventory-summary-grid strong,
.inventory-summary-grid small,
.production-plan-summary-grid span,
.production-plan-summary-grid strong,
.production-plan-summary-grid small { display: block; }
.equipment-summary-grid span,
.inventory-summary-grid span,
.production-plan-summary-grid span { color: var(--muted); font-size: 10px; }
.equipment-summary-grid strong,
.inventory-summary-grid strong,
.production-plan-summary-grid strong { margin-top: 2px; color: var(--ink); font-size: 23px; line-height: 1; }
.equipment-summary-grid small,
.inventory-summary-grid small,
.production-plan-summary-grid small { margin-top: 6px; color: var(--muted); font-size: 9px; }
.equipment-summary-grid article.is-alert,
.inventory-summary-grid article.is-alert,
.production-plan-summary-grid article.is-alert { border-color: rgba(196, 60, 53, .25); background: #fff8f7; }
.equipment-summary-grid article.is-alert strong,
.inventory-summary-grid article.is-alert strong,
.production-plan-summary-grid article.is-alert strong { color: #c43c35; }

.equipment-grid,
.production-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.equipment-card {
  min-width: 0;
  padding: 15px 16px 13px;
  border: 1px solid rgba(60, 60, 67, .11);
  border-radius: 13px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .045);
}
.equipment-card.is-shortage { border-color: rgba(196, 60, 53, .28); box-shadow: inset 3px 0 #e45a52, 0 3px 14px rgba(0, 0, 0, .045); }
.equipment-card-head { display: flex; align-items: center; gap: 11px; }
.equipment-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #007aff; background: #edf5ff; font-size: 15px; font-weight: 700; }
.equipment-card-head .card-main { min-width: 0; flex: 1; }
.equipment-card-head h3,
.equipment-card-head p { margin: 0; }
.equipment-card-head h3 { color: var(--ink); font-size: 15px; }
.equipment-card-head p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.equipment-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 13px; }
.equipment-metrics > div { min-width: 0; padding: 8px 9px; border-radius: 8px; background: rgba(118, 118, 128, .055); }
.equipment-metrics span,
.equipment-metrics strong { display: block; }
.equipment-metrics span { color: var(--muted); font-size: 8px; }
.equipment-metrics strong { margin-top: 2px; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.equipment-bom-preview { min-height: 44px; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.equipment-bom-preview > span { height: 22px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 6px; color: #4e4e53; background: rgba(118, 118, 128, .07); font-size: 8.5px; }
.equipment-bom-preview b { color: #007aff; font-weight: 600; }
.equipment-bom-preview .is-empty { color: var(--muted); }
.equipment-shortage-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; color: #a3322c; background: #fff0ef; font-size: 9px; }
.equipment-shortage-note strong { flex: 0 0 auto; }
.equipment-shortage-note span { min-width: 0; line-height: 1.5; }

.shortage-panel { margin-bottom: 10px; padding: 0; overflow: hidden; }
.shortage-panel-head { min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: #fff7f6; }
.shortage-panel-head.is-ready { background: #f4faf8; }
.shortage-panel-head > div { min-width: 0; flex: 1; }
.shortage-panel-head strong,
.shortage-panel-head span { display: block; }
.shortage-panel-head strong { color: var(--ink); font-size: 12px; }
.shortage-panel-head span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.shortage-list { border-top: 1px solid rgba(60, 60, 67, .08); }
.shortage-list button { width: 100%; min-height: 47px; display: grid; grid-template-columns: minmax(155px, .7fr) minmax(260px, 1.8fr) auto; align-items: center; gap: 12px; padding: 8px 14px; border: 0; border-bottom: 1px solid rgba(60, 60, 67, .07); color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.shortage-list button:last-child { border-bottom: 0; }
.shortage-list button:hover { background: rgba(0, 122, 255, .035); }
.shortage-list button strong { font-size: 10px; }
.shortage-list button span { overflow: hidden; color: #a3322c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.shortage-list button em { color: #007aff; font-size: 9px; font-style: normal; }
.inventory-table { min-width: 1280px; }
.stock-cell strong,
.stock-cell span { display: block; }
.stock-cell strong { color: var(--ink); font-size: 11px; }
.stock-cell span { margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.inventory-receipt-action { color: #126b50; background: #edf8f4; }
.inventory-issue-action { color: #a4492f; background: #fff4ee; }

.semifinished-linkage-note { margin-bottom: 10px; }
.semifinished-grid { display: grid; gap: 11px; }
.semifinished-card { padding: 0; overflow: hidden; }
.semifinished-card-head { min-height: 72px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 15px 8px; }
.semifinished-card-head > div:nth-child(2) { min-width: 0; }
.semifinished-card-head span,
.semifinished-card-head h3,
.semifinished-card-head p { display: block; margin: 0; }
.semifinished-card-head span { color: var(--teal-700); font-size: 9px; font-weight: 700; }
.semifinished-card-head h3 { margin-top: 2px; color: var(--ink); font-size: 14px; }
.semifinished-card-head p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.semifinished-metrics { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: 7px; padding: 0 15px 11px; }
.semifinished-metrics > div { padding: 8px 10px; border-radius: 8px; background: rgba(118, 118, 128, .055); }
.semifinished-metrics span,
.semifinished-metrics strong { display: block; }
.semifinished-metrics span { color: var(--muted); font-size: 8px; }
.semifinished-metrics strong { margin-top: 2px; color: var(--ink); font-size: 11px; }
.semifinished-material-table { min-width: 760px; border-top: 1px solid rgba(60, 60, 67, .08); }
.semifinished-card-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 15px; border-top: 1px solid rgba(60, 60, 67, .08); color: var(--muted); font-size: 9px; }
.inventory-movement-balance { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: 7px; margin-top: 11px; }
.inventory-movement-balance > div { padding: 10px; border-radius: 8px; background: rgba(118, 118, 128, .06); }
.inventory-movement-balance span,
.inventory-movement-balance strong { display: block; }
.inventory-movement-balance span { color: var(--muted); font-size: 8px; }
.inventory-movement-balance strong { margin-top: 3px; color: var(--ink); font-size: 12px; }

.linked-row-list { display: grid; gap: 7px; }
.linked-editor-row { display: grid; align-items: end; gap: 7px; padding: 9px; border: 1px solid rgba(60, 60, 67, .11); border-radius: 9px; background: rgba(118, 118, 128, .035); }
.equipment-bom-row { grid-template-columns: minmax(230px, 1.35fr) minmax(100px, .5fr) minmax(180px, 1fr) 32px; }
.supplier-quote-row { grid-template-columns: minmax(190px, 1.25fr) minmax(130px, .8fr) 90px 76px 100px 90px 112px 112px minmax(155px, .9fr) 32px; }
.purchase-line-row { grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(150px, 1fr) 120px 82px 72px 90px 76px 32px; }
.purchase-receipt-row { grid-template-columns: minmax(220px, 1fr) minmax(180px, .7fr) minmax(120px, .4fr); }
.production-reservation-row { grid-template-columns: minmax(190px, 1fr) minmax(120px, .55fr) minmax(150px, .65fr) minmax(120px, .5fr); }
.production-issue-row { grid-template-columns: minmax(220px, 1fr) minmax(150px, .6fr) minmax(130px, .5fr); }
.after-sale-part-row { grid-template-columns: minmax(200px, 1.35fr) minmax(150px, 1fr) minmax(120px, .8fr) 78px 70px minmax(145px, .85fr) minmax(125px, .75fr) minmax(150px, 1fr) 32px; }
.linked-editor-row label { min-width: 0; }
.linked-editor-row label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; }
.linked-editor-row input,
.linked-editor-row select { width: 100%; height: 32px; padding: 0 8px; border: 1px solid rgba(60, 60, 67, .16); border-radius: 7px; color: var(--ink); background: #fff; font: inherit; font-size: 10px; }
.linked-editor-row .linked-check { min-height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 7px; border-radius: 7px; background: rgba(0, 122, 255, .055); }
.linked-editor-row .linked-check input { width: 15px; height: 15px; }
.linked-editor-row .linked-check span { margin: 0; color: var(--ink); line-height: 1.3; }
.linked-empty-note { padding: 14px; border-radius: 9px; color: var(--muted); background: rgba(118, 118, 128, .055); font-size: 10px; text-align: center; }
.part-link-summary { display: grid; gap: 7px; }
.part-link-summary > div { padding: 9px 11px; border-radius: 8px; background: rgba(118, 118, 128, .055); }
.part-link-summary span,
.part-link-summary strong { display: block; }
.part-link-summary span { color: var(--muted); font-size: 8px; }
.part-link-summary strong { margin-top: 3px; color: var(--ink); font-size: 10px; line-height: 1.5; }
.approval-action-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.purchase-approval-section { border-color: rgba(34, 120, 105, .2); background: rgba(239, 249, 247, .45); }
.inventory-history { display: grid; gap: 0; border: 1px solid rgba(60, 60, 67, .1); border-radius: 8px; overflow: hidden; }
.inventory-history > div { display: grid; grid-template-columns: 130px minmax(220px, 1fr) minmax(150px, .8fr); gap: 10px; padding: 8px 10px; border-bottom: 1px solid rgba(60, 60, 67, .07); font-size: 9px; }
.inventory-history > div:last-child { border-bottom: 0; }
.inventory-history span,
.inventory-history small { color: var(--muted); }
.inventory-history strong { color: var(--ink); }
.replenishment-order-panel { margin-top: 11px; overflow: hidden; }
.replenishment-order-panel .content-heading.compact { min-height: 58px; margin: 0; padding: 11px 14px; border-bottom: 1px solid rgba(60, 60, 67, .08); }
.replenishment-order-panel .content-heading.compact h3 { margin: 0; color: var(--ink); font-size: 12px; }
.replenishment-order-panel .content-heading.compact p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.replenishment-order-table { min-width: 900px; }
.replenishment-order-panel > .inline-empty { padding: 16px; text-align: center; }

@media (max-width: 1180px) {
  .equipment-grid,
  .production-plan-grid { grid-template-columns: 1fr; }
  .supplier-quote-row { grid-template-columns: repeat(4, minmax(110px, 1fr)); }
  .purchase-line-row { grid-template-columns: repeat(4, minmax(110px, 1fr)); }
  .after-sale-part-row { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .supplier-quote-row .linked-check { grid-column: span 2; }
  .after-sale-part-row .linked-check { grid-column: span 2; }
}
@media (max-width: 760px) {
  .inventory-submodule-tabs { grid-template-columns: 1fr; }
  .equipment-summary-grid,
  .inventory-summary-grid,
  .production-plan-summary-grid { grid-template-columns: 1fr; }
  .equipment-metrics { grid-template-columns: repeat(2, 1fr); }
  .equipment-bom-row,
  .supplier-quote-row,
  .purchase-line-row,
  .purchase-receipt-row,
  .production-reservation-row,
  .after-sale-part-row { grid-template-columns: 1fr; }
  .production-issue-row { grid-template-columns: 1fr; }
  .shortage-list button { grid-template-columns: 1fr; gap: 3px; }
  .inventory-history > div { grid-template-columns: 1fr; gap: 3px; }
  .semifinished-metrics,
  .inventory-movement-balance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .semifinished-card-footer { align-items: stretch; flex-direction: column; }
}

/* Full-page equipment and large BOM workbench. */
.equipment-workspace {
  min-width: 0;
  padding-bottom: 20px;
}
.equipment-workspace-shell { min-width: 0; }
.equipment-workspace-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px minmax(260px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  position: sticky;
  top: -1px;
  z-index: 30;
  border-color: rgba(60, 60, 67, .14);
  background: rgba(250, 251, 252, .96);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 7px 24px rgba(12, 35, 52, .08);
}
.workspace-back-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(60, 60, 67, .14);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
}
.workspace-back-button:hover { border-color: rgba(0, 122, 255, .4); color: #007aff; background: #f5f9ff; }
.equipment-workspace-title { min-width: 0; }
.equipment-workspace-title > span {
  display: block;
  margin-bottom: 2px;
  color: #007aff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}
.equipment-workspace-title h2,
.equipment-workspace-title p { margin: 0; }
.equipment-workspace-title h2 {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.equipment-workspace-title p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.workspace-save-state {
  min-width: 102px;
  color: #26815f;
  font-size: 9px;
  text-align: right;
  white-space: nowrap;
}
.workspace-save-state::before { content: "●"; margin-right: 5px; font-size: 7px; }
.workspace-save-state.is-dirty { color: #a66a0a; }
.equipment-workspace-tabs {
  min-height: 44px;
  display: flex;
  align-items: end;
  gap: 4px;
  margin: 9px 0 10px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(60, 60, 67, .12);
}
.equipment-workspace-tabs button {
  min-height: 38px;
  padding: 0 16px;
  position: relative;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.equipment-workspace-tabs button::after {
  content: "";
  height: 2px;
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  border-radius: 2px 2px 0 0;
  background: transparent;
}
.equipment-workspace-tabs button:hover { color: var(--ink); }
.equipment-workspace-tabs button.is-active { color: #007aff; }
.equipment-workspace-tabs button.is-active::after { background: #007aff; }
.equipment-workspace-tabs span {
  min-width: 20px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 9px;
  color: #34627f;
  background: rgba(0, 122, 255, .09);
  font-size: 8px;
}
.equipment-workspace-content { min-width: 0; }
.equipment-overview-form { padding: 18px; }
.equipment-overview-form textarea { resize: vertical; }
.workspace-section-heading {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(60, 60, 67, .09);
}
.workspace-section-heading h3,
.workspace-section-heading p { margin: 0; }
.workspace-section-heading h3 { color: var(--ink); font-size: 13px; }
.workspace-section-heading p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.equipment-bom-workbench { min-width: 0; }
.bom-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.bom-kpi-strip article {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(60, 60, 67, .1);
  border-radius: 10px;
  background: rgba(255, 255, 255, .86);
}
.bom-kpi-strip span,
.bom-kpi-strip strong { display: block; }
.bom-kpi-strip span { color: var(--muted); font-size: 8px; }
.bom-kpi-strip strong { margin-top: 3px; color: var(--ink); font-size: 19px; line-height: 1; }
.bom-kpi-strip article.is-alert { border-color: rgba(196, 60, 53, .22); background: #fff7f6; }
.bom-kpi-strip article.is-alert strong { color: #c43c35; }
.bom-kpi-strip article.is-warning { border-color: rgba(188, 121, 18, .24); background: #fffaf0; }
.bom-kpi-strip article.is-warning strong { color: #a66a0a; }
.bom-command-bar,
.bom-secondary-bar,
.bom-bulk-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  padding: 7px 9px;
}
.bom-command-bar .search-box { min-width: 260px; flex: 1 1 360px; }
.bom-command-bar select,
.bom-secondary-bar select,
.bom-bulk-bar input {
  height: 34px;
  border: 1px solid rgba(60, 60, 67, .15);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 9px;
}
.bom-command-bar select { min-width: 112px; padding: 0 28px 0 9px; }
.bom-secondary-bar { align-items: end; }
.bom-secondary-bar > label { min-width: 260px; display: grid; flex: 1 1 420px; gap: 4px; }
.bom-secondary-bar > label > span { color: var(--muted); font-size: 8px; }
.bom-secondary-bar > label select { width: 100%; padding: 0 28px 0 9px; }
.bom-secondary-bar > select { min-width: 135px; padding: 0 28px 0 9px; }
.bom-bulk-bar { min-height: 44px; justify-content: flex-end; }
.bom-bulk-bar > span { margin-right: auto; color: var(--muted); font-size: 9px; }
.bom-bulk-bar input { width: min(250px, 24vw); padding: 0 9px; }
.bom-grid-panel { min-width: 0; padding: 0; overflow: hidden; }
.bom-virtual-scroll {
  height: min(560px, calc(100vh - 340px));
  min-height: 350px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.bom-grid-header,
.bom-virtual-row {
  min-width: 1390px;
  display: grid;
  grid-template-columns: 34px minmax(210px, 1.25fr) 150px 88px 116px 112px minmax(210px, 1.1fr) minmax(150px, .8fr) 36px;
  align-items: center;
  column-gap: 7px;
}
.bom-grid-header {
  height: 42px;
  padding: 0 9px;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(60, 60, 67, .12);
  color: #59646c;
  background: rgba(245, 247, 248, .98);
  font-size: 8px;
  font-weight: 700;
}
.bom-virtual-canvas {
  min-width: 1390px;
  position: relative;
  background: #fff;
}
.bom-virtual-row {
  height: 62px;
  padding: 6px 9px;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  border-bottom: 1px solid rgba(60, 60, 67, .075);
  background: #fff;
}
.bom-virtual-row:hover { background: #f8fbfe; }
.bom-virtual-row.is-shortage { box-shadow: inset 3px 0 #e45a52; background: #fffafa; }
.bom-select-cell { display: grid; place-items: center; }
.bom-select-cell input { width: 15px; height: 15px; accent-color: #007aff; }
.bom-part-cell,
.bom-class-cell,
.bom-stock-cell,
.bom-supplier-cell { min-width: 0; }
.bom-part-cell strong,
.bom-part-cell span,
.bom-class-cell strong,
.bom-class-cell span,
.bom-stock-cell strong,
.bom-stock-cell span,
.bom-supplier-cell strong,
.bom-supplier-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-part-cell strong,
.bom-stock-cell strong,
.bom-supplier-cell strong { color: var(--ink); font-size: 9.5px; }
.bom-part-cell span,
.bom-class-cell span,
.bom-stock-cell span,
.bom-supplier-cell span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.bom-class-cell strong { color: #355f79; font-size: 8.5px; }
.bom-virtual-row.is-shortage .bom-stock-cell strong,
.bom-virtual-row.is-shortage .bom-stock-cell span { color: #b63b34; }
.bom-input-cell { min-width: 0; }
.bom-input-cell input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: rgba(118, 118, 128, .055);
  font: inherit;
  font-size: 9px;
}
.bom-input-cell input:hover { border-color: rgba(60, 60, 67, .15); background: #fff; }
.bom-input-cell input:focus { border-color: #409cff; outline: 0; background: #fff; box-shadow: 0 0 0 2px rgba(0, 122, 255, .1); }
.bom-input-cell.quantity input { text-align: right; }
.bom-grid-footer {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px;
  border-top: 1px solid rgba(60, 60, 67, .09);
  color: var(--muted);
  background: #fafbfc;
  font-size: 8px;
}
.bom-tree-toolbar { align-items: center; }
.bom-tree-toolbar > div:first-child { min-width: 260px; flex: 1 1 520px; }
.bom-tree-toolbar > div:first-child strong,
.bom-tree-toolbar > div:first-child span { display: block; }
.bom-tree-toolbar > div:first-child strong { color: var(--ink); font-size: 10px; }
.bom-tree-toolbar > div:first-child span { margin-top: 3px; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.bom-tree-panel { min-width: 0; padding: 0; overflow-x: auto; }
.bom-tree-equipment-root {
  min-width: 1040px;
  min-height: 70px;
  display: grid;
  grid-template-columns: 38px minmax(280px, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(60, 60, 67, .12);
  background: linear-gradient(135deg, #f2f8ff, #f8fbff);
}
.bom-tree-equipment-root > div:nth-child(2) { min-width: 0; }
.bom-tree-equipment-root span,
.bom-tree-equipment-root strong,
.bom-tree-equipment-root small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-tree-equipment-root span { color: #007aff; font-size: 8px; font-weight: 700; letter-spacing: .05em; }
.bom-tree-equipment-root strong { margin-top: 2px; color: var(--ink); font-size: 11px; }
.bom-tree-equipment-root small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.bom-tree-content { min-width: 1040px; min-height: 170px; max-height: calc(100vh - 232px); overflow-y: auto; padding: 12px 14px 18px 26px; background: #fff; position: relative; }
.bom-tree-spacer { position: relative; min-height: 100%; }
.bom-tree-window { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }
.bom-tree-branch { min-width: 0; position: relative; }
.bom-tree-branch + .bom-tree-branch { margin-top: 7px; }
.bom-tree-children {
  display: grid;
  gap: 7px;
  margin: 7px 0 0 24px;
  padding-left: 25px;
  position: relative;
  border-left: 1px solid rgba(0, 122, 255, .25);
}
.bom-tree-children > .bom-tree-branch::before {
  content: "";
  width: 25px;
  position: absolute;
  top: 29px;
  left: -25px;
  border-top: 1px solid rgba(0, 122, 255, .25);
}
.bom-tree-node {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(250px, 1.35fr) 82px minmax(180px, .85fr) minmax(175px, .9fr) 72px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(60, 60, 67, .12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 40, 56, .045);
}
.bom-tree-node:hover { border-color: rgba(0, 122, 255, .27); box-shadow: 0 5px 16px rgba(17, 40, 56, .08); }
.bom-tree-node.is-draft { border-style: dashed; border-color: rgba(179, 113, 13, .45); background: #fffcf4; }
.bom-tree-node.is-shortage { border-color: rgba(196, 60, 53, .3); box-shadow: inset 3px 0 #e45a52; background: #fffafa; }
.bom-tree-level { display: grid; place-items: center; }
.bom-tree-level span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #176fa8;
  background: rgba(0, 122, 255, .1);
  font-size: 8px;
  font-weight: 700;
}
.bom-tree-part-field,
.bom-tree-quantity,
.bom-tree-notes { min-width: 0; display: grid; gap: 3px; }
.bom-tree-part-field > span,
.bom-tree-quantity > span,
.bom-tree-notes > span { color: var(--muted); font-size: 7.5px; }
.bom-tree-part-field input,
.bom-tree-quantity input,
.bom-tree-notes input {
  width: 100%;
  height: 31px;
  padding: 0 8px;
  border: 1px solid rgba(60, 60, 67, .14);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 9px;
}
.bom-tree-part-field input:focus,
.bom-tree-quantity input:focus,
.bom-tree-notes input:focus { border-color: #409cff; outline: 0; box-shadow: 0 0 0 2px rgba(0, 122, 255, .1); }
.bom-tree-quantity input { text-align: right; }
.bom-tree-part-meta { min-width: 0; }
.bom-tree-part-meta strong,
.bom-tree-part-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-tree-part-meta strong { color: #355f79; font-size: 8.5px; }
.bom-tree-part-meta span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.bom-tree-node.is-shortage .bom-tree-part-meta strong,
.bom-tree-node.is-shortage .bom-tree-part-meta span { color: #b63b34; }
.bom-tree-node-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.bom-tree-step {
  width: 29px;
  height: 29px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(60, 60, 67, .14);
  border-radius: 8px;
  color: #52616b;
  background: #fff;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.bom-tree-step.is-add { color: #0877bd; border-color: rgba(0, 122, 255, .28); background: #f2f8ff; }
.bom-tree-step.is-add:hover { color: #fff; border-color: #007aff; background: #007aff; }
.bom-tree-step.is-remove { color: #b74a45; border-color: rgba(196, 60, 53, .22); background: #fff7f6; }
.bom-tree-step.is-remove:hover { color: #fff; border-color: #c43c35; background: #c43c35; }
.bom-tree-empty { min-height: 145px; display: grid; place-content: center; gap: 5px; text-align: center; }
.bom-tree-empty strong { color: var(--ink); font-size: 11px; }
.bom-tree-empty span { color: var(--muted); font-size: 8.5px; }
.equipment-version-layout { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(480px, 1.2fr); gap: 10px; }
.workspace-tool-card,
.workspace-version-card { padding: 15px; }
.workspace-tool-grid { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr); align-items: end; gap: 10px; }
.workspace-tool-grid .btn { min-height: 34px; }
.bom-version-list { display: grid; gap: 7px; }
.bom-version-item {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(120px, .55fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(60, 60, 67, .1);
  border-radius: 9px;
  background: rgba(118, 118, 128, .025);
}
.bom-version-item.is-current { border-color: rgba(38, 129, 95, .24); background: #f5fbf8; }
.bom-version-item > div { min-width: 0; }
.bom-version-item > div:last-child { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.bom-version-item strong,
.bom-version-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-version-item strong { color: var(--ink); font-size: 9.5px; }
.bom-version-item span { margin-top: 3px; color: var(--muted); font-size: 8px; }

@media (max-width: 1240px) {
  .equipment-workspace-header { grid-template-columns: 38px minmax(230px, 1fr) auto auto; }
  .equipment-workspace-header .customer-badges,
  .equipment-workspace-header .workspace-save-state { display: none; }
  .equipment-version-layout { grid-template-columns: 1fr; }
  .bom-kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bom-secondary-bar { flex-wrap: wrap; }
}
@media (max-width: 820px) {
  .equipment-workspace-header { grid-template-columns: 38px minmax(160px, 1fr) auto; }
  .equipment-workspace-header .btn-secondary { display: none; }
  .equipment-workspace-tabs { overflow-x: auto; }
  .equipment-workspace-tabs button { flex: 0 0 auto; }
  .bom-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bom-command-bar,
  .bom-secondary-bar,
  .bom-bulk-bar { flex-wrap: wrap; }
  .bom-command-bar .search-box,
  .bom-secondary-bar > label { flex-basis: 100%; }
  .bom-bulk-bar > span { width: 100%; flex-basis: 100%; }
  .workspace-tool-grid { grid-template-columns: 1fr; }
}

/* Content-sized dialogs: no decorative outer frame or preset empty gutter. */
.print-preview-dialog {
  width: min(var(--print-fit-width, max-content), calc(100vw - 12px));
  height: min(var(--print-fit-height, max-content), calc(100vh - 12px));
  max-width: calc(100vw - 12px);
  max-height: calc(100vh - 12px);
  overflow: hidden;
  border: 0;
  border-radius: 12px;
}
.print-preview-dialog[open] { display: flex; flex-direction: column; }
.print-preview-head { min-height: 0; padding: 10px 12px 9px; }
.print-preview-stage { min-height: 0; height: auto; flex: 1 1 auto; padding: 0; }
.print-preview-page { width: 100%; height: 100%; padding: 14px; aspect-ratio: 194 / 281; }
.print-preview-actions { min-height: 0; padding: 8px 12px; }

.editor-dialog {
  width: min(var(--dialog-fit-width, max-content), calc(100vw - 12px));
  height: min(var(--dialog-fit-height, max-content), calc(100vh - 12px));
  max-width: calc(100vw - 12px);
  max-height: calc(100vh - 12px);
  border: 0 !important;
  outline: 0;
  border-radius: 12px;
  background: transparent;
}
.editor-dialog > form {
  width: max-content;
  max-width: min(1180px, calc(100vw - 12px));
  height: max-content;
  max-height: calc(100vh - 12px);
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: rgba(252, 252, 253, .985);
}
.editor-dialog.is-measuring-content { width: max-content; height: max-content; }
.editor-dialog:not(.is-measuring-content) > form { width: 100%; height: 100%; }
.editor-dialog .dialog-head,
.editor-dialog .dialog-actions { flex: 0 0 auto; }
.editor-dialog .dialog-body {
  min-height: 0;
  flex: 0 1 auto;
  max-height: calc(100vh - 126px);
  overflow: auto;
  padding: 12px 14px 14px;
}
.sample-sub-dialog { padding: 0; }
.sample-sub-dialog > form {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border: 0 !important;
}
.confirm-dialog,
.password-dialog {
  width: fit-content;
  max-width: calc(100vw - 12px);
  height: max-content;
  border: 0 !important;
  outline: 0;
}

/* File preview follows media proportions and uses all available stage space. */
.attachment-preview-dialog {
  width: min(var(--preview-fit-width, max-content), calc(100vw - 12px));
  height: min(var(--preview-fit-height, max-content), calc(100vh - 12px));
  max-width: calc(100vw - 12px);
  max-height: calc(100vh - 12px);
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #eef1f4;
}
.attachment-preview-dialog[open] { display: flex; flex-direction: column; }
.attachment-preview-head { min-height: 0; padding: 10px 12px 9px; }
.attachment-preview-toolbar { min-height: 0; padding: 5px 10px; }
.attachment-preview-actions { min-height: 0; padding: 8px 12px; }
.attachment-preview-stage { min-height: 0; height: auto; flex: 1 1 auto; }
.attachment-preview-dialog.is-image .attachment-preview-stage { height: auto; }
.attachment-preview-pdf-pages,
.attachment-preview-image-stage { padding: 0; }
.attachment-preview-pdf-page { margin-bottom: 4px; box-shadow: 0 3px 14px rgba(0, 0, 0, .18); }
.attachment-preview-image { box-shadow: 0 3px 14px rgba(0, 0, 0, .18); }

@media (max-width: 600px) {
  .editor-dialog > form { max-width: calc(100vw - 12px); }
}

/* Finance and account authorization workspaces. */
.finance-scope-note,
.access-local-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.finance-scope-note strong { color: var(--ink); white-space: nowrap; }
.access-local-note > div { min-width: 0; }
.access-local-note strong,
.access-local-note p { display: block; margin: 0; }
.access-local-note strong { color: var(--ink); font-size: 13px; }
.access-local-note p { margin-top: 3px; }

.finance-summary-grid,
.access-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.finance-summary-grid article,
.access-summary-grid article {
  position: relative;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 5px 18px rgba(26, 50, 68, .045);
}
.finance-summary-grid span,
.finance-summary-grid strong,
.finance-summary-grid small,
.access-summary-grid span,
.access-summary-grid strong,
.access-summary-grid small { display: block; min-width: 0; }
.finance-summary-grid span,
.access-summary-grid span { color: var(--muted); font-size: 11px; }
.finance-summary-grid strong,
.access-summary-grid strong { margin: 6px 0 3px; color: var(--ink); font-size: 22px; line-height: 1.15; }
.finance-summary-grid small,
.access-summary-grid small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

#finance-toolbar { flex-wrap: wrap; }
.finance-toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.finance-toolbar-actions .btn { white-space: nowrap; }

.record-submodule-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
}
.record-submodule-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.record-submodule-tab:hover { background: rgba(120, 120, 128, .08); color: var(--ink); }
.record-submodule-tab.is-active { background: #fff; color: var(--accent); box-shadow: 0 1px 5px rgba(22, 48, 65, .12); }

.access-module-summary { display: flex; max-width: 360px; flex-wrap: wrap; gap: 4px; }
.access-module-summary span,
.access-module-summary em {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}
.access-module-summary em { color: var(--accent); }
.access-table .table-primary strong,
.access-table .table-primary span { display: block; }
.access-table .table-primary span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.access-audit-panel { margin-top: 12px; padding: 14px; }
.access-audit-panel .section-heading h3,
.access-audit-panel .section-heading p { margin: 0; }
.access-audit-panel .section-heading p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.access-audit-list { display: grid; gap: 1px; margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.access-audit-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 9px 11px; background: #fff; }
.access-audit-row strong,
.access-audit-row p { display: block; margin: 0; }
.access-audit-row strong { color: var(--ink); font-size: 11px; }
.access-audit-row p,
.access-audit-row time { color: var(--muted); font-size: 9px; }

.access-account-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.access-account-switches .switch-row { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.access-permission-editor { margin-top: 10px; }
.access-permission-editor.is-disabled { opacity: .58; }
.access-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 10px; }
.access-module-grid label { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.access-module-grid input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--accent); }
.access-module-grid span,
.access-module-grid strong,
.access-module-grid small { display: block; min-width: 0; }
.access-module-grid strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.access-module-grid small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.access-module-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.access-module-card { padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf9; }
.access-module-card.is-selected { border-color: #addfd7; background: #f2fbf9; }
.access-module-grid .access-module-card > .access-module-toggle { padding: 0; border: 0; background: transparent; }
.access-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.access-module-grid .access-action-grid label { justify-content: center; padding: 5px 4px; border-color: var(--line-soft); font-size: 9px; }
.access-module-grid .access-action-grid label:has(input:checked) { color: var(--teal-700); border-color: #b9e4dc; background: #eaf8f5; }
.access-module-grid .access-action-grid input { width: 13px; height: 13px; }
.access-responsibility-editor { margin-top: 10px; }
.access-equipment-scope { margin-top: 10px; }
.access-equipment-scope > strong { color: var(--ink); font-size: 11px; }
.inline-notice { margin-top: 9px; padding: 8px 10px; border-radius: 7px; background: #eaf7f4; color: #126c61; font-size: 10px; }

.finance-journal-line-row,
.expense-claim-item-row {
  grid-template-columns: minmax(145px, 1.15fr) minmax(150px, 1.35fr) minmax(100px, .75fr) minmax(100px, .75fr) 30px;
}
.expense-claim-item-row { grid-template-columns: minmax(118px, .85fr) minmax(135px, 1fr) minmax(100px, .7fr) minmax(170px, 1.4fr) 30px; }
.finance-payment-allocation-row { grid-template-columns: minmax(260px, 1.6fr) minmax(130px, .7fr) 30px; }
.finance-journal-balance {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(194, 65, 55, .18);
  border-radius: 8px;
  background: rgba(194, 65, 55, .045);
  color: var(--muted);
  font-size: 10px;
}
.finance-journal-balance strong { color: var(--ink); }
.finance-journal-balance em { color: #b13c35; font-style: normal; font-weight: 700; }
.finance-journal-balance.is-balanced { border-color: rgba(8, 124, 112, .2); background: rgba(8, 124, 112, .06); }
.finance-journal-balance.is-balanced em { color: #087c70; }
.finance-detail-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.finance-detail-hero > div { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.finance-detail-hero span,
.finance-detail-hero strong { display: block; }
.finance-detail-hero span { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.finance-detail-hero strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.finance-detail-actions { display: flex; justify-content: flex-end; margin: -2px 0 9px; }
.finance-detail-actions .btn { display: inline-flex; align-items: center; gap: 5px; }
.finance-detail-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.finance-trace-source {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto minmax(110px, 1fr) auto minmax(100px, 1fr);
  align-items: center;
  gap: 7px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}
.finance-trace-source span { color: var(--muted); font-size: 9px; }
.finance-trace-source strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.finance-trace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.finance-trace-group { min-width: 0; margin-top: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .76); }
.finance-trace-grid .finance-trace-group { margin-top: 0; }
.finance-trace-list { display: grid; gap: 5px; margin-top: 8px; }
.finance-trace-list article { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 8px 9px; border-radius: 7px; background: var(--surface-soft); }
.finance-trace-list article > div { min-width: 0; }
.finance-trace-list article > div:last-child { display: flex; align-items: center; flex: 0 0 auto; gap: 6px; }
.finance-trace-list strong,
.finance-trace-list span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-trace-list strong { color: var(--ink); font-size: 10px; }
.finance-trace-list span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.finance-trace-list b { color: var(--ink); font-size: 9px; font-weight: 650; }
.finance-trace-audit { display: grid; gap: 5px; margin-top: 8px; }
.finance-trace-audit article { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; background: var(--surface-soft); }
.finance-trace-audit strong,
.finance-trace-audit small { display: block; }
.finance-trace-audit strong { color: var(--ink); font-size: 10px; }
.finance-trace-audit small,
.finance-trace-audit time { color: var(--muted); font-size: 8px; }
.finance-posting-empty { display: grid; justify-items: start; gap: 5px; margin-top: 9px; padding: 12px; border: 1px dashed rgba(0, 122, 255, .28); border-radius: 9px; background: rgba(0, 122, 255, .045); }
.finance-posting-empty strong { color: var(--ink); font-size: 11px; }
.finance-posting-empty span { color: var(--muted); font-size: 9px; }
.finance-posting-empty .btn { margin-top: 3px; }

@media (max-width: 1050px) {
  .finance-summary-grid,
  .access-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .finance-summary-grid,
  .access-summary-grid,
  .access-account-switches,
  .access-module-grid { grid-template-columns: 1fr; }
  .record-submodule-tabs { overflow-x: auto; }
  .record-submodule-tab { flex: 0 0 auto; }
  .finance-journal-line-row,
  .expense-claim-item-row,
  .finance-payment-allocation-row,
  .finance-detail-hero { grid-template-columns: 1fr; }
  .finance-trace-source,
  .finance-trace-grid { grid-template-columns: 1fr; }
  .finance-trace-source { align-items: start; }
  .finance-toolbar-actions { width: 100%; }
  .finance-journal-balance { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* Part drawings and receiving-inspection guidance. */
.part-drawing-column-header { width: 190px; }

.part-drawing-cell {
  min-width: 0;
}

.part-drawing-cell > strong,
.part-drawing-cell-requirement {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-drawing-cell > strong {
  color: var(--ink);
  font-size: 10px;
}

.part-drawing-cell-requirement {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.part-drawing-cell-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}

.part-drawing-cell-actions em {
  color: var(--teal-700);
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
}

.part-drawing-preview-button {
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(0, 122, 255, .2);
  border-radius: 6px;
  color: #0067d8;
  background: rgba(0, 122, 255, .055);
  font: inherit;
  font-size: 8px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.part-drawing-preview-button:hover {
  border-color: rgba(0, 122, 255, .35);
  background: rgba(0, 122, 255, .1);
}

.part-drawing-preview-button:focus-visible {
  outline: 2px solid rgba(0, 122, 255, .35);
  outline-offset: 2px;
}

.part-drawing-section {
  border-color: rgba(0, 122, 255, .16);
  background: rgba(246, 250, 255, .66);
}

.part-drawing-upload-button {
  white-space: nowrap;
}

.part-drawing-attachment-list {
  gap: 6px;
}

.part-drawing-attachment-row {
  background: rgba(255, 255, 255, .9);
}

.part-drawing-attachment-type {
  color: #0067d8;
  background: rgba(0, 122, 255, .08);
}

.part-drawing-attachment-copy {
  min-width: 0;
}

.part-drawing-attachment-actions {
  flex-wrap: nowrap;
}

.part-drawing-empty {
  padding: 16px;
  border: 1px dashed rgba(0, 122, 255, .22);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.part-drawing-requirements-field textarea {
  min-height: 92px;
  line-height: 1.55;
  resize: vertical;
}

.part-drawing-receipt-guide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(0, 122, 255, .16);
  border-radius: 8px;
  background: rgba(0, 122, 255, .045);
}

.part-drawing-receipt-copy {
  min-width: 0;
}

.part-drawing-receipt-copy > span,
.part-drawing-receipt-copy > strong,
.part-drawing-receipt-copy > p {
  display: block;
  margin: 0;
}

.part-drawing-receipt-copy > span {
  color: #0067d8;
  font-size: 8px;
  font-weight: 700;
}

.part-drawing-receipt-copy > strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 10px;
}

.part-drawing-receipt-copy > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.part-drawing-receipt-actions {
  display: flex;
  max-width: 260px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.part-drawing-receipt-missing {
  color: #a4492f;
  font-size: 8px;
  font-style: normal;
}

@media (max-width: 760px) {
  .part-drawing-column-header { width: 165px; }
  .part-drawing-receipt-guide { grid-template-columns: 1fr; }
  .part-drawing-receipt-actions { max-width: none; justify-content: flex-start; }
  .part-drawing-attachment-row { grid-template-columns: 34px minmax(0, 1fr); }
  .part-drawing-attachment-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
