._wrapper_178aq_1 {
	position: fixed;
	bottom: 100px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	opacity: 0;
	z-index: 2147483642; /* 比 SimulatorMask 高一层 */
	box-sizing: border-box;

	overflow: visible;

	* {
		box-sizing: border-box;
	}

	--width: 360px;
	--height: 40px;
	--border-radius: 12px;

	--side-space: 12px; /* 控制栏两侧的间距 */
	--history-width: calc(var(--width) - var(--side-space) * 2);

	--color-1: rgb(57, 182, 255);
	--color-2: rgb(189, 69, 251);
	--color-3: rgb(255, 87, 51);
	--color-4: rgb(255, 214, 0);

	width: var(--width);
	height: var(--height);

	transition: all 0.3s ease-in-out;

	&._dragging_178aq_65 {
		transition: none;
	}

	/* 响应式设计 */
	@media (max-width: 480px) {
		width: calc(100vw - 40px);
		--width: calc(100vw - 40px);
	}

	._background_178aq_85 {
		position: absolute;
		inset: -2px -8px;
		border-radius: calc(var(--border-radius) + 4px);
		filter: blur(16px);
		overflow: hidden;
		/* mix-blend-mode: lighten; */
		/* display: none; */

		&::before {
			content: '';
			z-index: -1;
			pointer-events: none;
			position: absolute;
			width: 100%;
			height: 100%;
			/* left: -100%; */
			left: 0;
			top: 0;

			background-image: linear-gradient(
				to bottom left,
				var(--color-1),
				var(--color-2),
				var(--color-1)
			);
			animation: _mask-running_178aq_1 2s linear infinite;
		}
		&::after {
			content: '';
			z-index: -1;
			pointer-events: none;
			position: absolute;
			width: 100%;
			height: 100%;
			left: 0;
			top: 0;

			background-image: linear-gradient(
				to bottom left,
				var(--color-2),
				var(--color-1),
				var(--color-2)
			);
			animation: _mask-running_178aq_1 2s linear infinite;
			animation-delay: 1s;
		}
	}
}

@keyframes _mask-running_178aq_1 {
	from {
		transform: translateX(-100%);
	}
	to {
		transform: translateX(100%);
	}
}

/* 控制栏 */
._header_178aq_205 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	user-select: none;

	position: absolute;
	inset: 0;

	cursor: pointer;
	touch-action: none;
	flex-shrink: 0; /* 防止 header 被压缩 */

	._wrapper_178aq_1._dragging_178aq_65 &,
	._wrapper_178aq_1:has(._dragging_178aq_65) & {
		cursor: grabbing;
	}

	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(10px);
	border-radius: var(--border-radius);
	background-clip: padding-box;

	box-shadow:
		0 0 0px 2px rgba(255, 255, 255, 0.4),
		0 0 5px 1px rgba(255, 255, 255, 0.3);

	._statusSection_178aq_261 {
		display: flex;
		align-items: center;
		gap: 8px;
		flex: 1;
		min-height: 24px; /* 确保垂直居中 */

		._indicator_178aq_275 {
			width: 6px;
			height: 6px;
			border-radius: 50%;
			background: rgba(255, 255, 255, 0.5);
			flex-shrink: 0;
			animation: none; /* 默认无动画 */

			/* 运行状态 - 有动画 */
			&._thinking_178aq_293 {
				background: rgb(57, 182, 255);
				animation: _pulse_178aq_1 0.8s ease-in-out infinite;
			}

			&._tool_executing_178aq_303 {
				background: rgb(189, 69, 251);
				animation: _pulse_178aq_1 0.6s ease-in-out infinite;
			}

			&._retry_178aq_313 {
				background: rgb(255, 214, 0);
				animation: _retryPulse_178aq_1 1s ease-in-out infinite;
			}

			/* 静止状态 - 无动画 */
			&._completed_178aq_325,
			&._input_178aq_327,
			&._output_178aq_329 {
				background: rgb(34, 197, 94);
				animation: none;
			}

			&._error_178aq_339 {
				background: rgb(239, 68, 68);
				animation: none;
			}
		}

		._statusText_178aq_351 {
			color: white;
			font-size: 12px;
			line-height: 1;
			font-weight: 500;
			transition: all 0.3s ease-in-out;
			position: relative;
			overflow: hidden;
			display: flex;
			align-items: center;
			min-height: 24px; /* 确保垂直居中 */

			&._fadeOut_178aq_375 {
				animation: _statusTextFadeOut_178aq_1 0.3s ease forwards;
			}

			&._fadeIn_178aq_383 {
				animation: _statusTextFadeIn_178aq_1 0.3s ease forwards;
			}
		}
	}

	._controls_178aq_395 {
		display: flex;
		align-items: center;
		gap: 4px;

		._controlButton_178aq_405 {
			width: 24px;
			height: 24px;
			border: none;
			border-radius: 4px;
			background: rgba(255, 255, 255, 0.1);
			color: white;
			cursor: pointer;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 12px;
			line-height: 1;

			&:hover {
				background: rgba(255, 255, 255, 0.2);
			}
		}

		._stopButton_178aq_443 {
			background: rgba(239, 68, 68, 0.2);
			color: rgb(255, 41, 41);
			font-weight: 600;

			&:hover {
				background: rgba(239, 68, 68, 0.3);
			}
		}
	}
}

@keyframes _statusTextFadeIn_178aq_1 {
	0% {
		opacity: 0;
		transform: translateY(5px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes _statusTextFadeOut_178aq_1 {
	0% {
		opacity: 1;
		transform: translateY(0);
	}
	100% {
		opacity: 0;
		transform: translateY(-5px);
	}
}

._historySectionWrapper_178aq_511 {
	position: absolute;
	width: var(--history-width);
	bottom: var(--height);
	left: var(--side-space);
	z-index: -2;

	padding-top: 0px;
	visibility: collapse;
	overflow: hidden;

	transition: all 0.2s;

	background: rgba(2, 0, 20, 0.5);
	/* background: rgba(186, 186, 186, 0.2); */
	backdrop-filter: blur(10px);

	text-shadow: 0 0 1px rgba(0, 0, 0, 0.2);

	border-top-left-radius: calc(var(--border-radius) + 4px);
	border-top-right-radius: calc(var(--border-radius) + 4px);

	/* border: 2px solid rgba(255, 255, 255, 0.8); */
	border: 2px solid rgba(255, 255, 255, 0.4);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);

	/* @media (prefers-color-scheme: dark) {
		box-shadow:
			0 8px 32px 0 rgba(0, 0, 0, 0.85),
			0 2px 12px 0 rgba(57, 182, 255, 0.1);
	} */

	._expanded_178aq_575 & {
		padding-top: 8px;
		visibility: visible;
	}

	._historySection_178aq_511 {
		position: relative;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: none;
		max-height: 0;
		padding-inline: 8px;

		transition: max-height 0.2s;

		._expanded_178aq_575 & {
			max-height: min(500px, calc(100vh - 200px - var(--height)));
		}

		._historyItem_178aq_613 {
			/* backdrop-filter: blur(10px); */
			padding: 8px 10px;
			margin-bottom: 6px;
			background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
			border-radius: 8px;
			border-left: 2px solid rgba(57, 182, 255, 0.5);
			font-size: 12px;
			color: white;
			/* color: black; */
			line-height: 1.3;
			position: relative;
			overflow: hidden;

			/* 微妙的内阴影 */
			box-shadow:
				inset 0 1px 0 rgba(255, 255, 255, 0.1),
				0 1px 3px rgba(0, 0, 0, 0.1);

			&::before {
				content: '';
				position: absolute;
				top: 0;
				left: 0;
				right: 0;
				height: 1px;
				background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
			}

			&:hover {
				background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
				/* transform: translateY(-1px); */
				box-shadow:
					inset 0 1px 0 rgba(255, 255, 255, 0.15),
					0 2px 4px rgba(0, 0, 0, 0.15);
			}

			&:last-child {
				margin-bottom: 10px;
			}

			&._completed_178aq_325,
			&._input_178aq_327,
			&._output_178aq_329 {
				border-left-color: rgb(34, 197, 94);
				background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
			}

			&._error_178aq_339 {
				border-left-color: rgb(239, 68, 68);
				background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
			}

			&._retry_178aq_313 {
				border-left-color: rgb(255, 214, 0);
				background: linear-gradient(135deg, rgba(255, 214, 0, 0.1), rgba(255, 214, 0, 0.05));
			}

			&._observation_178aq_729 {
				border-left-color: rgb(147, 51, 234);
				background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(147, 51, 234, 0.05));
			}

			&._question_178aq_739 {
				border-left-color: rgb(255, 159, 67);
				background: linear-gradient(135deg, rgba(255, 159, 67, 0.15), rgba(255, 159, 67, 0.08));
			}

			/* 突出显示 done 成功结果 */
			&._doneSuccess_178aq_751 {
				background: linear-gradient(
					135deg,
					rgba(34, 197, 94, 0.25),
					rgba(34, 197, 94, 0.15),
					rgba(34, 197, 94, 0.08)
				);
				border: none;
				border-left: 4px solid rgb(34, 197, 94);
				box-shadow:
					0 4px 12px rgba(34, 197, 94, 0.3),
					inset 0 1px 0 rgba(255, 255, 255, 0.2),
					0 0 20px rgba(34, 197, 94, 0.1);
				font-weight: 600;
				color: rgb(220, 252, 231);
				padding: 10px 12px;
				margin-bottom: 8px;
				border-radius: 8px;
				position: relative;
				overflow: hidden;

				&::before {
					background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.4), transparent);
				}

				&::after {
					content: '';
					position: absolute;
					top: 0;
					left: -100%;
					width: 100%;
					height: 100%;
					background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
					animation: _shimmer_178aq_1 2s ease-in-out infinite;
				}

				._historyContent_178aq_823 {
					._statusIcon_178aq_825 {
						font-size: 16px;
						animation: _celebrate_178aq_1 0.8s ease-in-out;
						filter: drop-shadow(0 2px 4px rgba(34, 197, 94, 0.5));
					}
				}
			}

			/* 突出显示 done 失败结果 */
			&._doneError_178aq_843 {
				background: linear-gradient(
					135deg,
					rgba(239, 68, 68, 0.25),
					rgba(239, 68, 68, 0.15),
					rgba(239, 68, 68, 0.08)
				);
				border: none;
				border-left: 4px solid rgb(239, 68, 68);
				box-shadow:
					0 4px 12px rgba(239, 68, 68, 0.3),
					inset 0 1px 0 rgba(255, 255, 255, 0.2),
					0 0 20px rgba(239, 68, 68, 0.1);
				font-weight: 600;
				color: rgb(254, 226, 226);
				padding: 10px 12px;
				margin-bottom: 8px;
				border-radius: 8px;
				position: relative;
				overflow: hidden;

				&::before {
					background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.4), transparent);
				}

				._historyContent_178aq_823 {
					._statusIcon_178aq_825 {
						font-size: 16px;
						filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.5));
					}
				}
			}

			._historyContent_178aq_823 {
				display: flex;
				align-items: flex-start;
				gap: 8px;

				word-break: break-all;
				white-space: pre-wrap;

				/* overflow-x: auto; */

				._statusIcon_178aq_825 {
					font-size: 12px;
					flex-shrink: 0;
					line-height: 1;
					transition: all 0.3s ease;
				}

				._reflectionLines_178aq_943 {
					display: flex;
					flex-direction: column;
					gap: 4px;
				}
			}

			._historyMeta_178aq_957 {
				font-size: 10px;
				color: rgba(255, 255, 255, 0.6);
				/* color: rgb(61, 61, 61); */
				margin-top: 8px;
				line-height: 1;
			}
		}
	}
}

/* 动画关键帧 - 更快的闪烁 */
@keyframes _pulse_178aq_1 {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.4;
		transform: scale(1.3);
	}
}

/* 重试动画 - 旋转脉冲 */
@keyframes _retryPulse_178aq_1 {
	0%,
	100% {
		opacity: 1;
		transform: scale(1) rotate(0deg);
	}
	25% {
		opacity: 0.6;
		transform: scale(1.2) rotate(90deg);
	}
	50% {
		opacity: 0.8;
		transform: scale(1.1) rotate(180deg);
	}
	75% {
		opacity: 0.6;
		transform: scale(1.2) rotate(270deg);
	}
}

/* 庆祝动画 */
@keyframes _celebrate_178aq_1 {
	0%,
	100% {
		transform: scale(1);
	}
	25% {
		transform: scale(1.2) rotate(-5deg);
	}
	75% {
		transform: scale(1.2) rotate(5deg);
	}
}

/* done 卡片的光泽效果 */
@keyframes _shimmer_178aq_1 {
	0% {
		left: -100%;
	}
	100% {
		left: 100%;
	}
}

/* 输入区域样式 */
._inputSectionWrapper_178aq_1097 {
	position: absolute;
	width: var(--history-width);
	top: var(--height);
	left: var(--side-space);
	z-index: -1;

	visibility: visible;
	overflow: hidden;

	height: 48px;

	transition: all 0.2s;

	background: rgba(186, 186, 186, 0.2);
	backdrop-filter: blur(10px);

	border-bottom-left-radius: calc(var(--border-radius) + 4px);
	border-bottom-right-radius: calc(var(--border-radius) + 4px);

	border: 2px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);

	&._hidden_178aq_1143 {
		visibility: collapse;
		height: 0;
	}

	._inputSection_178aq_1097 {
		display: flex;
		align-items: center;
		gap: 4px;
		padding: 8px 8px;

		._taskInput_178aq_1165 {
			flex: 1;
			background: rgba(255, 255, 255, 0.4);
			border: 1px solid rgba(255, 255, 255, 0.3);
			border-radius: 10px;
			padding-inline: 10px;
			color: rgb(20, 20, 20);
			font-size: 12px;
			height: 28px;
			line-height: 1;
			outline: none;
			transition: all 0.2s ease;

			/* text-shadow: 0 0 2px rgba(255, 255, 255, 0.8); */

			/* border-color: rgba(57, 182, 255, 0.3); */

			&::placeholder {
				color: rgb(53, 53, 53);
			}

			&:focus {
				background: rgba(255, 255, 255, 0.8);
				border-color: rgba(57, 182, 255, 0.6);
				box-shadow: 0 0 0 2px rgba(57, 182, 255, 0.2);
			}
		}
	}
}
/* ==========================================================================
   全新时尚/简约/多模式适配 LoginPage 样式
   ========================================================================== */

/* 1. 基础主题变量与随系统模式（System Mode）适配 */
:root {
  --bg-rgb: 246, 248, 251;
  --panel-rgb: 255, 255, 255;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(226, 232, 240, 0.8);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
  --radius-lg: 16px;
  --radius-md: 10px;
}

/* 随系统自动切换深色模式 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-rgb: 15, 23, 42;
    --panel-rgb: 30, 41, 59;
    --bg: #0f172a;
    --panel: #1e293b;
    --panel-soft: #0f172a;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
    --primary: #38bdf8;
    --primary-strong: #0284c7;
    --primary-glow: rgba(56, 189, 248, 0.2);
    --glass-bg: rgba(30, 41, 59, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  }
}

/* 响应式适配：在屏幕较小时自动回退为单列或双列 */
@media (max-width: 1024px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .module-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 显式切换深色模式支持 */
html.dark,
html[data-theme="dark"] {
  --bg-rgb: 15, 23, 42;
  --panel-rgb: 30, 41, 59;
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-soft: #0f172a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #38bdf8;
  --primary-strong: #0284c7;
  --primary-glow: rgba(56, 189, 248, 0.2);
  --glass-bg: rgba(30, 41, 59, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 2. 页面主体容器背景微光效果 */
.login-page {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, var(--primary-glow) 0px, transparent 50%),
    radial-gradient(at 100% 100%, var(--primary-glow) 0px, transparent 50%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 3. 毛玻璃固定顶部导航 */
.login-nav {
  background: var(--panel) !important; /* 确保毛玻璃在不同背景下都有底色保障 */
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.login-logo-link ,
.login-logo-text strong,
.section-header h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text) !important; /* 强制继承主题高对比度文字颜色 */
}

.login-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.login-logo-text {
  display: flex;
  flex-direction: column;
}

.login-logo-text strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.login-logo-text small {
  font-size: 11px;
  color: var(--muted)!important;
}

.login-nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 24px;
}

.login-nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-nav-links a:hover {
  color: var(--primary);
}

/* 4. Hero 核心展示区域 */
.login-hero {
  padding: 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 1. 扩充登录 Hero 容器宽度，提升整体大气感 */
.login-hero-inner {
  max-width: 1360px !important; /* 从 1100px 扩大至 1360px */
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 480px !important; /* 适当拓宽右侧登录框 */
  gap: 60px !important;
  align-items: center;
}

.login-points {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-points div {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  width: fit-content;
  backdrop-filter: blur(8px);
}

.login-points svg {
  color: var(--primary);
}

/* 5. 现代化悬浮登录卡片 */
.login-embed-card {
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 500px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: -0.03em;
}

.login-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px 0;
}

.login-mode-line {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 表单与输入框优化 */
.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.login-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* 2. 提升输入框尺寸与触控体验 */
.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  height: 46px; /* 从 42px 提升至 46px */
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* 验证码与单选按钮 */
.verify-code-row {
  display: flex;
  gap: 10px;
}

.btn-send-code {
  white-space: nowrap;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  padding: 0 16px;
  transition: all 0.2s ease;
}

.btn-send-code:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

/* 按钮高亮与交互 */
.btn-login {
  width: 100%;
  height: 44px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-login:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-login:active {
  transform: translateY(0);
}

/* 登录辅助链接与微信按钮 */
.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  min-height: auto;
}

.link-btn:hover {
  color: var(--primary);
}

.wechat-login-section {
  margin-top: 24px;
  text-align: center;
}

.divider {
  position: relative;
  margin: 16px 0;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.divider span {
  position: relative;
  background: var(--panel);
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.btn-wechat-login {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 500;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-wechat-login:hover:not(:disabled) {
  border-color: #07c160;
  color: #07c160;
  background: rgba(7, 193, 96, 0.05);
}

/* 6. 功能模块卡片 Section */
.login-section {
  padding: 80px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  
  position: relative;
  display: inline-block !important;
  padding-bottom: 12px;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  border-radius: 2px;
}

.section-header .bar {
  width: 48px;                     /* 适当加宽横线 */
  height: 4px;                     /* 横线高度 */
  background: var(--primary);      /* 继承当前主题的主色调 */
  margin: 12px auto 0;             /* 居中显示 */
  border-radius: 2px;              /* 圆角微调 */
  box-shadow: 0 2px 8px var(--primary-glow); /* 给横线加一点微光，更具质感 */
}

.module-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important; /* 强制精准一行 3 个 */
  gap: 32px !important;
}

/* 2. 模块卡片：侧面颜色条 + 现代柔和阴影 + 悬浮动效 */
.module-card {
  position: relative !important;
  min-height: 240px !important;
  padding: 32px 32px 32px 36px !important; /* 稍微留出左侧视觉空间 */
  font-size: 15px !important;
  background: var(--panel) !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border) !important;
  
  /* 侧面颜色条：使用左边框实现，也可以通过 nth-child 给不同卡片设置不同颜色 */
  border-left: 5px solid var(--primary) !important; 
  
  /* 时尚层次感阴影 */
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 
              0 4px 6px -2px rgba(15, 23, 42, 0.03) !important;
  
  /* 增加过渡动画使悬浮更平滑 */
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.28s ease !important;
  overflow: hidden;
}

/* 卡片悬浮交互效果：向上微提，阴影扩散 */
.module-card:hover {
  transform: translateY(-6px) !important; /* 向上悬浮 6px */
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.12), 
              0 10px 15px -5px rgba(37, 99, 235, 0.1) !important;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border)) !important;
}

/* 丰富细节（可选）：如果你想让不同的卡片左侧拥有不同的颜色 */
.module-grid .module-card:nth-child(1) {
  border-left-color: #2563eb !important; /* 蓝色 */
}
.module-grid .module-card:nth-child(2) {
  border-left-color: #0d9488 !important; /* 青绿色 */
}
.module-grid .module-card:nth-child(3) {
  border-left-color: #7c3aed !important; /* 紫色 */
}

/* 3. 暗黑模式适应 */
html.dark .module-card,
html[data-theme="dark"] .module-card {
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5) !important;
}

html.dark .module-card:hover,
html[data-theme="dark"] .module-card:hover {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 
              0 0 20px 0 var(--primary-glow) !important;
}

.module-card h3 {
  font-size: 20px !important; /* 加大卡片标题字号 */
  font-weight: 700 !important;
  margin-bottom: 18px !important;
  color: var(--text) !important; /* 保证卡片标题清晰 */
}

.module-card ul {
  font-size: 14px !important; /* 加大列表字号 */
  line-height: 1.8 !important;
  color: var(--muted) !important;
}

/* 7. 页脚设计 */
.login-footer {
  padding: 32px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  background: var(--panel);
}

.login-footer a {
  color: var(--muted);
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--primary);
}

/* 登录页协议勾选 */
.agreement-row {
  margin-top: 2px;
}

.agreement-line {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
  cursor: pointer;
}

.agreement-label input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}

.agreement-docs .link-btn {
  color: var(--primary);
  padding: 0;
}

/* 隐私政策 / 服务协议富文本查看 */
.legal-doc-content h1,
.legal-doc-content h2,
.legal-doc-content h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.legal-doc-content p {
  margin: 0 0 10px;
  text-align: justify;
}

.legal-doc-content ol,
.legal-doc-content ul {
  padding-left: 20px;
  margin: 0 0 10px;
}

.legal-doc-content a {
  color: var(--primary);
}

/* 响应式断点控制 */
@media (max-width: 900px) {
  .login-hero-inner {
    grid-template-columns: 1fr;
  }
  .login-points {
    display: none;
  }
  .login-nav-links {
    display: none;
  }
}


.currency-total-field {
  position: relative;
}

.currency-total-tip {
  position: absolute;
  z-index: 40;
  left: 0;
  top: calc(100% + 6px);
  width: min(320px, 80vw);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
  font-size: 12px;
  line-height: 1.5;
  visibility: hidden;
  pointer-events: none;
}

.currency-total-field:hover .currency-total-tip,
.currency-total-field:focus-within .currency-total-tip {
  visibility: visible;
}
:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --border: #d9e2ef;
  --primary: #0f80d8;
  --primary-strong: #0869b6;
  --success: #15803d;
  --danger: #dc2626;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html.dark,
html[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #111827;
  --panel-soft: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #38bdf8;
  --primary-strong: #7dd3fc;
  --success: #4ade80;
  --danger: #f87171;
  --shadow: none;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 12px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

button:disabled,
button:disabled:hover {
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel) 84%, var(--muted) 16%);
  opacity: 0.72;
}

button.primary,
.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

button.primary:hover {
  background: var(--primary-strong);
  color: #fff;
}

input,
select,
textarea {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
}

textarea {
  padding: 8px 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 9px 10px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  background: var(--panel-soft);
  color: #334155;
  font-weight: 600;
}

.resizable-table th,
.document-table th,
.data-table th {
  position: relative;
  overflow: hidden;
  min-width: 52px;
}

.column-resize-handle {
  position: absolute;
  z-index: 4;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.column-resize-handle:hover,
.column-resizing .column-resize-handle {
  background: color-mix(in srgb, var(--primary) 28%, transparent);
}

.column-resizing {
  cursor: col-resize;
  user-select: none;
}

.product-list-table {
  min-width: 1120px;
}

.product-list-table td {
  vertical-align: middle;
}

.product-list-table th:first-child,
.product-list-table td:first-child {
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

.product-list-table .product-col-check-cell input[type="checkbox"],
.product-list-table td:first-child input[type="checkbox"] {
  margin: 0;
}

.product-list-table .product-col-actions {
  width: 214px;
}

.product-list-table .product-col-check {
  width: 46px;
}

.product-list-table .product-col-code {
  width: 112px;
}

.product-list-table .product-col-name {
  width: 180px;
}

.product-list-table .product-col-category {
  width: 8em;
}

.product-list-table .product-col-spec {
  width: 288px;
}

.product-list-table .product-col-barcode {
  width: 138px;
}

.product-list-table .product-col-unit {
  width: 5em;
}

.product-list-table .product-col-price {
  width: 86px;
}

.product-list-table .product-col-status {
  width: 82px;
}

.product-list-table td.row-actions {
  display: table-cell;
  height: auto;
  line-height: 1;
  white-space: nowrap;
}

.product-list-table .row-actions button {
  min-height: 24px;
  margin-right: 4px;
  padding: 0 6px;
  font-size: 12px;
}

.product-list-table .row-actions button:last-child {
  margin-right: 0;
}

html.dark th {
  color: #e5e7eb;
}

.app-shell {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.side-nav {
  background: #1784c7;
  color: #fff;
  padding: 8px 0;
  min-height: 0;
  overflow: visible;
  overscroll-behavior: contain;
  position: relative;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 8px;
  margin-bottom: 8px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #fff;
  color: #1784c7;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand small {
  display: none;
  opacity: 0.85;
}

.menu-group {
  position: relative;
  margin: 0;
}

.menu-group button {
  width: 100%;
  min-height: 40px;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  margin: 0;
  padding: 0 12px;
}

.menu-group button.active,
.menu-group button:hover {
  background: #0f5f91;
  color: #fff;
}

.menu-flyout {
  position: absolute;
  z-index: 90;
  top: 0;
  left: 100%;
  width: 326px;
  max-height: min(640px, calc(100vh - 24px));
  padding: 10px 12px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 4px 10px;
  border: 1px solid #d9e2ef;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.menu-flyout button {
  min-height: 32px;
  border-radius: 4px;
  color: #1f2937;
  background: #fff;
  padding: 0 6px;
  font-size: 13px;
}

.menu-flyout button:hover,
.menu-flyout button.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, #fff);
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
}

.theme-select {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.account-set-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 40;
}

.account-set-trigger {
  width: min(320px, 34vw);
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel-soft);
  border-color: var(--border);
  text-align: left;
}

.account-set-trigger-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.account-set-trigger-value {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
}

.account-set-trigger-value strong,
.account-set-trigger-value small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-set-trigger-value strong {
  font-size: 13px;
}

.account-set-trigger-value small {
  color: var(--muted);
  font-size: 11px;
}

.account-set-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, 76vw);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  z-index: 80;
}

.account-set-popover-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.account-set-popover-header strong {
  font-size: 14px;
}

.account-set-popover-header span {
  color: var(--muted);
  font-size: 12px;
}

.account-set-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
}

.account-set-search input {
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
}

.account-set-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.account-set-option {
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.account-set-option.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel-soft));
}

.account-set-option-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-set-option-main strong,
.account-set-option-main small,
.account-set-option-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-set-option-main small,
.account-set-option-meta small,
.account-set-empty,
.account-set-confirm-card span,
.account-set-confirm-hint {
  color: var(--muted);
}

.account-set-option-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.account-set-empty {
  padding: 16px 12px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.account-set-confirm-panel {
  width: min(560px, 92vw);
}

.account-set-confirm-body {
  padding: 16px 20px 18px;
  display: grid;
  gap: 12px;
}

.account-set-confirm-body p {
  margin: 0;
  padding: 0;
  line-height: 1.65;
  white-space: normal;
}

.account-set-confirm-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
}

.account-set-confirm-card strong {
  font-size: 15px;
}

.account-set-confirm-hint {
  margin: 0;
}

.account-set-confirm-actions {
  padding: 12px 16px 16px;
  justify-content: flex-end;
}

.account-set-bootstrap-modal {
  width: min(980px, calc(100vw - 40px));
  height: min(700px, calc(100vh - 40px));
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-set-bootstrap-select-panel {
  margin-top: 12px;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-set-bootstrap-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.account-set-bootstrap-list {
  min-height: 0;
  flex: 1;
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.account-set-bootstrap-create-form {
  margin-top: 12px;
  min-height: 0;
  flex: 1;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 0 12px;
}

.account-set-bootstrap-create-form .toolbar {
  padding-left: 0;
}

.account-set-bootstrap-users {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.account-set-bootstrap-users-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
}

.account-set-bootstrap-users-head .muted {
  font-weight: 400;
}

.account-set-bootstrap-user-picker {
  min-height: 0;
  max-height: 220px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.account-set-bootstrap-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.account-set-bootstrap-user-row.selected {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

.account-set-bootstrap-user-name {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.account-set-bootstrap-user-name small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-set-bootstrap-user-toggles {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.account-set-bootstrap-user-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-set-user-grant-modal {
  width: min(1100px, calc(100vw - 32px));
  height: auto;
  max-height: min(720px, calc(100vh - 24px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-set-user-grant-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px 0;
}

.account-set-user-grant-users,
.account-set-user-grant-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel-soft);
}

.account-set-user-grant-users h4,
.account-set-user-grant-right h4,
.account-set-user-grant-grid h5 {
  margin: 0 0 10px;
}

.account-set-user-grant-user-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.account-set-user-row {
  width: 100%;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
  text-align: left;
}

.account-set-user-row.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.account-set-user-row small {
  color: var(--muted);
}

.account-set-user-grant-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-set-user-grant-badges span {
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}

.account-set-user-grant-switches {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.account-set-user-grant-switches label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-set-user-grant-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.account-set-user-grant-grid > div {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.account-set-user-grant-options {
  min-height: 0;
  flex: 1;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.account-set-user-grant-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

@media (max-width: 900px) {
  .account-set-bootstrap-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .account-set-bootstrap-actions {
    grid-template-columns: 1fr;
  }

  .account-set-user-grant-body {
    grid-template-columns: 1fr;
  }

  .account-set-user-grant-grid {
    grid-template-columns: 1fr;
  }
}

.work-tabs-shell {
  flex: 0 0 auto;
  height: 40px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.work-tabs {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.work-tabs::-webkit-scrollbar {
  display: none;
}

.tab-scroll-button {
  min-width: 34px;
  width: 34px;
  height: 40px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel-soft);
  color: var(--muted);
  justify-content: center;
}

.tab-scroll-button:last-child {
  border-right: 0;
  border-left: 1px solid var(--border);
}

.tab-tail-actions {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  border-left: 1px solid var(--border);
}

.tab-tail-actions .tab-scroll-button {
  border-left: 0;
}

.tab-close-all {
  height: 40px;
  min-height: 40px;
  min-width: 72px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel-soft);
  color: var(--muted);
  white-space: nowrap;
}

.tab-close-all:hover {
  color: var(--primary);
  background: var(--panel);
}

.tab-scroll-button:hover {
  color: var(--primary);
  background: var(--panel);
}

.content {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.work-tabs > button {
  min-width: 92px;
  max-width: 190px;
  flex: 0 0 auto;
  height: 40px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.work-tabs > button > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-tabs > button.active {
  background: var(--panel);
  color: var(--primary);
  font-weight: 700;
}

.tab-close {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.tab-close:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.content {
  padding: 16px;
}

.page-stack {
  display: grid;
  gap: 12px;
}

.product-page-stack {
  gap: 8px;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-title-row h1 {
  margin: 0;
  font-size: 24px;
}

.page-title-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.filter-bar {
  padding: 10px 14px;
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.product-filter-bar {
  justify-content: space-between;
  align-items: center;
}

.product-filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.product-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.filter-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
}

.data-table th,
.data-table td {
  height: 38px;
}

.product-list-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 176px;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.product-category-pane {
  min-width: 0;
  border-right: 1px solid var(--border);
  background: var(--panel-soft);
  overflow: auto;
}

.product-category-title {
  height: 36px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
}

.product-category-pane button {
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--text);
}

.product-category-pane button.active,
.product-category-pane button:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.product-category-tree {
  display: flex;
  flex-direction: column;
}

.product-category-tree-node {
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--text);
  text-align: left;
}

.product-category-tree-node.active,
.product-category-tree-node:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.product-category-tree-children {
  display: flex;
  flex-direction: column;
}

.product-category-empty {
  padding: 10px 12px;
}

.product-list-scroll {
  min-width: 0;
}

.recent-product-pane {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  border-left: 1px solid var(--border);
  background: var(--panel);
  overflow: auto;
}

.recent-product-pane button {
  justify-content: flex-start;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}

.recent-product-pane button.active,
.recent-product-pane button:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--primary);
}

.tab-row {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: end;
  gap: 6px;
}

.tab-row button {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.tab-row button.active {
  color: var(--primary);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
}

.inline-message {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.inline-message.success {
  color: var(--success);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.inline-message.error {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel + .panel {
  margin-top: 12px;
}

.panel-header {
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-header span,
.muted {
  color: var(--muted);
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.local-ai-page {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 12%, transparent), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, var(--bg) 14%), var(--panel));
}

.local-ai-page .panel-header {
  align-items: flex-start;
  padding: 16px 18px;
}

.local-ai-page .panel-header h2 {
  font-size: 19px;
}

.local-ai-page .panel-header span {
  align-self: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.local-ai-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 6px;
}

.local-ai-hero h3 {
  margin: 6px 0 8px;
  font-size: 22px;
  line-height: 1.25;
}

.local-ai-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.local-ai-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.local-ai-hero-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
  align-items: flex-end;
}

.local-ai-hero-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.local-ai-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 18px 16px;
}

.local-ai-summary-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg) 12%);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.local-ai-summary-card strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.local-ai-summary-card div {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  word-break: break-all;
}

.local-ai-summary-card span {
  color: var(--muted);
}

.local-ai-inline-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-soft) 76%, var(--panel) 24%);
  color: var(--muted);
  line-height: 1.6;
}

.local-ai-stepbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.local-ai-stepbar span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.local-ai-agent-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
}

.local-ai-agent-layout.collapsed {
  grid-template-columns: 1fr;
}

.local-ai-agent-layout.collapsed .local-ai-agent-sidebar {
  display: none;
}

.local-ai-agent-sidebar,
.local-ai-agent-main {
  min-width: 0;
}

.local-ai-agent-sidebar {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.local-ai-sidebar-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.local-ai-agent-main {
  min-width: 0;
}

.local-ai-template-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.local-ai-template-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--primary) 8%), var(--panel));
  color: var(--text);
  text-align: left;
}

.local-ai-template-button:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.local-ai-template-button strong {
  font-size: 14px;
}

.local-ai-template-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.local-ai-ghost-button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.local-ai-ghost-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.local-ai-card-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.local-ai-parameter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.local-ai-parameter-grid label,
.local-ai-toggle-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.local-ai-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
}

.local-ai-toggle-row label {
  color: var(--muted);
}

.local-ai-toggle-row input {
  margin-right: 6px;
}

.local-ai-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, var(--primary) 10%), var(--panel));
}

.local-ai-meta div {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.local-ai-card .button-row {
  margin-top: 12px;
}

.local-ai-card .ocr-output {
  margin-top: 12px;
}

.local-ai-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.local-ai-card-head h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 16px;
}

.local-ai-pill {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.local-ai-card {
  display: flex;
  flex-direction: column;
}

.local-ai-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.local-ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.local-ai-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, var(--bg) 6%);
  box-shadow: var(--shadow);
}

.shortcut-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.shortcut-card {
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, var(--primary) 12%), var(--panel));
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.shortcut-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.shortcut-card strong {
  font-size: 15px;
}

.shortcut-card span {
  color: var(--muted);
  line-height: 1.5;
}

.workflow-ai-hint {
  padding: 0 14px 12px;
  color: var(--muted);
  font-size: 13px;
}

.shortcut-card small {
  color: var(--muted-2);
  line-height: 1.45;
}

.shortcut-card-actions {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shortcut-card-route {
  color: var(--muted-2);
  font-size: 12px;
}

.shortcut-card-actions button {
  min-height: 30px;
  padding: 0 12px;
}

.shortcut-card-secondary {
  border-color: color-mix(in srgb, var(--border) 75%, var(--primary) 25%);
}

.ai-guide-panel {
  width: min(1120px, 96vw);
}

.ai-guide-subtitle {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.ai-guide-body {
  padding: 14px;
  display: grid;
  gap: 14px;
}

.ai-guide-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ai-guide-summary div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ai-guide-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ai-guide-summary strong {
  display: block;
  color: var(--text);
  line-height: 1.5;
}

.ai-guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-guide-columns > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ai-guide-columns h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.ai-guide-columns ol,
.ai-guide-columns ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.ai-guide-error {
  margin: 0;
  color: var(--danger, #c62d2d);
}

.ai-guide-loading {
  margin: 0;
  color: var(--muted);
}

.block-copy {
  padding: 14px;
  margin: 0;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 12px;
}

.product-list tbody tr {
  cursor: pointer;
}

.product-list tbody tr.selected {
  background: rgba(15, 128, 216, 0.1);
}

.editor-panel {
  min-width: 0;
}

.field-grid {
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 8px 12px;
  align-items: center;
}

.field-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
}

.field-grid .wide {
  grid-column: span 2;
}

.field-grid input,
.field-grid select,
.filter-bar input,
.filter-bar select {
  width: min(100%, 168px);
}

.field-grid input[type="date"],
.field-grid input[type="month"] {
  width: 142px;
}

.field-grid input[type="number"] {
  width: 120px;
}

.field-grid .wide input,
.field-grid .wide select {
  width: min(100%, 260px);
}

.invoice-field-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.95fr);
  align-items: start;
}

.invoice-compact-layout {
  padding: 10px 12px 12px;
}

.invoice-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 24px;
  align-items: start;
}

.invoice-inline-field {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.invoice-inline-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
}

.invoice-required-field .invoice-inline-label::before {
  content: "*";
  color: #dc2626;
  margin-right: 4px;
}

.invoice-inline-field input,
.invoice-inline-field select,
.invoice-inline-field .lookup-select,
.invoice-inline-field .lookup-select input,
.invoice-inline-field .inline-input-action {
  width: 100%;
  min-width: 0;
}

.invoice-inline-field input,
.invoice-inline-field select,
.invoice-inline-field .lookup-select input {
  min-height: 32px;
  height: 32px;
}

.invoice-toolbar-panel .toolbar {
  padding: 8px 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.invoice-toolbar-panel .toolbar .muted {
  font-size: 12px;
}

.invoice-document-page {
  grid-template-rows: auto auto minmax(0, auto) minmax(0, 1fr);
  min-height: calc(100vh - 176px);
}

.invoice-header-panel .panel-header.compact,
.invoice-detail-panel .panel-header.compact {
  padding: 7px 10px;
  min-height: 36px;
}

.invoice-header-panel .panel-header.compact h2,
.invoice-detail-panel .panel-header.compact h2 {
  margin: 0;
  font-size: 15px;
}

.invoice-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: clamp(520px, calc(100vh - 340px), 760px);
}

.invoice-detail-scroll {
  min-height: 420px;
  max-height: clamp(420px, calc(100vh - 420px), 680px);
  overflow: auto;
}

.invoice-inline-field-attachment {
  grid-column: span 2;
  align-items: start;
}

.invoice-attachment-control {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.invoice-detail-panel .document-summary {
  padding: 10px 12px;
}

.invoice-attachment-meta {
  line-height: 1.45;
}

.invoice-attachment-actions,
.invoice-rule-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.invoice-rule-inline-field {
  grid-column: span 2;
  align-items: start;
}

.invoice-rule-inline-field .invoice-inline-label {
  padding-top: 8px;
}

.invoice-field-group {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px 14px 16px;
  display: grid;
  gap: 12px;
}

.invoice-field-group-ticket {
  grid-column: 1;
}

.invoice-field-group-party {
  grid-column: 2;
}

.invoice-field-group-extra {
  grid-column: 1 / -1;
}

.invoice-field-group-title {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 2px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.invoice-field-group-fields {
  display: grid;
  gap: 12px 16px;
}

.invoice-field-group-fields-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-field-group-fields-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-field-group-fields-extra {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

.invoice-source-entry {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(150px, 1fr) minmax(220px, 1fr);
  gap: 12px 16px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.grouped-form-grid {
  display: grid;
  gap: 12px;
}

.grouped-form-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px 14px 16px;
  display: grid;
  gap: 12px;
}

.grouped-form-title {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 2px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.grouped-form-fields {
  display: grid;
  gap: 12px 16px;
}

.grouped-form-fields-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-info-table {
  gap: 0 18px;
  border-top: 1px solid var(--border);
}

.invoice-info-table > label,
.invoice-info-table > .muted {
  min-width: 0;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-self: stretch;
}

.invoice-info-table > .muted {
  grid-column: 1 / -1;
}

.grouped-form-fields-4 {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.grouped-form-fields-6 {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.purchase-base-fields {
  grid-template-columns: minmax(16ch, 0.95fr) minmax(11ch, 0.55fr) minmax(11ch, 0.55fr) minmax(16ch, 1.1fr);
}

.purchase-header-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
}

.purchase-header-fields > label {
  flex: 1 1 15ch;
  min-width: 12ch;
  max-width: none;
}

.purchase-header-fields .purchase-billno-field {
  flex-basis: 36ch;
}

.purchase-header-fields .purchase-billno-field input {
  max-width: 36ch;
}

.purchase-header-fields .related-order-field {
  max-width: none;
  flex-basis: 28ch;
  min-width: 28ch;
}

.purchase-header-fields .related-order-field .inline-input-action {
  grid-template-columns: minmax(20ch, 1fr) auto;
}

.purchase-header-fields .related-order-field .inline-input-action input {
  min-width: 20ch;
  max-width: none;
}

.purchase-header-fields .related-order-field .inline-input-action button {
  min-width: 6ch;
  white-space: nowrap;
  padding-inline: 8px;
}

.purchase-header-fields .lookup-select input,
.purchase-header-fields input[type="date"],
.purchase-header-fields input:not([type]) {
  max-width: none;
}

.purchase-header-fields .purchase-remark-field input {
  max-width: 48ch;
}

.purchase-header-fields .purchase-date-field {
  flex-basis: 19ch;
}

.purchase-header-fields .purchase-partner-field {
  flex-basis: 31ch;
}

.purchase-header-fields .purchase-partner-field .lookup-select,
.purchase-header-fields .purchase-partner-field .lookup-select input {
  max-width: none;
  width: 100%;
}

.purchase-header-fields .purchase-employee-field {
  flex-basis: 18ch;
  min-width: 18ch;
}

.workflow-reminder-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.workflow-reminder-summary span {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  text-align: center;
}

.workflow-reminder-summary button { justify-content: center; min-height: 48px; background: var(--panel-soft); }
.workflow-reminder-summary button.active { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent); }
.workflow-reminder-filter { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.workflow-reminder-row.status-danger { border-left: 5px solid #dc2626; }
.workflow-reminder-row.status-warning { border-left: 5px solid #f59e0b; }
.workflow-reminder-row.status-info { border-left: 5px solid #0f80d8; }
.workflow-reminder-row.status-pending { border-left: 5px solid #64748b; }

.workflow-reminder-summary strong { color: var(--primary); font-size: 18px; }
.workflow-reminder-list { display: grid; gap: 6px; }

.workflow-reminder-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(130px, 1fr) 150px 150px 90px 110px;
  width: 100%;
  min-height: 42px;
  text-align: left;
}

.workflow-reminder-row.overdue {
  border-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 9%, var(--panel));
}

/* 工作台：模块卡片 → 模块列表下钻（主从式布局） */
.workbench-module-groups { display: grid; gap: 18px; padding: 4px 0; }
.workbench-module-group { display: grid; gap: 8px; }
.workbench-module-group > h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .4px; }
.workbench-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.workbench-module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 118px;
  padding: 14px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.workbench-module-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.workbench-module-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.workbench-module-card.tone-warning { border-left: 4px solid #f59e0b; }
.workbench-module-card.tone-warning .workbench-module-badge { background: #f59e0b; }
.workbench-module-card.tone-danger { border-left: 4px solid #dc2626; }
.workbench-module-card.tone-danger .workbench-module-badge { background: #dc2626; }
.workbench-module-card.tone-info { border-left: 4px solid #0f80d8; }
.workbench-module-card.tone-info .workbench-module-badge { background: #0f80d8; }
.workbench-module-card.tone-ok { border-left: 4px solid #22a06b; }
.workbench-module-card.tone-ok .workbench-module-badge { background: #22a06b; }
.workbench-module-card strong { font-size: 15px; padding-right: 26px; }
.workbench-module-scope {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 12%, var(--panel));
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}
.workbench-module-card small { color: var(--muted-2); line-height: 1.45; }
.workbench-module-arrow { margin-top: auto; color: var(--muted); font-size: 12px; }
.workbench-module-card:hover .workbench-module-arrow { color: var(--primary); }
.workbench-drilldown { padding: 0 14px 14px; }
.workbench-drilldown-header { margin-bottom: 10px; }
.workbench-back-row { display: flex; align-items: center; gap: 12px; }
.workbench-back-button {
  flex-shrink: 0;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}
.workbench-back-button:hover { border-color: var(--primary); color: var(--primary); }

.bank-adjustment-report { display: grid; gap: 18px; }
.bank-adjustment-status { display: flex; align-items: center; gap: 28px; padding: 12px 16px; border: 1px solid var(--border); background: var(--panel-soft); }
.bank-adjustment-status > strong { margin-left: auto; }
.bank-adjustment-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.bank-adjustment-block { display: grid; gap: 0; border: 1px solid var(--border); background: var(--panel); min-width: 0; }
.bank-adjustment-block-title { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--border); background: var(--panel-soft); }
.bank-adjustment-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-width: 0; }
.bank-adjustment-detail-col { min-width: 0; overflow-x: auto; }
.bank-adjustment-detail-col + .bank-adjustment-detail-col { border-left: 1px solid var(--border); }
.bank-adjustment-detail-header { padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--panel-soft); }
.bank-adjustment-detail-grid table { margin: 0; border: 0; width: 100%; }
.bank-adjustment-detail-grid table td.num,
.bank-adjustment-detail-grid table th.num,
.bank-adjustment-summary td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bank-adjustment-detail-grid .subtotal-row td { font-weight: 600; background: var(--panel-soft); }
.bank-adjustment-summary { margin: 0; border: 0; border-top: 1px solid var(--border); width: 100%; }
.bank-adjustment-summary td:first-child { font-weight: 600; }
.bank-adjustment-summary td:last-child { width: 40%; text-align: right; font-variant-numeric: tabular-nums; }
.bank-adjustment-summary .total-row { background: var(--panel-soft); font-weight: 700; }
.bank-diagnosis-dialog { width: min(760px, calc(100vw - 32px)); }
.bank-diagnosis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.bank-diagnosis-grid > div { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--border); background: var(--panel-soft); }
.bank-diagnosis-grid b { padding-top: 8px; border-top: 1px solid var(--border); text-align: right; }
.payroll-horizontal-metrics { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 12px; }
.payroll-horizontal-metrics > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.payroll-horizontal-metrics span { color: var(--muted); }
.payroll-horizontal-metrics strong { font-size: 20px; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .payroll-horizontal-metrics { grid-template-columns: repeat(2, minmax(160px, 1fr)); } }
@media (max-width: 600px) { .payroll-horizontal-metrics { grid-template-columns: 1fr; } }
@media print {
  body.payroll-report-printing * { visibility: hidden !important; }
  body.payroll-report-printing .payroll-print-area, body.payroll-report-printing .payroll-print-area * { visibility: visible !important; }
  body.payroll-report-printing .payroll-print-area { position: absolute; inset: 0; width: 100%; padding: 12mm; background: #fff; color: #000; }
  body.payroll-report-printing .no-print { display: none !important; }
  body.payroll-report-printing .table-scroll { overflow: visible !important; }
}
@media (max-width: 1280px) { .bank-adjustment-comparison { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .bank-adjustment-detail-grid { grid-template-columns: 1fr; } .bank-adjustment-detail-col + .bank-adjustment-detail-col { border-left: 0; border-top: 1px solid var(--border); } .bank-adjustment-status { align-items: flex-start; flex-direction: column; gap: 8px; } .bank-adjustment-status > strong { margin-left: 0; } }
@media (max-width: 720px) { .bank-diagnosis-grid { grid-template-columns: 1fr; } }

@media (max-width: 1200px) {
  .workflow-reminder-summary { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .workflow-reminder-row { grid-template-columns: repeat(3, minmax(130px, 1fr)); height: auto; padding: 10px; }
}

.cost-adjustment-header-row,
.cost-adjustment-footer {
  align-items: end;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.cost-adjustment-table {
  min-width: 1180px;
}

.cost-adjustment-table .col-index {
  width: 56px;
}

.cost-adjustment-table .col-actions {
  width: 116px;
}

.cost-adjustment-table .col-product {
  width: 300px;
}

.cost-adjustment-table th:nth-child(4),
.cost-adjustment-table th:nth-child(5) {
  width: 140px;
}

.cost-adjustment-table th:nth-child(6) {
  width: 86px;
}

.cost-adjustment-table th:nth-child(7) {
  width: 190px;
}

.cost-adjustment-table th:nth-child(8) {
  width: 140px;
}

.cost-adjustment-table th:nth-child(9) {
  width: 180px;
}

.cost-adjustment-table td input,
.cost-adjustment-table td .lookup-select {
  width: 100%;
}

.stock-document-business-row {
  align-items: end;
  margin-top: 0;
}

.modal-mask.stock-document-modal-mask {
  z-index: 300;
  padding: 8px;
  background: rgba(8, 15, 28, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-panel.large.stock-document-modal {
  width: min(1680px, calc(100vw - 16px));
  max-width: none;
  height: min(94vh, 980px);
  max-height: calc(100vh - 16px);
  border: 2px solid color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow:
    0 24px 70px rgba(2, 8, 23, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.68);
}

.stock-document-modal > .modal-header {
  position: sticky;
  top: 0;
  z-index: 12;
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
}

.stock-document-modal > .modal-header h2 {
  color: var(--primary-strong);
}

.stock-document-header-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  align-items: end;
  gap: 8px 10px;
}

.stock-document-header-fields > .grouped-form-fields {
  display: contents;
}

.stock-document-header-fields label {
  min-width: 0;
  gap: 3px;
}

.stock-document-header-fields .lookup-select,
.stock-document-header-fields input {
  min-width: 0;
  width: 100%;
}

.stock-document-header-fields .lookup-select-input-row {
  gap: 3px;
}

.stock-document-header-fields .lookup-clear-button {
  padding-left: 6px;
  padding-right: 6px;
}

.module-quick-nav {
  position: sticky;
  top: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 5%, var(--panel));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.module-quick-nav-title {
  flex: 0 0 auto;
  padding: 0 8px 0 2px;
  color: var(--muted);
  font-weight: 700;
  border-right: 1px solid var(--border);
}

.module-quick-nav button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 14px;
}

.module-quick-nav button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.document-table .col-unit-wide {
  width: 116px;
  min-width: 116px;
}

.document-table .col-warehouse-wide {
  width: 156px;
  min-width: 156px;
}

.document-table .col-product-name,
.document-table .col-specification {
  width: 220px;
  min-width: 220px;
}

.document-table th.col-unit-wide + td,
.document-table td:has(> .lookup-select) {
  overflow: visible;
}

.purchase-header-fields .purchase-employee-field .lookup-select,
.purchase-header-fields .purchase-employee-field .lookup-select-input-row {
  width: 100%;
  max-width: none;
}

.purchase-header-fields .purchase-employee-field .lookup-select-input-row {
  grid-template-columns: minmax(12ch, 1fr) auto;
  gap: 4px;
}

.purchase-header-fields .purchase-employee-field .lookup-select input {
  min-width: 12ch;
  max-width: none;
}

.purchase-header-fields .purchase-employee-field .lookup-clear-button {
  min-width: 5ch;
  padding-inline: 6px;
}

.purchase-header-fields .purchase-warehouse-field {
  flex-basis: 24ch;
  min-width: 24ch;
}

.purchase-header-fields .purchase-warehouse-field .lookup-select,
.purchase-header-fields .purchase-warehouse-field .lookup-select-input-row {
  max-width: none;
  width: 100%;
}

.purchase-header-fields .purchase-warehouse-field .lookup-select-input-row {
  grid-template-columns: minmax(16ch, 1fr) auto;
  gap: 4px;
}

.purchase-header-fields .purchase-warehouse-field .lookup-select input {
  min-width: 16ch;
  max-width: none;
}

.purchase-header-fields .purchase-warehouse-field .lookup-clear-button {
  min-width: 5ch;
  padding-inline: 6px;
}

.purchase-header-fields .purchase-remark-field {
  flex-basis: 24ch;
}

.purchase-header-fields .purchase-remark-field input {
  max-width: none;
  width: 100%;
}

/* 资金单据：六类单据使用独立表单，表头在桌面宽度下保持单行。 */
.fund-document-form {
  min-width: 0;
}

.fund-document-toolbar {
  margin-bottom: 12px;
}

.fund-header-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  margin-bottom: 14px;
}

.fund-header-row > label {
  flex: 1 1 12ch;
  min-width: 11ch;
}

.fund-header-row .fund-header-partner {
  flex-basis: 24ch;
  min-width: 20ch;
}

.fund-header-row .fund-header-operator {
  flex-basis: 18ch;
  min-width: 16ch;
}

.fund-header-row .fund-header-billno {
  flex-basis: 21ch;
  min-width: 18ch;
}

.fund-header-row .lookup-select,
.fund-header-row .lookup-select-input-row,
.fund-header-row input {
  width: 100%;
  max-width: none;
}

.fund-header-row .lookup-select-input-row {
  gap: 4px;
}

.fund-header-row .lookup-clear-button {
  min-width: 5ch;
  padding-inline: 6px;
}

.fund-form-section {
  margin-top: 14px;
}

.fund-form-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.fund-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}

.fund-row-actions button {
  min-width: auto;
  padding-inline: 6px;
}

.fund-detail-table {
  min-width: 1050px;
}

.fund-source-table {
  min-width: 1120px;
}

.fund-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
}

.fund-footer-row > label {
  flex: 0 1 18ch;
}

.fund-footer-row .fund-footer-remark {
  flex: 1 1 30ch;
}

.fund-footer-row .fund-footer-attachment {
  flex: 1 1 28ch;
}

.fund-attachment-summary {
  flex-basis: 100%;
  color: var(--text-muted);
  font-size: 12px;
}

.fund-writeoff-type {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.fund-writeoff-type > span {
  font-weight: 600;
}

.fund-writeoff-type label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.fund-writeoff-type input {
  width: auto;
}

.fund-writeoff-header {
  max-width: 720px;
}

.fund-source-filters label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fund-source-filters .fund-source-partner-filter {
  width: min(280px, 28vw);
  min-width: 200px;
}

.fund-source-partner-filter .lookup-select,
.fund-source-partner-filter .lookup-select-input-row {
  width: 100%;
}

.fund-partner-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.fund-partner-type.customer {
  color: #075985;
  background: #e0f2fe;
}

.fund-partner-type.supplier {
  color: #9a3412;
  background: #ffedd5;
}

html.dark .fund-partner-type.customer {
  color: #bae6fd;
  background: rgba(14, 116, 144, 0.35);
}

html.dark .fund-partner-type.supplier {
  color: #fed7aa;
  background: rgba(154, 52, 18, 0.35);
}

.fund-source-dialog-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
}

.fund-source-dialog-footer .pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.fund-source-dialog-footer .pager label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.fund-source-dialog-footer select {
  width: auto;
}

.fund-modal-mask {
  z-index: 300;
  background: rgba(8, 15, 28, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.fund-source-modal,
.fund-confirm-modal {
  position: relative;
  background: var(--panel);
  border: 2px solid color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow:
    0 24px 70px rgba(2, 8, 23, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.7);
}

.fund-source-modal > .panel-header,
.fund-confirm-modal > .panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
}

.fund-source-modal > .panel-header h2,
.fund-confirm-modal > .panel-header h2 {
  color: var(--primary-strong);
}

.receivable-report-page .panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.receivable-report-filters {
  align-items: flex-end;
  margin-bottom: 12px;
}

.receivable-report-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receivable-report-filters .search-input {
  width: min(360px, 34vw);
}

.receivable-report-query {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
}

.receivable-report-query > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 142px;
}

.receivable-report-query > label:has(.lookup-select) {
  min-width: 220px;
}

.receivable-report-query .lookup-select,
.receivable-report-query .lookup-select-input-row {
  width: 100%;
}

.receivable-report-query .date-separator {
  padding-bottom: 10px;
}

.receivable-report-query .report-check-field {
  min-width: auto;
  flex-direction: row;
  align-items: center;
  padding-bottom: 8px;
  white-space: nowrap;
}

.receivable-report-query .report-check-field input {
  width: auto;
  min-height: auto;
}

.report-print-title {
  display: none;
}

.report-print-only {
  display: none;
}

.report-calculation-note {
  margin: -4px 0 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--panel));
  color: var(--muted);
}

.report-filter-grid .cost-recalculation-sku-field {
  grid-column: span 2;
  min-width: 520px;
}

.report-filter-grid .cost-recalculation-sku-field .sku-search,
.report-filter-grid .cost-recalculation-sku-field .sku-search-input-row,
.report-filter-grid .cost-recalculation-warehouse-field .lookup-select,
.report-filter-grid .cost-recalculation-warehouse-field .lookup-select-input-row {
  width: 100%;
  min-width: 0;
}

.report-filter-grid .cost-recalculation-warehouse-field {
  min-width: 280px;
}

@media (max-width: 900px) {
  .report-filter-grid .cost-recalculation-sku-field {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

.receivable-report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.receivable-report-summary article {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
}

.receivable-report-summary span {
  color: var(--muted);
}

.receivable-report-summary strong {
  color: var(--primary-strong);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.receivable-report-table {
  min-width: 920px;
}

.receivable-report-table td:nth-last-child(-n + 4),
.receivable-report-table tfoot td {
  font-variant-numeric: tabular-nums;
}

.receivable-report-table tfoot td {
  background: color-mix(in srgb, var(--primary) 7%, var(--panel));
  font-weight: 700;
}

.report-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.report-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.report-pagination select {
  width: auto;
}

@media print {
  body.receivable-report-printing * {
    visibility: hidden !important;
  }

  body.receivable-report-printing .receivable-report-print-area,
  body.receivable-report-printing .receivable-report-print-area * {
    visibility: visible !important;
  }

  body.receivable-report-printing .receivable-report-print-area {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    background: #fff;
    color: #111;
  }

  body.receivable-report-printing .receivable-report-print-area .panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.receivable-report-printing .report-screen-header,
  body.receivable-report-printing .report-screen-pagination,
  body.receivable-report-printing .receivable-report-query button,
  body.receivable-report-printing .lookup-clear-button {
    display: none !important;
  }

  body.receivable-report-printing .receivable-report-print-area > .panel > .table-scroll {
    display: none !important;
  }

  body.receivable-report-printing .report-print-only {
    display: block;
  }

  body.receivable-report-printing .report-print-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid #111;
    margin-bottom: 10px;
  }

  body.receivable-report-printing .report-print-title h1 {
    font-size: 20px;
  }

  body.receivable-report-printing .receivable-report-query {
    background: #fff;
    border: 1px solid #777;
  }

  body.receivable-report-printing .receivable-report-query input,
  body.receivable-report-printing .receivable-report-query select {
    border: 0;
    padding: 0;
    min-height: 20px;
  }

  body.receivable-report-printing .table-scroll {
    overflow: visible;
  }

  body.receivable-report-printing .receivable-report-table {
    min-width: 0;
    font-size: 9px;
  }

  body.receivable-report-printing .receivable-report-table th,
  body.receivable-report-printing .receivable-report-table td {
    padding: 5px 4px;
    color: #111;
    border-color: #777;
  }
}

@media (max-width: 1100px) {
  .fund-header-row {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .fund-header-row > label {
    flex-shrink: 0;
  }
}

.purchase-base-fields .bill-no-field input {
  max-width: 26ch;
}

.purchase-base-fields .related-order-field {
  max-width: none;
}

.purchase-base-fields .related-order-field .inline-input-action {
  grid-template-columns: minmax(26ch, 1fr) auto;
}

.purchase-base-fields .related-order-field .inline-input-action input {
  /*min-width: 22ch;*/
  max-width: none;
}

.purchase-partner-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grouped-form-inline-fields {
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  overflow-x: auto;
  align-items: start;
}

.grouped-form-inline-fields-compact {
  grid-auto-columns: minmax(140px, 1fr);
}

.grouped-form-inline-fields-wide {
  grid-auto-columns: minmax(160px, 1fr);
}

.grouped-form-fields-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grouped-form-fields-1 {
  grid-template-columns: 1fr;
}

.grouped-form-section label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  white-space: normal;
  font-size: 12px;
  line-height: 1.45;
}

.purchase-fee-actions-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  white-space: normal;
  font-size: 12px;
  line-height: 1.45;
}

.purchase-settlement-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.purchase-settlement-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-width: 0;
}

.purchase-settlement-row > label,
.purchase-settlement-row > .purchase-fee-actions-field {
  flex: 1 1 18ch;
}

.purchase-settlement-row-secondary > label,
.purchase-settlement-row-tertiary > label {
  flex-basis: 20ch;
}

.grouped-form-section input,
.grouped-form-section select,
.grouped-form-section .lookup-select,
.grouped-form-section .inline-input-action,
.grouped-form-section textarea {
  width: 100%;
  min-width: 0;
}

.compact-field input,
.compact-field select,
.compact-field .lookup-select,
.compact-field .inline-input-action,
.compact-field textarea {
  max-width: 20ch;
}

.compact-field .lookup-select input {
  max-width: 20ch;
}

.related-order-field .inline-input-action {
  display: grid;
  grid-template-columns: minmax(20ch, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.related-order-field .inline-input-action input {
  min-width: 0;
  width: 100%;
  max-width: none;
}

.related-order-field .inline-input-action button {
  white-space: nowrap;
}

.document-settlement-section {
  margin-top: 10px;
}

.multi-settlement-panel {
  max-width: 720px;
  width: calc(100vw - 48px);
}

.multi-settlement-body {
  display: grid;
  gap: 8px;
  padding: 12px 16px 4px;
}

.multi-settlement-head,
.multi-settlement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 140px) 72px;
  gap: 8px;
  align-items: center;
}

.multi-settlement-head {
  color: var(--muted);
  font-size: 12px;
}

.multi-settlement-actions {
  justify-content: space-between;
}

.purchase-order-selector-modal {
  width: min(1100px, calc(100vw - 48px));
}

.purchase-order-suggestions {
  display: grid;
  gap: 8px;
  padding: 0 16px 8px;
}

.purchase-order-suggestions button {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 120px;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
}

.grouped-form-section input,
.grouped-form-section select,
.grouped-form-section .lookup-select input,
.grouped-form-section .inline-input-action input,
.grouped-form-section textarea {
  min-height: 36px;
}

.grouped-form-wide {
  grid-column: 1 / -1;
}

.grouped-form-grid .wide {
  grid-column: 1 / -1;
}

.product-spec-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
}

.product-spec-chip-group-single {
  min-height: 36px;
}

.product-spec-chip {
  position: relative;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-spec-chip:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  transform: translateY(-1px);
}

.product-spec-chip:active:not(:disabled) {
  transform: translateY(0);
}

.product-spec-chip.selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--panel));
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 24%, transparent);
}

.product-spec-chip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--muted) 45%, var(--border));
  color: transparent;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  transition: all 0.16s ease;
}

.product-spec-chip.selected .product-spec-chip-mark {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.add-sku-spec-table {
  position: relative;
  scrollbar-gutter: stable both-edges;
}

.add-sku-spec-table::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--panel) 92%);
  z-index: 3;
}

.add-sku-spec-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
}

.add-sku-spec-table tbody tr:last-child td {
  padding-bottom: 14px;
}

.add-sku-spec-table td {
  vertical-align: top;
}

.add-sku-spec-table .spec-action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-spec-chip-wrap,
.spec-name-item-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.spec-corner-delete {
  position: absolute;
  top: -8px;
  right: -8px;
  min-height: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  background: color-mix(in srgb, var(--danger) 14%, var(--panel));
  color: var(--danger);
  font-size: 10px;
  line-height: 1;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.15s ease 0.18s, transform 0.15s ease 0.18s, visibility 0s linear 0.18s;
}

.product-spec-chip-wrap:hover .spec-corner-delete,
.product-spec-chip-wrap:focus-within .spec-corner-delete,
.spec-name-item-wrap:hover .spec-corner-delete,
.spec-name-item-wrap:focus-within .spec-corner-delete {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0.12s;
}

.spec-corner-delete:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 18%, var(--panel));
  color: var(--danger);
}

.add-sku-modal,
.generate-sku-modal {
  max-height: calc(100vh - 24px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.add-sku-modal > .inner-panel,
.generate-sku-modal > .inner-panel {
  min-height: 0;
}

.add-sku-modal > .inner-panel:first-of-type,
.generate-sku-modal .add-sku-spec-table {
  min-height: 0;
}

.add-sku-modal .grouped-form-grid {
  max-height: 46vh;
  overflow: auto;
  padding-right: 6px;
}

.inline-field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-field-with-action > button {
  white-space: nowrap;
}

.add-sku-product-fields .add-sku-image-field {
  grid-column: 1 / -1;
}

.add-sku-product-fields .add-sku-image-field > span:first-child {
  min-width: 4.5em;
  white-space: nowrap;
}

.add-sku-product-fields .add-sku-image-field .sku-upload-row {
  gap: 12px;
  flex-wrap: wrap;
}

.add-sku-product-fields .add-sku-image-field .sku-upload-row input[type="file"] {
  min-width: 320px;
  flex: 1 1 320px;
}

.add-sku-modal .modal-actions,
.generate-sku-modal .modal-actions {
  position: sticky;
  bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  z-index: 3;
}

html.dark .product-spec-chip.selected,
html[data-theme="dark"] .product-spec-chip.selected {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 32%, transparent);
}

.invoice-field-group label,
.invoice-field-group .invoice-rule-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  white-space: normal;
  font-size: 12px;
  line-height: 1.45;
}

.invoice-field-group input,
.invoice-field-group select,
.invoice-field-group .lookup-select,
.invoice-field-group .inline-input-action {
  width: 100%;
  min-width: 0;
}

.invoice-field-group input,
.invoice-field-group select,
.invoice-field-group .lookup-select input,
.invoice-field-group .inline-input-action input {
  min-height: 36px;
}

.invoice-field-group .inline-input-action input {
  width: 100%;
}

.invoice-attachment-field,
.invoice-remark-field,
.invoice-rule-row {
  min-width: 0;
}

.invoice-remark-field,
.invoice-rule-row {
  grid-column: 2;
}

.invoice-rule-row {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
  padding-top: 2px;
}

.voucher-header-panel .field-grid {
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 8px 10px;
}

.voucher-header-panel .field-grid label {
  min-height: 34px;
}

.voucher-header-panel .field-grid input,
.voucher-header-panel .field-grid select {
  width: min(100%, 150px);
}

.voucher-header-panel .field-grid input[type="file"] {
  width: 190px;
  max-width: 100%;
}

.voucher-header-panel .input-with-button input {
  width: 130px;
}

.voucher-header-panel .grouped-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.voucher-header-panel .grouped-form-section {
  padding: 10px 12px 12px;
  gap: 8px;
}

.voucher-header-panel .grouped-form-title {
  min-height: 24px;
  padding: 0 2px 2px;
}

.voucher-header-panel .grouped-form-fields {
  gap: 8px 12px;
}

.voucher-header-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.4fr);
  gap: 12px;
  align-items: center;
  padding: 8px 12px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.voucher-header-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: end;
}

.voucher-header-side-right {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(140px, 160px);
}

.voucher-header-side label,
.voucher-header-summary label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  white-space: normal;
  font-size: 12px;
  line-height: 1.2;
}

.voucher-header-side input,
.voucher-header-side select,
.voucher-header-side .lookup-select,
.voucher-header-summary input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
}

.voucher-header-side .input-with-button {
  gap: 6px;
}

.voucher-header-side .input-with-button input {
  width: 100%;
}

.voucher-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 160px;
  padding: 2px 6px;
}

.voucher-header-center h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.voucher-header-center span {
  color: var(--muted);
  font-size: 12px;
}

.voucher-header-summary {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.voucher-header-summary input {
  min-height: 34px;
}

.voucher-header-panel .grouped-form-fields-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.voucher-header-panel .grouped-form-fields-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voucher-header-panel .grouped-form-fields-1 {
  grid-template-columns: 1fr;
}

.inline-separator {
  color: var(--muted);
  line-height: 32px;
}

.system-param-table {
  padding: 10px 14px;
}

.system-param-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(48px, 7vw, 112px);
  align-items: stretch;
  padding: 14px 0;
  border-bottom: 1px solid #dfe3e8;
}

.system-param-row:first-child {
  padding-top: 6px;
}

.system-param-row label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
  white-space: normal;
  text-align: left;
  min-height: 58px;
}

.system-param-row label > input,
.system-param-row label > select {
  width: 50%;
  max-width: none;
}

.subject-editor-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.subject-editor-grid label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  white-space: normal;
}

.subject-editor-grid input,
.subject-editor-grid select {
  width: 100%;
}

.subject-editor-grid .wide {
  grid-column: span 2;
}

.subject-table {
  min-width: 1220px;
}

.subject-table th,
.subject-table td {
  padding: 7px 8px;
}

.subject-table .col-index {
  width: 46px;
}

.subject-table .col-code {
  width: 132px;
}

.subject-table td.col-code {
  white-space: nowrap;
}

.subject-code-content {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  vertical-align: middle;
}

.subject-direction-badge {
  display: inline-flex;
  width: 24px;
  height: 22px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.subject-direction-badge.debit {
  background: rgb(35, 135, 235);
}

.subject-direction-badge.credit {
  background: rgb(235, 85, 85);
}

.subject-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.subject-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.subject-category-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 4px;
}

.subject-category-tabs button.active {
  border-color: #237fbe;
  background: #237fbe;
  color: #fff;
}

.subject-search-field {
  display: flex;
  min-width: 260px;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.subject-search-field input {
  width: 210px;
}

.subject-result-count {
  min-width: 62px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.subject-table .col-name {
  width: 180px;
}

.subject-table .col-category {
  width: 78px;
}

.subject-table .col-direction {
  width: 56px;
}

.subject-table .col-parent {
  width: 92px;
}

.subject-table .col-level {
  width: 54px;
}

.subject-table .col-flag {
  width: 72px;
}

.subject-table .col-aux {
  width: 150px;
}

.subject-table .col-actions {
  width: 168px;
}

.subject-table .toolbar-inline {
  flex-wrap: wrap;
  gap: 4px;
}

.subject-table .toolbar-inline button {
  min-height: 28px;
  padding: 0 8px;
}

.system-param-row .switch-field {
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 58px;
}

.system-param-row .toolbar-inline {
  width: 50%;
}

@media (max-width: 900px) {
  .subject-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .subject-search-field {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .subject-search-field input {
    width: 100%;
  }

  .subject-result-count {
    text-align: left;
  }

  .system-param-row {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .system-param-row label > input,
  .system-param-row label > select,
  .system-param-row .toolbar-inline {
    width: 100%;
  }
}

.switch-button {
  position: relative;
  min-width: 74px;
  height: 28px;
  padding: 0 10px 0 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
}

.switch-button::before {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 16px;
  height: 16px;
  content: "";
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch-button.on {
  padding-left: 10px;
  padding-right: 28px;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.switch-button.on::before {
  transform: translateX(47px);
  background: #fff;
}

.field-hint {
  display: block;
  white-space: normal;
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.spec-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  padding: 0 14px 14px;
}

.spec-layout h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  min-height: 30px;
  background: var(--panel-soft);
}

.chip.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.chip-add,
.corner-icon,
.chip-removable button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.chip-add {
  width: 26px;
  height: 26px;
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.corner-icon {
  position: absolute;
  top: 6px;
  right: 6px;
}

.chip-removable {
  padding-right: 22px;
}

.chip-removable button {
  position: absolute;
  top: -6px;
  right: -6px;
}

.chip-removable button:hover,
.corner-icon:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.sortable-list {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.sortable-item {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: grab;
}

.sortable-item strong {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
  color: var(--primary);
  font-size: 12px;
}

.sortable-item.dragging {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  opacity: 0.72;
}

.spec-value-group {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}

.spec-admin-values {
  align-items: center;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
}

.toolbar {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.success-message {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #f0fdf4;
  color: var(--success);
}

.error-message {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: var(--danger);
}

.info-message {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--primary) 18%);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 90%, var(--primary) 10%);
  color: var(--text);
}

.sku-search,
.lookup-select,
.tree-select {
  position: relative;
}

.sku-search input,
.lookup-select input,
.tree-select input {
  width: 100%;
}

.input-with-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.input-with-button button {
  min-width: 48px;
  padding-inline: 8px;
}

.sku-options,
.lookup-options,
.tree-options {
  position: absolute;
  z-index: 20;

.lookup-clear-button,
.lookup-option-create {
  flex: 0 0 auto;
}

.lookup-clear-button {
  white-space: nowrap;
}
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;

.lookup-option-create {
  min-height: 34px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  color: var(--primary);
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  padding: 0 12px;
}
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sku-options-floating {
  position: fixed;
  z-index: 80;
  right: auto;
  max-width: calc(100vw - 24px);
}

.lookup-options-floating {
  position: fixed;
  z-index: 420;
  right: auto;
  max-width: min(520px, calc(100vw - 24px));
}

.tree-options-floating {
  position: fixed;
  z-index: 90;
  right: auto;
  max-width: min(760px, calc(100vw - 24px));
}

.tree-tabs {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.tree-tabs button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--panel-soft);
}

.tree-tabs button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.tree-empty {
  padding: 10px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-soft) 70%, var(--panel));
}

.filter-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  font-weight: 700;
}

.inline-label,
.inline-separator {
  color: var(--muted);
  white-space: nowrap;
}

.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.inline-control input[type="number"] {
  width: 68px;
}

.switch-line {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.sku-option,
.lookup-option,
.tree-option {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  padding: 8px 12px;
  text-align: left;
}

.sku-option.active,
.sku-option:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--primary);
}

.tree-option-match {
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  color: var(--primary);
}

.tree-option.active,
.tree-option:hover {
  background: color-mix(in srgb, var(--primary) 14%, var(--panel));
  color: var(--primary);
}

.sku-option strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.35;
}

.sku-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.sku-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.sku-option-head {
  min-height: 34px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.sku-option-head:hover {
  color: var(--muted);
  border-color: var(--border);
}

.sku-options .sku-option {
  min-width: 930px;
}

.product-search-field {
  position: relative;
  min-width: min(420px, 100%);
}

.product-search-suggestions {
  position: absolute;
  z-index: 75;
  top: calc(100% + 4px);
  left: 0;
  width: min(720px, calc(100vw - 40px));
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-search-suggestions button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  display: grid;
  grid-template-columns: minmax(140px, .75fr) minmax(260px, 1.45fr);
  justify-content: stretch;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.product-search-suggestions button:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.product-search-suggestions strong,
.product-search-suggestions span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: var(--muted);
}

.sku-empty strong {
  color: var(--text);
}

.lookup-option {
  display: flex;
  padding: 0 12px;
}

.lookup-option-head {
  min-height: 32px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  cursor: default;
}

.lookup-option.active,
.lookup-option:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--primary);
}

.tree-group-title {
  padding: 7px 12px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--panel-soft);
}

.tree-option {
  padding: 8px 12px 8px 20px;
}

.sku-option small {
  grid-column: 2;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.aux-grid {
  min-width: 360px;
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 6px;
}

.document-page {
  display: grid;
  gap: 12px;
}

.document-page.business-document-page {
  min-height: calc(100vh - 136px);
  display: flex;
  flex-direction: column;
}

.document-page.business-document-page > .panel:last-of-type {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.document-page.business-document-page > .panel:last-of-type .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.document-title {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
}

.workflow-page {
  gap: 12px;
}

.workflow-search-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.workflow-role-controls {
  display: grid;
  gap: 10px;
}

.workflow-search-box {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}

.workflow-search-box span {
  flex: 0 0 auto;
  font-weight: 700;
}

.workflow-search-box input {
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  padding: 0;
  background: transparent;
}

.workflow-search-box input:focus {
  outline: none;
}

.workflow-search-box button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, var(--primary) 12%), var(--panel));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.workflow-ai-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, var(--primary) 12%), var(--panel));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.workflow-ai-button:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.workflow-ai-button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.workflow-ai-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.workflow-role-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.workflow-role-row button {
  min-width: 88px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, var(--primary) 12%), var(--panel));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  justify-content: flex-start;
  text-align: left;
}

.workflow-role-toggle {
  min-width: auto;
}

.workflow-root-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.workflow-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workflow-card {
  min-height: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.workflow-card:hover,
.workflow-card.active {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 14px 30px rgba(15, 128, 216, 0.12);
}

.workflow-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.workflow-card-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.workflow-card-head strong {
  font-size: 16px;
  line-height: 1.2;
}

.workflow-card-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
  color: var(--primary-strong);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.workflow-card-step {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.workflow-card-summary {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.95em;
}

.workflow-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--primary-strong);
  font-size: 12px;
}

.workflow-node-preview {
  display: grid;
  gap: 8px;
}

.workflow-node-preview-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.workflow-node-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 18%, var(--panel));
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.workflow-node-dot.locked {
  background: color-mix(in srgb, var(--muted) 24%, var(--panel));
  color: var(--muted);
}

.workflow-node-dot.operable {
  background: color-mix(in srgb, var(--primary) 24%, var(--panel));
  color: var(--primary);
}

.workflow-node-dot.done {
  background: color-mix(in srgb, var(--success) 24%, var(--panel));
  color: var(--success);
}

.workflow-node-dot.current {
  background: var(--primary);
  color: #fff;
}

.workflow-node-dot.next {
  background: color-mix(in srgb, var(--muted) 18%, var(--panel));
  color: var(--muted);
}

.workflow-node-state {
  justify-self: end;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.workflow-node-state.done,
.workflow-step.done .workflow-step-index {
  background: color-mix(in srgb, var(--success) 16%, var(--panel));
  color: var(--success);
}

.workflow-node-state.current,
.workflow-step.current .workflow-step-index {
  background: var(--primary);
  color: #fff;
}

.workflow-node-state.next,
.workflow-step.next .workflow-step-index {
  background: color-mix(in srgb, var(--muted) 12%, var(--panel));
  color: var(--muted);
}

.workflow-node-preview-item strong {
  display: block;
  margin-bottom: 2px;
}

.workflow-node-preview-item small {
  color: var(--muted);
  line-height: 1.45;
}

.workflow-node-preview-item strong,
.workflow-node-preview-item small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workflow-more-steps {
  color: var(--muted);
  font-size: 12px;
}

.workflow-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.workflow-card-foot span:last-child {
  text-align: right;
  white-space: nowrap;
}

.workflow-detail {
  position: sticky;
  top: 12px;
}

.workflow-detail-body {
  padding: 12px 14px 14px;
}

.workflow-step-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.workflow-step.operable {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}

.workflow-step.locked {
  opacity: 0.72;
}

.workflow-step.done {
  border-color: color-mix(in srgb, var(--success) 26%, var(--border));
}

.workflow-step.current {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  box-shadow: 0 10px 20px rgba(15, 128, 216, 0.08);
}

.workflow-step.next {
  background: color-mix(in srgb, var(--panel-soft) 70%, var(--panel) 30%);
}

.workflow-step-index {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.workflow-step strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.workflow-step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.workflow-step-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.workflow-role-tip {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--primary-strong);
}

.workflow-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-card-actions button {
  min-height: 30px;
}

.workflow-card-actions button {
  min-height: 30px;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workflow-flow-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--muted);
}

.workflow-flow-empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.workflow-flow-empty p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.workflow-journey {
  display: grid;
  gap: 12px;
}

.workflow-journey-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.workflow-journey-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  display: grid;
  gap: 8px;
  min-height: 156px;
}

.workflow-journey-card strong {
  font-size: 14px;
}

.workflow-journey-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workflow-journey-card button {
  width: fit-content;
}

@media (max-width: 1280px) {
  .workflow-hero,
  .workflow-root-grid {
    grid-template-columns: 1fr;
  }

  .workflow-journey-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-detail {
    position: static;
  }

  .document-title h2 {
    margin: 8px 0 4px;
    font-size: 24px;
  }

  .document-title p {
    margin: 0;
    color: var(--muted);
  }
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: rgba(15, 128, 216, 0.1);
  color: var(--primary);
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
}

.document-table {
  min-width: 1280px;
}

.product-sku-editor-table {
  min-width: max-content;
  width: max-content;
  table-layout: auto;
}

.product-sku-freeze-table {
  border-collapse: collapse;
}

.product-sku-freeze-table th,
.product-sku-freeze-table td {
  white-space: nowrap;
}

.product-sku-freeze-table .sku-freeze-col {
  position: sticky;
  z-index: 2;
  background: var(--panel);
  background-clip: padding-box;
  box-sizing: border-box;
  box-shadow: 1px 0 0 var(--border);
}

.product-sku-freeze-table thead .sku-freeze-col {
  z-index: 4;
  background: var(--panel-soft);
}

.sku-link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  min-height: auto;
  justify-content: flex-start;
}

.declaration-elements-field {
  display: grid;
  gap: 8px;
}

.declaration-elements-actions {
  padding: 0;
  gap: 8px;
}

.declaration-elements-actions input {
  min-width: 320px;
}

.declaration-element-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.declaration-element-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
}

.declaration-element-chip button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger, #c62828);
}

.document-table .col-index {
  width: 58px;
}

.document-table .col-product {
  width: 300px;
}

.purchase-document-table {
  table-layout: fixed;
}

.purchase-document-table .col-product {
  width: 200px;
}

.purchase-document-table .col-product-name,
.purchase-document-table .col-specification {
  width: 200px;
  min-width: 200px;
}

.purchase-document-table .purchase-expense-money-column {
  width: 150px;
  min-width: 150px;
}

.purchase-document-table td.purchase-expense-money-column input {
  width: 100%;
  min-width: 128px;
  font-variant-numeric: tabular-nums;
}

.purchase-document-table th:nth-child(1),
.purchase-document-table td:nth-child(1) {
  width: 6ch;
  min-width: 6ch;
}

.purchase-document-table th:nth-child(1),
.purchase-document-table td:nth-child(1) {
  text-align: center;
}

.purchase-document-table th.purchase-expense-money-column,
.purchase-document-table td.purchase-expense-money-column {
  width: 150px;
  min-width: 150px;
  text-align: right;
}

.document-table .col-actions {
  width: 230px;
}

.invoice-document-table {
  min-width: 1536px;
  table-layout: fixed;
}

.invoice-document-table .col-product {
  width: 220px;
}

.invoice-document-table .col-actions {
  width: 112px;
}

.invoice-document-table th:nth-child(1),
.invoice-document-table td:nth-child(1) {
  width: 56px;
}

.invoice-document-table th:nth-child(3),
.invoice-document-table td:nth-child(3) {
  width: 150px;
}

.invoice-document-table th:nth-child(4),
.invoice-document-table td:nth-child(4) {
  width: 132px;
}

.invoice-document-table th:nth-child(5),
.invoice-document-table td:nth-child(5) {
  width: 116px;
}

.invoice-document-table th:nth-child(6),
.invoice-document-table td:nth-child(6) {
  width: 92px;
}

.invoice-document-table th:nth-child(7),
.invoice-document-table td:nth-child(7) {
  width: 124px;
}

.invoice-document-table th:nth-child(8),
.invoice-document-table td:nth-child(8) {
  width: 90px;
}

.invoice-document-table th:nth-child(9),
.invoice-document-table td:nth-child(9) {
  width: 96px;
}

.invoice-document-table th:nth-child(10),
.invoice-document-table td:nth-child(10),
.invoice-document-table th:nth-child(11),
.invoice-document-table td:nth-child(11),
.invoice-document-table th:nth-child(12),
.invoice-document-table td:nth-child(12),
.invoice-document-table th:nth-child(13),
.invoice-document-table td:nth-child(13) {
  width: 118px;
}

.invoice-document-table th,
.invoice-document-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.invoice-document-table th {
  height: 44px;
  padding: 10px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.invoice-document-table td {
  min-height: 48px;
  padding: 7px 6px;
}

.invoice-document-table input,
.invoice-document-table select,
.invoice-document-table .lookup-select input {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.invoice-document-table .lookup-select {
  width: 100%;
}

.invoice-number-head {
  text-align: center;
}

.invoice-number-cell {
  text-align: right;
}

.invoice-number-cell input {
  text-align: right;
}

.invoice-tax-rate-cell input {
  text-align: center;
}

.invoice-document-table td:nth-child(2),
.invoice-document-table td:nth-child(3),
.invoice-document-table td:nth-child(4),
.invoice-document-table td:nth-child(5),
.invoice-document-table td:nth-child(6),
.invoice-document-table td:nth-child(7) {
  font-size: 13px;
}

@media (max-width: 1280px) {
  .invoice-document-page {
    min-height: 0;
  }

  .invoice-document-page .grouped-form-fields-3,
  .invoice-document-page .grouped-form-fields-2 {
    grid-template-columns: 1fr;
  }

  .invoice-compact-grid {
    grid-template-columns: 1fr;
    gap: 10px 0;
  }

  .invoice-inline-field {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .invoice-detail-panel {
    min-height: 0;
    grid-template-rows: auto auto auto;
  }

  .invoice-detail-scroll {
    min-height: 320px;
    max-height: none;
  }

  .invoice-field-grid {
    grid-template-columns: 1fr;
  }

  .invoice-field-group-ticket,
  .invoice-field-group-party,
  .invoice-field-group-extra,
  .invoice-remark-field,
  .invoice-rule-row {
    grid-column: 1;
  }

  .invoice-field-group-fields-3,
  .invoice-field-group-fields-2,
  .invoice-field-group-fields-extra,
  .invoice-source-entry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .invoice-source-entry {
    grid-template-columns: 1fr;
  }
}

.document-table input,
.document-table select {
  width: 100%;
}

.sku-image-cell {
  min-width: 132px;
  display: grid;
  grid-template-columns: 44px minmax(76px, 1fr);
  align-items: start;
  gap: 8px;
}

.sku-image-cell .image-preview-button,
.sku-image-cell .sku-empty-upload,
.product-attachment-card .image-preview-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.sku-empty-upload {
  width: 40px;
  height: 40px;
  border: 1px dashed var(--border) !important;
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.1;
}

.sku-image-cell button {
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
  padding-inline: 8px;
}

.sku-image-cell img,
.sku-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-soft);
}

.sku-recycle-table {
  min-width: 1100px;
}

.sku-setup-modal,
.add-sku-modal {
  max-height: none;
}

.editor-page {
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: 12px;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--bg) 94%, var(--panel) 6%);
}

.editor-page-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.editor-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
  flex: 0 0 auto;
}

.editor-page-header h2 {
  margin: 0;
}

.editor-page-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.editor-page-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.master-data-editor-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}

.product-editor-shell .modal-header,
.sku-editor-shell .modal-header {
  background: var(--panel-bg);
  z-index: 1;
  flex: 0 0 auto;
}

.product-editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
  flex: 0 0 auto;
}

.product-editor-tabs button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  white-space: nowrap;
}

.product-editor-tabs button.active {
  color: var(--primary);
  background: var(--panel);
  font-weight: 700;
}

.product-master-submenu {
  justify-content: flex-start;
  gap: 8px;
}

.spec-admin-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.spec-admin-name-card,
.spec-admin-value-card,
.spec-admin-value-add {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 10px 38px 10px 14px;
}

.spec-admin-name-card {
  width: min(200px, 100%);
  justify-content: flex-start;
  font-weight: 700;
}

.spec-admin-name-label {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.spec-admin-values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  padding-left: 12px;
}

.spec-admin-value-card {
  min-width: 96px;
  min-height: 54px;
  padding-right: 34px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-soft) 70%, var(--panel));
}

.spec-admin-value-card-preview {
  min-width: 72px;
}

.spec-admin-value-add {
  min-width: 72px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
  padding: 10px 14px;
  font-size: 22px;
  font-weight: 700;
}

.spec-admin-value-card .corner-icon,
.spec-admin-value-card-preview .corner-icon,
.spec-admin-name-card .corner-icon {
  top: 6px;
  right: 6px;
}

.modal-panel.compact-modal {
  width: min(460px, 92vw);
}

.spec-value-modal {
  width: min(420px, 92vw);
}

.brand-quick-create-modal {
  width: min(760px, 92vw);
  height: min(620px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-quick-create-modal .grouped-form-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.product-editor-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px;
}

.product-editor-shell .inner-panel {
  margin: 0 0 14px;
}

.product-editor-actions {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.product-editor-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-editor-shell .product-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-editor-shell .product-editor-scroll {
  flex: 1 1 auto;
  min-height: 0;
}

.product-editor-page .editor-page-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.product-editor-page .editor-page-body {
  padding: 0 12px 12px;
}

.sku-editor-page .editor-page-shell {
  overflow: auto;
}

.sku-editor-page .editor-page-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.sku-editor-page .panel.inner-panel {
  margin-bottom: 12px;
}

.sku-editor-page .editor-page-header,
.product-editor-page .editor-page-header {
  position: sticky;
  top: 0;
  z-index: 3;
}

.product-editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.member-price-input {
  min-width: 92px;
  width: 100%;
  box-sizing: border-box;
}

.sku-member-price-table th:nth-child(4),
.sku-member-price-table td:nth-child(4),
.sku-member-price-table th:nth-child(5),
.sku-member-price-table td:nth-child(5) {
  width: 112px;
}

.sku-member-price-table th:nth-child(6),
.sku-member-price-table td:nth-child(6) {
  min-width: 140px;
}

.product-attachments-field {
  display: grid;
  gap: 8px;
}

.product-editor-body .grouped-form-fields-4 {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.product-editor-body .grouped-form-fields-4 > label.grouped-form-wide {
  grid-column: 1 / -1;
}

.product-attachment-hint {
  line-height: 1.4;
}

.product-attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 8px;
}

.product-attachment-card {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.product-attachment-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.product-attachment-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.product-attachment-meta span {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-attachment-empty {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-dialog {
  width: min(560px, 92vw);
}

.feedback-dialog.modal-panel,
.confirm-panel.feedback-dialog {
  position: relative;
  z-index: 3100;
}

.modal-mask.feedback-mask {
  z-index: 3000;
}

.feedback-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feedback-dialog-header h2 {
  margin: 0;
}

.feedback-dialog-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.feedback-dialog-icon.success {
  background: color-mix(in srgb, var(--success) 20%, var(--panel));
  color: var(--success);
}

.feedback-dialog-icon.error {
  background: color-mix(in srgb, var(--danger) 16%, var(--panel));
  color: var(--danger);
}

.feedback-dialog-icon.info {
  background: color-mix(in srgb, var(--primary) 14%, var(--panel));
  color: var(--primary);
}

.feedback-dialog-details {
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.warning-copy {
  border-left: 4px solid color-mix(in srgb, var(--danger) 68%, #f59e0b);
  padding-left: 10px;
  color: color-mix(in srgb, var(--danger) 78%, var(--text));
}

.image-preview-dialog {
  width: min(960px, calc(100vw - 24px));
}

.image-preview-stage {
  padding: 14px;
  max-height: calc(100vh - 160px);
  overflow: auto;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
}

.image-preview-stage img {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.attachment-upload-modal {
  width: min(860px, calc(100vw - 24px));
}

.attachment-upload-stack {
  padding: 14px 14px 0;
  display: grid;
  gap: 8px;
}

.attachment-upload-file-row {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.attachment-upload-file-name {
  padding-bottom: 4px;
}

.attachment-cropper {
  padding: 10px 14px 0;
  display: grid;
  justify-items: center;
}

.attachment-upload-preview,
.attachment-crop-stage {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  overflow: hidden;
}

.attachment-upload-preview {
  display: grid;
  place-items: center;
}

.attachment-crop-image,
.attachment-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.attachment-crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.5);
  background: transparent;
  cursor: move;
}

.attachment-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow);
}

.attachment-crop-handle.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.attachment-crop-handle.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.attachment-crop-handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.attachment-crop-handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }

.attachment-upload-empty {
  padding: 24px;
  text-align: center;
}

.product-measurement-unit-field {
  display: grid;
  gap: 8px;
}

.product-measurement-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-measurement-unit-preview {
  line-height: 1.5;
  white-space: normal;
}

.multi-unit-modal {
  width: min(1260px, calc(100vw - 24px));
}

.multi-unit-modal .table-scroll {
  margin: 0 10px;
}

.multi-unit-modal .document-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.multi-unit-modal .document-table th.multi-unit-column-unit,
.multi-unit-modal .document-table td.multi-unit-cell-unit {
  width: 10ch;
}

.multi-unit-modal .document-table th.multi-unit-column-ratio,
.multi-unit-modal .document-table td.multi-unit-cell-ratio {
  width: 18ch;
}

.multi-unit-modal .document-table td.multi-unit-cell-ratio {
  overflow: hidden;
}

.multi-unit-modal .document-table th:nth-child(3),
.multi-unit-modal .document-table td:nth-child(3) {
  width: 8ch;
}

.multi-unit-ratio-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.multi-unit-ratio-wrap input {
  width: 20ch !important;
  min-width: 20ch;
}

.product-measurement-unit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-measurement-unit-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
}

.multi-unit-times,
.multi-unit-base-unit {
  white-space: nowrap;
  flex: 0 0 auto;
}

.multi-unit-modal .document-table input,
.multi-unit-modal .document-table .lookup-select {
  width: 100%;
}

.product-editor-actions.toolbar {
  padding: 12px 14px;
}

@media (max-width: 1440px) {
  .product-editor-body .grouped-form-fields-4 {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 1100px) {
  .product-editor-body .grouped-form-fields-4 {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 760px) {
  .product-editor-body .grouped-form-fields-4 {
    grid-template-columns: 1fr;
  }
}

.sku-shelf-life-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 88px 72px 88px;
  gap: 6px;
  align-items: center;
}

.sku-shelf-life-grid input,
.sku-shelf-life-grid select {
  width: 100%;
}

.sku-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: center;
}

.inline-add-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(180px, 320px) auto auto;
  gap: 8px;
  align-items: center;
}

.add-chip {
  min-width: 32px;
  justify-content: center;
  font-weight: 700;
}

.spec-value-preview {
  padding: 12px 14px;
}

.voucher-paper {
  background: var(--panel);
}

.voucher-paper .panel-header {
  justify-content: center;
  position: relative;
}

.voucher-paper .panel-header h2 {
  font-size: 22px;
  letter-spacing: 0;
}

.voucher-paper .panel-header .row-actions {
  position: absolute;
  right: 14px;
}

.voucher-paper .document-table th,
.voucher-paper .document-table td {
  border: 1px solid var(--border);
}

.voucher-paper .document-table th {
  text-align: center;
  background: var(--panel-soft);
}

.voucher-paper .document-table th small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.voucher-money-cell {
  padding: 0 !important;
  position: relative;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / 11 - 1px),
    color-mix(in srgb, var(--border) 80%, transparent) calc(100% / 11 - 1px),
    color-mix(in srgb, var(--border) 80%, transparent) calc(100% / 11)
  );
}

.voucher-money-cell::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent 0, transparent calc(100% / 11 * 9), color-mix(in srgb, var(--danger) 45%, transparent) calc(100% / 11 * 9), color-mix(in srgb, var(--danger) 45%, transparent) calc(100% / 11 * 9 + 1px), transparent calc(100% / 11 * 9 + 1px)),
    linear-gradient(to right, transparent 0, transparent calc(100% / 11 * 6), color-mix(in srgb, var(--primary) 45%, transparent) calc(100% / 11 * 6), color-mix(in srgb, var(--primary) 45%, transparent) calc(100% / 11 * 6 + 1px), transparent calc(100% / 11 * 6 + 1px));
}

.voucher-money-cell .voucher-amount-input {
  height: 44px;

.lookup-option-create {
  min-height: 34px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  color: var(--primary);
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  padding: 0 12px;
}
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px;
  caret-color: var(--primary);
  position: relative;
  z-index: 1;
  color: transparent;
  opacity: 0;
}

.voucher-money-cell:focus-within .voucher-amount-input {
  color: transparent;
  opacity: 0;
}

.voucher-money-digits {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  align-items: center;
  pointer-events: none;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.voucher-money-digits span {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 100%;
}

.voucher-money-digits span.active {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.voucher-money-cell:focus-within .voucher-money-digits {
  opacity: 1;
}

.voucher-money-cell:focus-within .voucher-money-digits span.active {
  opacity: 1;
}

.voucher-paper .document-table tfoot td {
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
}

.voucher-detail-paper {
  margin: 0;
  box-shadow: none;
}

.voucher-meta-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px 14px;
  padding: 0 0 12px;
  color: var(--text);
  font-size: 13px;
}

.voucher-detail-paper .voucher-amount-input {
  pointer-events: none;
}

.voucher-paper .document-table td:nth-child(3),
.voucher-paper .document-table td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.document-summary {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  background: var(--panel-soft);
}

.document-summary.document-summary-three-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  gap: 12px;
}

.document-summary.document-summary-three-columns span,
.document-summary.document-summary-three-columns strong {
  min-width: 0;
  text-align: center;
}

.document-table td.profit-negative,
.document-summary .profit-negative {
  color: #dc2626;
  font-weight: 700;
}

.document-table tr.profit-negative-row > td {
  background: color-mix(in srgb, #ef4444 10%, var(--panel));
}

.document-table tr.profit-negative-row:hover > td {
  background: color-mix(in srgb, #ef4444 14%, var(--panel));
}

.profit-health-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}

.profit-health-badge.is-good {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.profit-health-badge.is-low {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.profit-health-badge.is-loss {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.sales-profit-summary {
  margin-top: 8px;
  border-top: 0;
  border: 1px solid color-mix(in srgb, #f97316 24%, var(--border));
  background: color-mix(in srgb, #f97316 8%, var(--panel-soft));
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.dashboard-summary-card {
  min-height: 220px;
}

.dashboard-summary-body {
  padding: 12px 14px 14px;
}

.dashboard-summary-body .block-copy {
  padding: 0 0 10px;
}

.dashboard-summary-list {
  margin: 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 8px;
  color: var(--text);
}

.dashboard-summary-list li {
  line-height: 1.5;
}

.module-card {
  min-height: 180px;
}

.module-list {
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.module-list button {
  min-width: 128px;
  justify-content: center;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

td.row-actions {
  display: table-cell;
  vertical-align: middle;
}

.row-actions button {
  min-height: 24px;
  padding: 0 6px;
  font-size: 12px;
}

td.row-actions > button {
  margin: 3px 6px 3px 0;
  vertical-align: middle;
}

td.row-actions > button:last-child {
  margin-right: 0;
}

.inline-edit-row input {
  min-width: 96px;
}

.inline-pair {
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) minmax(120px, 1fr);
  gap: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.text-muted { color: var(--text-muted); }
.text-warning { color: #e67e22; font-weight: 600; }

button.audit-action {
  color: #fff;
  border-color: #16845b;
  background: #16845b;
}

button.reverse-audit-action {
  color: #fff;
  border-color: #c2410c;
  background: #c2410c;
}

button.audit-action:hover { background: #116b49; }
button.reverse-audit-action:hover { background: #9a3412; }
.print-count-cell { white-space: nowrap; font-size: 12px; }

.status-pill.success {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}

.status-pill.warning {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.reconcile-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 520px;
}

.reconcile-pane {
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel-header.compact {
  padding: 8px 10px;
  min-height: 38px;
}

.panel-header.compact h3 {
  margin: 0;
  font-size: 14px;
}

.compact-table th,
.compact-table td {
  padding: 6px 8px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .reconcile-split-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }
}

.link-button {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.modal-panel.wide-modal {
  width: min(1560px, calc(100vw - 48px));
}

.tax-report-card {
  cursor: default;
}

.tax-report-card > label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.tax-preview-mask {
  z-index: 1300;
}

.tax-preview-modal {
  display: flex;
  flex-direction: column;
  height: min(88vh, 900px);
  overflow: hidden;
}

.tax-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.tax-preview-header h2 {
  margin: 8px 0 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.tax-preview-header button,
.tax-preview-tabs button,
.tax-report-card .link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tax-preview-tabs {
  display: flex;
  gap: 4px;
  padding-top: 14px;
  overflow-x: auto;
}

.tax-preview-tabs button.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.tax-preview-table-wrap {
  flex: 1;
  min-height: 0;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
}

.tax-preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #17212b;
  background: #fff;
}

.tax-preview-table td {
  min-width: 92px;
  max-width: 320px;
  height: 28px;
  padding: 6px 9px;
  border: 1px solid #cfd7df;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.tax-preview-table td.centered {
  font-weight: 700;
  text-align: center;
}

.tax-preview-table tr:first-child td {
  font-weight: 700;
  text-align: center;
}

@media (max-width: 720px) {
  .tax-preview-modal {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px);
  }

  .tax-preview-header {
    flex-direction: column;
  }
}

.document-editor-mask {
  place-items: stretch;
  padding: 0;
  background: transparent;
}

.document-editor-mask .modal-panel.wide-modal.purchase-document-modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.purchase-document-modal > .panel-header {
  padding: 8px 12px;
  min-height: 40px;
  flex: 0 0 auto;
}

.document-editor-mask .purchase-document-modal > .panel-header:first-child {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.document-editor-mask .purchase-document-modal > .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 24;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.purchase-document-modal > .error-message {
  margin: 8px 12px 0;
  flex: 0 0 auto;
}

.purchase-document-modal > .inner-panel {
  margin: 10px 12px 0;
  flex: 0 0 auto;
}

.purchase-document-modal > .inner-panel:first-of-type {
  padding-bottom: 10px;
}

.purchase-document-modal > .document-basic-info-panel {
  position: relative;
  z-index: 2;
  overflow: visible;
}

.purchase-document-modal > .inner-panel:last-of-type {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.purchase-document-modal > .inner-panel:last-of-type .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* 发票录入使用摘要而不是常驻商品大表，整张表单必须参与同一个滚动容器。 */
.document-editor-mask .purchase-document-modal.invoice-document-modal {
  display: block;
  height: 100vh;
  max-height: 100vh;
  overflow-y: scroll;
  padding-bottom: 72px;
}

.document-editor-mask .purchase-document-modal.invoice-document-modal > .inner-panel:last-of-type {
  display: block;
  flex: none;
  min-height: auto;
  overflow: visible;
}

.document-editor-mask .purchase-document-modal.invoice-document-modal > .inner-panel:last-of-type .table-scroll {
  display: none;
  flex: none;
  min-height: auto;
  overflow: visible;
}

.document-editor-mask .purchase-document-modal.invoice-document-modal > .modal-actions {
  position: static;
  margin: 12px 12px 0;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.document-page.business-document-page .grouped-form-grid,
.document-editor-mask .purchase-document-modal .grouped-form-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.document-page.business-document-page .grouped-form-section,
.document-editor-mask .purchase-document-modal .grouped-form-section {
  padding: 10px 10px 12px;
  gap: 8px;
}

.document-page.business-document-page .grouped-form-grid > .grouped-form-section:not(:first-child),
.document-editor-mask .purchase-document-modal .grouped-form-grid > .grouped-form-section:not(:first-child) {
  display: contents;
}

.document-page.business-document-page .grouped-form-grid > .grouped-form-section:not(:first-child) > .grouped-form-title,
.document-editor-mask .purchase-document-modal .grouped-form-grid > .grouped-form-section:not(:first-child) > .grouped-form-title {
  display: none;
}

.document-page.business-document-page .grouped-form-title,
.document-editor-mask .purchase-document-modal .grouped-form-title {
  min-height: 24px;
  padding: 0 2px 2px;
  font-size: 12px;
}

.document-page.business-document-page .grouped-form-fields,
.document-editor-mask .purchase-document-modal .grouped-form-fields {
  gap: 8px 10px;
}

.document-page.business-document-page .grouped-form-section label,
.document-editor-mask .purchase-document-modal .grouped-form-section label {
  gap: 4px;
  line-height: 1.25;
}

.document-page.business-document-page .grouped-form-section input,
.document-page.business-document-page .grouped-form-section select,
.document-page.business-document-page .grouped-form-section .lookup-select,
.document-page.business-document-page .grouped-form-section .inline-input-action,
.document-page.business-document-page .grouped-form-section textarea,
.document-editor-mask .purchase-document-modal .grouped-form-section input,
.document-editor-mask .purchase-document-modal .grouped-form-section select,
.document-editor-mask .purchase-document-modal .grouped-form-section .lookup-select,
.document-editor-mask .purchase-document-modal .grouped-form-section .inline-input-action,
.document-editor-mask .purchase-document-modal .grouped-form-section textarea {
  min-height: 32px;
}

/* 外贸订单/合同字段较多，一般资料使用紧凑八列，底部长文本和费用保持较宽布局。 */
.document-editor-mask .purchase-document-modal .trade-terms-panel {
  margin-top: 6px;
  padding: 8px 10px 10px;
}

.document-editor-mask .purchase-document-modal .trade-terms-panel .panel-header {
  min-height: 28px;
  padding: 0 0 6px;
}

.document-editor-mask .purchase-document-modal .trade-terms-panel .panel-header h3 {
  margin: 0;
  font-size: 13px;
}

.document-editor-mask .purchase-document-modal .trade-terms-six-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 12px;
}

.document-editor-mask .purchase-document-modal .trade-terms-eight-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px 8px;
}

.document-editor-mask .purchase-document-modal .trade-terms-eight-grid > label {
  gap: 1px;
  font-size: 10px;
}

.document-editor-mask .purchase-document-modal .trade-terms-eight-grid input,
.document-editor-mask .purchase-document-modal .trade-terms-eight-grid select {
  min-height: 26px;
  height: 26px;
  padding: 2px 5px;
  font-size: 11px;
}

.document-editor-mask .purchase-document-modal .trade-terms-six-grid > label {
  min-width: 0;
  gap: 2px;
  font-size: 11px;
}

.document-editor-mask .purchase-document-modal .trade-terms-six-grid input,
.document-editor-mask .purchase-document-modal .trade-terms-six-grid select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  height: 28px;
  padding: 3px 7px;
  font-size: 12px;
}

.document-editor-mask .purchase-document-modal .trade-terms-text-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  height: 52px;
  padding: 5px 7px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.3;
}

.document-editor-mask .purchase-document-modal .trade-terms-panel .grouped-form-title {
  min-height: 22px;
  margin-top: 6px;
  padding-bottom: 2px;
}

.quotation-special-panel { margin-top: 6px; padding: 8px 10px 10px; }
.quotation-eight-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px 8px; }
.quotation-eight-grid > label, .quotation-copy-grid > label { display: flex; min-width: 0; flex-direction: column; gap: 2px; font-size: 10px; }
.quotation-eight-grid input { width: 100%; min-width: 0; height: 26px; min-height: 26px; padding: 2px 5px; font-size: 11px; }
.quotation-copy-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px 8px; margin-top: 6px; }
.quotation-copy-grid textarea { width: 100%; min-height: 42px; height: 42px; padding: 4px 6px; resize: vertical; font-size: 11px; line-height: 1.25; }
.quotation-eight-grid .lookup-select { min-width: 0; }
.quotation-eight-grid .lookup-select-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 22px; gap: 2px; }
.quotation-eight-grid .lookup-select-input-row:not(:has(.lookup-clear-button)) { grid-template-columns: minmax(0, 1fr); }
.quotation-eight-grid .lookup-clear-button { width: 22px; min-width: 22px; height: 26px; min-height: 26px; padding: 0; font-size: 15px; line-height: 1; }
.quotation-freight-rule { margin-top: 7px; padding: 7px 9px; border-left: 3px solid #2563eb; background: rgba(37, 99, 235, .08); font-size: 12px; }
.quotation-freight-rule.warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, .1); }
.quotation-total-strip { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; margin-top: 8px; padding: 7px 10px; background: var(--panel-soft); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.quotation-inline-freight-rule { margin-left: auto; padding-left: 12px; border-left: 3px solid #2563eb; }
.quotation-inline-freight-rule.warning { border-left-color: #f59e0b; }
.quotation-preview-mask { z-index: 1300; }
.quotation-reference-mask { z-index: 1400; }
.quotation-reference-card { width: min(720px, calc(100vw - 30px)); border: 1px solid #475569; background: color-mix(in srgb, var(--panel) 92%, #334155 8%); box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.quotation-reference-card .modal-header { padding-bottom: 10px; border-bottom: 1px solid #475569; }
.quotation-reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; margin-top: 12px; border: 1px solid #475569; border-radius: 8px; background: color-mix(in srgb, var(--panel-soft) 88%, #0f172a 12%); }
.quotation-reference-grid > label { min-width: 0; }
.quotation-reference-grid > label.wide { grid-column: 1 / -1; }
.quotation-reference-grid input, .quotation-reference-grid select, .quotation-reference-grid textarea { width: 100%; }
.quotation-history-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 3px; }
.quotation-history-row select { min-width: 0; height: 25px; padding: 2px 4px; font-size: 10px; }
.quotation-history-row button { min-width: 42px; height: 25px; padding: 0 4px; font-size: 10px; }
.quotation-preview-card { width: min(1120px, calc(100vw - 30px)); max-height: calc(100vh - 30px); overflow: auto; }
.quotation-paper { width: min(900px, 100%); margin: 0 auto; padding: 30px 36px; background: #fff; color: #172033; box-shadow: 0 2px 14px rgba(15, 23, 42, .16); }
.quotation-paper > p { white-space: pre-wrap; }
.quotation-paper-parties { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 22px; border-bottom: 2px solid #1f4e78; margin-bottom: 16px; }
.quotation-paper-parties p { white-space: pre-wrap; }
.quotation-paper table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.quotation-paper th, .quotation-paper td { padding: 7px 6px; border: 1px solid #94a3b8; font-size: 12px; text-align: center; }
.quotation-paper th { background: #1f4e78; color: #fff; }
.quotation-paper tfoot { font-weight: 700; }
.quotation-paper-terms { border-top: 1px solid #94a3b8; border-bottom: 1px solid #94a3b8; }
@media (max-width: 1280px) { .quotation-eight-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .quotation-copy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .quotation-eight-grid, .quotation-copy-grid, .quotation-paper-parties { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quotation-paper { padding: 16px; } }

@media (max-width: 1280px) {
  .document-editor-mask .purchase-document-modal .trade-terms-six-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .document-editor-mask .purchase-document-modal .trade-terms-eight-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .document-editor-mask .purchase-document-modal .trade-terms-six-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-editor-mask .purchase-document-modal .trade-terms-eight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.document-page.business-document-page .grouped-form-remark-section,
.document-editor-mask .purchase-document-modal .grouped-form-remark-section {
  min-width: 0;
}

.document-page.business-document-page .grouped-form-remark-section .row-actions,
.document-editor-mask .purchase-document-modal .grouped-form-remark-section .row-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.modal-panel.generate-sku-modal {
  width: min(1560px, calc(100vw - 48px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.generate-sku-modal .modal-header,
.generate-sku-modal .inline-message,
.generate-sku-modal .modal-actions {
  padding-left: 10px;
  padding-right: 10px;
}

.generate-sku-modal .inner-panel {
  margin: 10px;
}

.spec-name-pick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.spec-name-pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.spec-name-pick-item input {
  margin: 0;
  flex: 0 0 auto;
}

.spec-name-pick-item:hover {
  border-color: var(--primary);
}

.spec-name-pick-item:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
}

.spec-name-pick-item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inner-panel {
  margin: 12px;
}

.toolbar-wrap {
  flex-wrap: wrap;
}

.stock-quick-nav-panel {
  padding-block: 10px;
}

.stock-quick-nav {
  gap: 8px;
}

.counting-result-dialog {
  width: min(560px, calc(100vw - 32px));
}

.counting-result-bills {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 90%, var(--success) 10%);
  color: var(--text);
}

.inventory-disposal-form {
  display: grid;
  gap: 12px;
}

.inventory-disposal-section {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.inventory-disposal-section > h3 {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 14px;
}

.inventory-disposal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-disposal-grid > label {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.inventory-disposal-grid > label:nth-child(3n) {
  border-right: 0;
}

.inventory-disposal-grid > label:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.inventory-disposal-grid .inventory-disposal-span-2 {
  grid-column: span 2;
}

.inventory-disposal-grid textarea {
  min-height: 72px;
  resize: vertical;
}

@media (max-width: 960px) {
  .inventory-disposal-grid {
    grid-template-columns: 1fr;
  }

  .inventory-disposal-grid .inventory-disposal-span-2 {
    grid-column: auto;
  }

  .inventory-disposal-grid > label {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .inventory-disposal-grid > label:last-child {
    border-bottom: 0;
  }
}

.inventory-difference-disposal-page .success-message {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--panel));
}

.inventory-difference-disposal-page .error-message {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
}

.search-input {
  min-width: 260px;
}

.pager {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.product-list-pager {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
}

.product-list-pager-top {
  border-top: 0;
  border-bottom: 1px solid var(--border);
}

.product-list-pager-bottom {
  border-top: 1px solid var(--border);
}

.pager-summary {
  color: var(--muted);
}

.pager-summary-inline {
  margin-left: auto;
  white-space: nowrap;
}

.pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pager-actions select {
  min-width: 68px;
}

.empty-cell {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.product-status-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.product-status-button .status-badge {
  cursor: pointer;
}

.product-status-button:hover .status-badge {
  filter: brightness(0.97);
}

.voucher-status-link {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.voucher-status-link .status-badge {
  cursor: pointer;
}

.voucher-status-link:hover .status-badge {
  filter: brightness(0.97);
}

.status-success {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.status-danger {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.status-warning {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.status-muted {
  color: var(--muted);
  background: var(--panel-soft);
  border-color: var(--border);
}

.status-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.status-link-button:hover .status-badge,
.status-link-button:focus-visible .status-badge {
  filter: brightness(0.95);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.order-issue-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  background: #fffbeb;
}

.order-issue-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b45309;
  border-color: #f59e0b;
  background: #fff7d6;
  font-weight: 700;
}

.order-issue-button span {
  font-size: 18px;
  line-height: 1;
}

.workflow-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.workflow-decision-grid button {
  min-height: 42px;
}

.workflow-source-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 11px 14px;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
}

.delivery-date-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 98px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 650;
  white-space: nowrap;
}

.delivery-date-badge small { font-size: 11px; font-weight: 500; }
.delivery-date-upcoming { color: #9f1239; background: #fff1f2; border-color: #fecdd3; }
.delivery-date-urgent { color: #b91c1c; background: #fee2e2; border-color: #fca5a5; }
.delivery-date-overdue { color: #5c2b16; background: #ead8ca; border-color: #9a6848; }
.delivery-date-complete { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }

html.dark .order-issue-summary {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(120, 53, 15, 0.28);
}

html.dark .status-success {
  color: #86efac;
  background: rgba(22, 101, 52, 0.34);
  border-color: rgba(34, 197, 94, 0.45);
}

html.dark .status-danger {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.34);
  border-color: rgba(248, 113, 113, 0.45);
}

html.dark .status-warning {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.34);
  border-color: rgba(251, 191, 36, 0.45);
}

html.dark .status-muted {
  color: var(--muted);
  background: rgba(51, 65, 85, 0.62);
  border-color: var(--border);
}

.document-table tr.active-row > td {
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
}

.locked-panel {
  background: color-mix(in srgb, var(--panel) 86%, var(--panel-soft));
}

.locked-panel input,
.locked-panel select {
  color: var(--muted);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: rgba(8, 15, 28, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  padding: 12px;
}

.modal-mask.nested-modal {
  z-index: 320;
}

.modal-mask.nested-modal.elevated-nested-modal {
  z-index: 360;
}

.dialog {
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.wide-dialog {
  width: min(1180px, calc(100vw - 24px));
}

.dialog-header {
  min-height: 46px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h3 {
  margin: 0;
  font-size: 17px;
}

.modal-panel {
  width: min(1100px, 96vw);
  max-height: 82vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.modal-panel.large {
  width: min(1320px, 98vw);
}

.modal-panel.contract-preview-modal {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contract-preview-workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  border-top: 1px solid var(--border);
}

.contract-clause-toolbox {
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--panel-soft);
}

.contract-clause-toolbox > section + section,
.contract-clause-toolbox > details,
.contract-clause-toolbox > button {
  margin-top: 12px;
}

.contract-clause-toolbox h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.contract-clause-toolbox select,
.contract-clause-toolbox input,
.contract-clause-toolbox textarea {
  width: 100%;
}

.contract-clause-group {
  margin: 8px 0 0;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
}

.contract-clause-group legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
}

.contract-clause-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  font-size: 12px;
  line-height: 1.5;
}

.contract-clause-option + .contract-clause-option {
  margin-top: 6px;
}

.contract-selected-clauses {
  display: grid;
  gap: 8px;
}

.contract-selected-clause {
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
}

.contract-selected-clause textarea {
  margin-top: 6px;
  resize: vertical;
}

.contract-version-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.contract-preview-canvas {
  min-width: 0;
  min-height: 0;
  padding: 10px;
  background: #dfe3e8;
}

.contract-preview-canvas iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  background: #fff;
}

@media (max-width: 820px) {
  .contract-preview-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 42vh) minmax(320px, 1fr);
  }

  .contract-clause-toolbox {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

.tax-invoice-editor-modal {
  width: min(1100px, 96vw);
  height: min(780px, 90vh);
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.tax-invoice-editor-body {
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  align-content: start;
}

.invoice-order-routing {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.invoice-image-field {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.invoice-image-preview {
  height: 180px;
  border: 1px dashed var(--border);
  background: var(--panel);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
}

.invoice-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.invoice-image-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.invoice-image-actions small {
  flex-basis: 100%;
  color: var(--muted);
}

.invoice-image-crop-dialog {
  width: min(980px, 96vw);
  height: min(700px, 90vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.invoice-crop-body {
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  overflow: auto;
}

.invoice-crop-stage {
  min-height: 420px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #20252b;
}

.invoice-crop-stage img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.invoice-crop-selection {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.46);
  pointer-events: none;
}

.invoice-crop-controls {
  display: grid;
  align-content: start;
  gap: 14px;
}

.invoice-crop-controls label {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.invoice-crop-controls em {
  font-style: normal;
  text-align: right;
  color: var(--muted);
}

.invoice-crop-controls small {
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 760px) {
  .tax-invoice-editor-modal,
  .invoice-image-crop-dialog {
    width: 96vw;
    height: 90vh;
  }

  .invoice-image-field,
  .invoice-crop-body {
    grid-template-columns: 1fr;
  }

  .invoice-crop-stage {
    min-height: 300px;
  }
}

.modal-header {
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-actions {
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.detail-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-grid span {
  min-height: 32px;
  display: flex;
  align-items: center;
  color: var(--text);
}

.detail-grid .wide {
  grid-column: 1 / -1;
}

.confirm-panel {
  width: min(460px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(2, 8, 23, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.dialog-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dialog-warning-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #d97706;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 4px color-mix(in srgb, #d97706 18%, transparent);
}

.confirm-panel p {
  margin: 0;
  padding: 18px 20px;
  white-space: pre-line;
  line-height: 1.7;
  max-height: 62vh;
  overflow: auto;
}

.business-chain-panel {
  width: min(1080px, 96vw);
}

.business-chain-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 20px 0;
  color: var(--muted);
  font-size: 13px;
}

.business-chain-progress {
  margin: 10px 20px 0;
  height: 8px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 99px;
  overflow: hidden;
}

.business-chain-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9 0%, #22c55e 100%);
}

.business-chain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px 20px 20px;
  max-height: 62vh;
  overflow: auto;
}

.business-chain-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 94%, #f8fafc);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.business-chain-card.is-done {
  border-color: color-mix(in srgb, #22c55e 50%, var(--border));
}

.business-chain-card.is-pending {
  border-color: color-mix(in srgb, #f59e0b 40%, var(--border));
}

.business-chain-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.business-chain-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.business-chain-node-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.business-chain-node {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  padding: 8px;
  cursor: pointer;
}

.business-chain-node:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.business-chain-empty {
  color: var(--muted);
  min-height: 34px;
  display: flex;
  align-items: center;
}

.business-chain-empty-action {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.business-chain-generate {
  width: 100%;
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
  padding: 8px;
  cursor: pointer;
}

.business-chain-generate:hover {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}

.voucher-row-preview {
  position: fixed;
  z-index: 70;
  width: min(520px, calc(100vw - 48px));
  max-height: min(440px, 62vh);
  overflow: auto;
  padding: 14px 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.voucher-row-preview-header,
.voucher-row-preview-line,
.voucher-row-preview-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.voucher-row-preview-time {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.document-row-preview {
  width: min(560px, calc(100vw - 48px));
}

.voucher-row-preview-time {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.document-row-preview {
  width: min(560px, calc(100vw - 48px));
}

.voucher-row-preview-header {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.voucher-row-preview-summary {
  padding: 9px 0;
  color: var(--muted);
  white-space: normal;
}

.voucher-row-preview-line {
  padding: 6px 0;
  border-top: 1px dashed var(--border);
}

.voucher-row-preview-line span {
  white-space: normal;
}

.voucher-row-preview-line strong,
.voucher-row-preview-total {
  font-variant-numeric: tabular-nums;
}

.voucher-row-preview-total {
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--text);
  font-weight: 700;
}

.product-editor-body {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}
.summary-box {
  margin: 0;
  padding: 14px;
  min-height: 120px;
  overflow: auto;
  background: var(--panel-soft);
  border-top: 1px solid var(--border);
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.compact-panel {
  padding: 0;
}

.finance-summary-strip,
.finance-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.finance-summary-strip > div,
.finance-metric-card {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
}

.finance-summary-strip span,
.finance-metric-card span,
.finance-metric-card small,
.finance-metric-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.finance-summary-strip strong,
.finance-metric-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
}

.finance-metric-card small {
  margin-top: 4px;
  min-height: 18px;
}

.finance-metric-card.metric-success {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
}

.finance-metric-card.metric-warning {
  border-color: color-mix(in srgb, #f59e0b 55%, var(--border));
}

.finance-metric-card.metric-danger {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}

.metric-bar {
  height: 6px;
  margin: 10px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.metric-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.analysis-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.analysis-trend-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.analysis-trend-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.analysis-trend-head span,
.analysis-trend-card small,
.trend-line span,
.trend-line em {
  color: var(--muted);
  font-style: normal;
}

.trend-line {
  display: grid;
  grid-template-columns: 42px minmax(80px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
}

.trend-line i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 45%, var(--border));
}

.trend-line.current i {
  background: var(--primary);
}

.document-table tr.selected-row td {
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
}

.pager-row {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.summary-row td {
  background: var(--panel-soft);
  font-weight: 700;
}

.finance-book-page {
  gap: 8px;
}

.finance-total-row {
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: color-mix(in srgb, var(--primary) 5%, var(--panel));
}

.finance-total-row td {
  font-weight: 700;
}

/* ===== 登录页面 ===== */
.login-page {
  min-height: 100vh;
  background: #fff;
}

.login-nav {
  background: #fff;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.login-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary-color);
}

.login-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-color);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.login-logo-text {
  display: grid;
  line-height: 1.1;
}

.login-logo-text strong {
  font-size: 18px;
  font-weight: 700;
}

.login-logo-text small {
  color: var(--text-gray);
  font-size: 12px;
}

.login-nav-links {
  display: flex;
  list-style: none;
}

.login-nav-links li {
  margin-left: 30px;
}

.login-nav-links a {
  text-decoration: none;
  color: var(--text-gray);
  font-weight: 500;
  font-size: 15px;
  transition: 0.3s;
}

.login-nav-links a:hover {
  color: var(--accent-color);
}

.login-hero {
  height: 85vh;
  background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)), url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&q=80&w=2070');
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  padding: 110px 20px 40px;
  margin-top: 70px;
}

/* 修改前：grid-template-columns: 1fr 440px; */
.login-hero-inner {
  max-width: 1200px; /* 原为 1100px，提升整体容器宽度 */
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 480px; /* 右侧登录框由 440px 扩展至 480px */
  gap: 60px; /* 加大左右间距，布局更从容 */
  align-items: center;
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-logo span {
  font-size: 28px;
  font-weight: 700;
}

.login-brand-kicker {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.login-brand-title {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.15;
}

.login-hero-copy {
  font-size: 1.2rem;
  max-width: 800px;
  opacity: 0.9;
  margin-bottom: 0;
}

.login-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  width: min(960px, 100%);
  margin-top: -6px;
}

.login-points div,
.login-company-panel div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-align: left;
  font-size: 16px;
  font-weight: 600;
}

/* 1. 增加卡片精致感与内边距 */
.login-embed-card {
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px; /* 加大内边距：由 36px 32px 提升至 40px 36px */
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-embed-row {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding-left: 40px;
  box-sizing: border-box;
}

.login-header {
  margin-bottom: 20px;
  text-align: center;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 4px;
}

.login-subtitle {
  color: var(--text-gray);
  font-size: 14px;
  margin: 0;
}

.login-mode-line {
  margin-bottom: 14px;
  color: #999;
  font-size: 12px;
  text-align: right;
}

.login-message {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

.login-message.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.login-message.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="tel"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9e1ea;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  color: var(--text-dark);
  box-sizing: border-box;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.radio-group {
  display: flex;
  gap: 16px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
}

.verify-code-row {
  display: flex;
  gap: 8px;
}

.verify-code-row input {
  flex: 1;
}

/* 4. 发送验证码按钮高度对齐 */
.btn-send-code {

  height: 46px; /* 保持与输入框一致的 46px */
  border-radius: var(--radius-md);
  padding: 0 18px;

  font-size: 13px;
  border: 1px solid #d9e1ea;

  background: #f8f9fa;
  color: var(--accent-color);
  cursor: pointer;
  white-space: nowrap;
}

.btn-send-code:disabled {
  color: var(--text-gray);
  cursor: not-allowed;
}

/* 3. 提升登录按钮视觉张力 */
.btn-login {
  width: 100%;
  height: 46px; /* 从 44px 提升至 46px */
  margin-top: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  font-size: 16px; /* 从 15px 提高至 16px */
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-login:hover {
  background: #2980b9;
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.wechat-login-section {
  margin-top: 24px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-gray);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.btn-wechat-login {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #07c160;
  border-radius: 4px;
  background: #f0fdf4;
  color: #07c160;
  cursor: pointer;
}

.btn-wechat-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 2. 重置与修复功能模块卡片区域（一行 3 个） */
.login-section {
  max-width: 1360px !important; /* 与 Hero 区域对齐 */
  padding: 60px 20px !important;
}

.login-section-alt {
  background-color: #fcfcfc;
}

.login-contact {
  background: var(--primary-color);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  padding: 80px 8%;
}

.contact-info h2 { color: #fff; margin-bottom: 20px; }
.contact-details p { margin-bottom: 15px; opacity: 0.8; }

.contact-copy {
  flex: 1;
  max-width: 400px;
  opacity: 0.75;
  font-size: 14px;
}

.login-footer {
  background: #1a252f;
  color: #7f8c8d;
  text-align: center;
  padding: 30px 8%;
  font-size: 13px;
  border-top: 1px solid #2c3e50;
}

.login-footer a {
  color: #7f8c8d;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-page .login-hero,
.login-page .login-section,
.login-page .login-section-alt,
.login-page .login-contact,
.login-page .login-footer {
  color: inherit;
}

.login-page .section-header h2,
.login-page .module-card h3,
.login-page .contact-info h2,
.login-page .login-header h1 {
  color: #0f172a;
}

.login-page .section-header .bar {
  background: var(--accent-color) !important;
}

.login-page .module-card {
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border: 1px solid #d9e2ef;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.login-page .module-card ul,
.login-page .contact-copy,
.login-page .contact-details p,
.login-page .login-subtitle,
.login-page .login-mode-line,
.login-page .login-nav-links a,
.login-page .login-logo-text small {
  color: #475569;
}

.login-page .login-hero-copy,
.login-page .login-brand-kicker,
.login-page .login-logo-text strong {
  color: #f8fafc;
}

.login-page .login-contact {
  background: linear-gradient(135deg, #1f3a5f 0%, #16324f 100%);
}

.login-page .login-contact .contact-info h2,
.login-page .login-contact .contact-details p,
.login-page .login-contact .contact-copy {
  color: rgba(255, 255, 255, 0.9);
}

.login-page .login-footer {
  background: #111827;
  color: #cbd5e1;
}

.login-page .login-footer a {
  color: #cbd5e1;
}

[data-theme="dark"] .login-page {
  background: #0f172a;
}

[data-theme="dark"] .login-nav {
  background: #0f172a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .login-logo-link,
[data-theme="dark"] .login-header h1,
[data-theme="dark"] .login-brand-title,
[data-theme="dark"] .section-header h2,
[data-theme="dark"] .contact-info h2,
[data-theme="dark"] .login-contact,
[data-theme="dark"] .login-hero,
[data-theme="dark"] .login-hero-copy,
[data-theme="dark"] .login-brand-kicker,
[data-theme="dark"] .login-logo-text strong {
  color: var(--text);
}

[data-theme="dark"] .login-logo-text small,
[data-theme="dark"] .login-nav-links a,
[data-theme="dark"] .login-subtitle,
[data-theme="dark"] .login-mode-line,
[data-theme="dark"] .contact-details p,
[data-theme="dark"] .contact-copy {
  color: var(--muted);
}

[data-theme="dark"] .login-hero {
  background: linear-gradient(rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.88)), url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&q=80&w=2070');
  background-size: cover;
  background-position: center;
}

[data-theme="dark"] .login-embed-card {
  background: color-mix(in srgb, var(--panel) 92%, #0f172a);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .login-form .form-group label,
[data-theme="dark"] .login-form input,
[data-theme="dark"] .login-links .link-btn,
[data-theme="dark"] .divider,
[data-theme="dark"] .login-footer {
  color: var(--text);
}

[data-theme="dark"] .login-form input[type="text"],
[data-theme="dark"] .login-form input[type="email"],
[data-theme="dark"] .login-form input[type="password"],
[data-theme="dark"] .login-form input[type="tel"] {
  background: var(--panel-soft);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .btn-send-code {
  background: var(--panel-soft);
  border-color: var(--border);
  color: var(--accent);
}

[data-theme="dark"] .login-section {
  background: #0f172a;
}

[data-theme="dark"] .login-section-alt {
  background: #111827;
}

[data-theme="dark"] .login-contact {
  background: #111827;
}

[data-theme="dark"] .login-footer {
  background: #020617;
  color: var(--muted);
}

/* ===== 深色模式 ===== */
[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-soft: #1a2332;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --accent: #a78bfa;
}

/* ===== 颜色模式切换器 ===== */
.theme-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border-radius: 6px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.theme-switcher button {
  padding: 4px 10px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-switcher button.active {
  background: var(--primary);
  color: #fff;
}

.finance-book-filter-panel {
  border-radius: 6px;
  box-shadow: none;
}

.finance-book-toolbar {
  min-height: 48px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.finance-book-main-filters,
.finance-book-actions,
.finance-book-advanced {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-book-main-filters input[type="month"],
.finance-book-advanced input[type="date"] {
  width: 132px;
  min-height: 30px;
}

.finance-book-main-filters button,
.finance-book-actions button,
.finance-book-advanced button {
  min-height: 30px;
}

.finance-more-button {
  color: var(--primary);
  min-width: auto;
}

.finance-book-advanced {
  padding: 8px 12px 10px;
}

.finance-book-advanced input,
.finance-book-advanced select,
.finance-book-advanced .lookup-select,
.finance-book-advanced .tree-select {
  width: 168px;
}

.finance-book-advanced .tree-select {
  min-width: 190px;
}

.finance-book-page .finance-summary-strip {
  padding: 8px 12px;
  gap: 8px;
}

.finance-book-page .finance-summary-strip > div {
  min-height: 50px;
  padding: 8px 10px;
  border-radius: 4px;
  box-shadow: none;
}

.finance-book-page .finance-summary-strip strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.finance-book-page .panel-header.compact {
  min-height: 36px;
}

.finance-book-page .table-scroll {
  max-height: 62vh;
  overflow: auto;
}

.finance-book-page .document-table {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
}

.finance-book-page .document-table th,
.finance-book-page .document-table td {
  height: 30px;
  padding: 5px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.finance-book-page .document-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: center;
  background: var(--panel-soft);
}

.finance-book-page .document-table td {
  background: var(--panel);
}

.finance-book-page .document-table td:nth-last-child(-n + 4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ledger-result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 520px;
}

.ledger-side-tree {
  border-left: 1px solid var(--border);
  background: var(--panel);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ledger-side-title {
  min-height: 38px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}

.ledger-side-search {
  position: relative;
  margin: 10px 12px;
}

.ledger-side-search input {
  width: 100%;
  padding-right: 30px;
}

.ledger-side-search button {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.ledger-side-search button:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.ledger-side-tree > input {
  margin: 10px 12px;
  width: calc(100% - 24px);
}

.ledger-side-scroll {
  overflow: auto;
  padding: 0 8px 12px;
}

.ledger-side-group {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.ledger-side-group strong {
  padding: 6px 4px;
  color: var(--muted);
  font-size: 12px;
}

.ledger-side-empty {
  padding: 6px 4px;
  color: var(--muted);
  font-size: 12px;
}

.ledger-side-group button {
  min-height: 28px;
  justify-content: flex-start;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.ledger-side-group button:hover,
.ledger-side-group button.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.closing-page {
  gap: 8px;
}

.closing-workbench {
  padding: 0;
  border-radius: 6px;
  box-shadow: none;
}

.closing-workbench-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.closing-workbench-header > div:first-child {
  min-width: 220px;
  display: grid;
  gap: 5px;
  text-align: center;
}

.closing-workbench-header strong {
  color: var(--text);
  font-size: 16px;
}

.closing-workbench-header span,
.closing-task-note,
.closing-task-status {
  color: var(--muted);
  font-size: 12px;
}

.closing-task-section {
  padding: 14px 18px 20px;
  border-bottom: 1px solid var(--border);
}

.closing-section-title {
  margin-bottom: 22px;
  color: var(--primary);
  font-weight: 700;
}

.closing-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 196px));
  gap: 34px;
}

.closing-task-card {
  min-height: 144px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
}

.closing-task-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  border-bottom: 1px solid var(--border);
}

.closing-task-card header strong {
  font-size: 13px;
}

.closing-task-card header button {
  min-height: 22px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
}

.closing-task-amount {
  color: var(--text);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.closing-task-status {
  text-align: center;
}

.closing-task-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.closing-task-actions button {
  min-height: 30px;
  padding: 0 12px;
}

.closing-task-note {
  text-align: center;
}

.closing-footer-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px 18px 20px;
}

@media (max-width: 1100px) {
  .ledger-result-layout {
    grid-template-columns: 1fr;
  }

  .ledger-side-tree {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .side-nav {
    position: relative;
    overflow: visible;
    background: #1784c7;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.18);
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand > div {
    display: none;
  }

  .menu-group button {
    min-height: 42px;
    padding: 0 6px;
    justify-content: center;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
  }

  .menu-flyout {
    left: 64px;
    width: min(320px, calc(100vw - 74px));
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  }

  .page-grid,
  .spec-layout,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .workflow-card-grid,
  .workflow-journey-grid {
    grid-template-columns: 1fr;
  }

  .workflow-hero-main h1 {
    font-size: 24px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid .wide {
    grid-column: auto;
  }

  .local-ai-grid,
  .local-ai-parameter-grid,
  .local-ai-meta {
    grid-template-columns: 1fr;
  }

  .local-ai-agent-layout,
  .local-ai-template-row {
    grid-template-columns: 1fr;
  }

  .local-ai-card-head {
    flex-direction: column;
  }

  .local-ai-card-head-actions {
    align-items: flex-start;
  }

  .local-ai-page .panel-header,
  .local-ai-grid {
    padding-left: 14px;
    padding-right: 14px;
  }
}
.context-help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #7aa7d9;
  border-radius: 50%;
  color: #1769aa;
  background: #eef6ff;
  font-weight: 700;
  cursor: help;
  outline: none;
}

.context-help-tip:focus {
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.18);
}

.context-help-tip-content {
  position: absolute;
  z-index: 1200;
  left: 50%;
  bottom: calc(100% + 10px);
  display: none;
  width: min(420px, 72vw);
  padding: 10px 12px;
  border: 1px solid #b8cce2;
  border-radius: 6px;
  color: #26384a;
  background: #fff;
  box-shadow: 0 8px 24px rgba(30, 55, 80, 0.2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  transform: translateX(-50%);
  white-space: normal;
}

.context-help-tip:hover .context-help-tip-content,
.context-help-tip:focus .context-help-tip-content,
.context-help-tip:focus-within .context-help-tip-content {
  display: block;
}
.sales-next-panel { width: min(760px, 94vw); }
.shipment-panel { width: min(1180px, 96vw); max-height: 92vh; overflow: auto; }
.shipment-list { overflow: auto; border: 1px solid #d9dee7; border-radius: 8px; }
.shipment-list table { width: 100%; min-width: 900px; border-collapse: collapse; }
.shipment-list th, .shipment-list td { padding: 8px 10px; border-bottom: 1px solid #e6e9ef; text-align: left; }
.shipment-form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.shipment-form label { display: grid; gap: 6px; color: #475467; }
.shipment-form input, .shipment-form select { width: 100%; min-height: 36px; }
.shipment-form .shipment-remark { grid-column: span 2; }
@media (max-width: 900px) { .shipment-form { grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
.source-bill-hover { cursor: help; text-decoration: underline dotted #8091a7; text-underline-offset: 3px; }
.invoice-source-compact-summary { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 8px 18px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-soft); color: var(--text); }
.invoice-source-compact-summary small { grid-column: 1 / -1; color: var(--muted); }
.invoice-source-detail-modal { width: min(1320px, 96vw); max-height: 90vh; overflow: auto; }
@media (max-width: 760px) { .invoice-source-compact-summary { grid-template-columns: 1fr; } }

.asset-management-page { gap: 10px; }
.asset-filter-panel { padding: 0; overflow: hidden; }
.asset-filter-panel .tab-row { padding: 10px 14px 0; border-bottom: 1px solid var(--border); }
.asset-filter-panel .compact-filter { margin: 0; padding: 12px 14px; background: var(--panel-soft); }
.asset-work-panel { padding: 0; overflow: hidden; min-height: 460px; }
.asset-subnav { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--panel-soft); }
.asset-subnav button { min-height: 42px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.asset-subnav button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.asset-toolbar { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.asset-toolbar-note { margin-left: auto; color: var(--muted); font-size: 13px; }
.asset-table-scroll { min-height: 360px; }
.asset-table-scroll .document-table { min-width: 1320px; }
.asset-due-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #f0c36d; border-radius: 8px; background: #fff8e8; color: #7a4b00; }
.asset-guide-dialog { width: min(720px, 94vw); }
.asset-card-editor { width: min(1180px, 96vw); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.asset-card-editor-body { padding: 14px 18px; overflow: auto; display: grid; gap: 14px; background: var(--panel-soft); }
.asset-card-section { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.asset-card-section legend { padding: 0 8px; color: var(--text); font-size: 15px; font-weight: 700; }
.asset-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.asset-card-grid label { min-width: 0; display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: 13px; }
.asset-card-grid label > span { color: var(--text); }
.asset-card-grid input, .asset-card-grid select, .asset-card-grid textarea { width: 100%; }
.asset-card-grid input[readonly] { background: var(--panel-soft); color: var(--text); font-weight: 700; }
.asset-remark-field { grid-column: span 2; }
.asset-card-actions { flex: 0 0 auto; }
.asset-card-actions > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.asset-guide-body { display: grid; gap: 14px; padding: 18px; }
.asset-guide-body label:not(.asset-switch-row) { display: grid; gap: 6px; color: var(--muted); }
.asset-guide-body input[type="number"] { width: 180px; }
.asset-guide-body ol { margin: 0; padding-left: 22px; line-height: 1.9; }
.asset-guide-tip { padding: 12px 14px; border: 1px solid #b8cce2; border-radius: 8px; background: #eef6ff; color: #315777; line-height: 1.6; }
.asset-switch-row { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .asset-due-banner { grid-template-columns: 1fr; }
  .asset-toolbar { flex-wrap: wrap; }

  .login-page {
    padding: 0;
  }

  .login-nav {
    padding: 0 16px;
  }

  .login-hero {
    height: auto;
    padding: 95px 16px 32px;
  }

  .login-brand-title {
    font-size: 2.2rem;
  }

  .login-nav-links {
    display: none;
  }

  .login-points,
  .login-embed-row {
    width: 100%;
    padding-left: 0;
  }

  .login-embed-card {
    width: 100%;
    padding: 24px;
    justify-self: stretch;
  }

  .login-section,
  .login-contact {
    padding: 60px 16px;
  }
  .asset-toolbar-note { width: 100%; margin-left: 0; }
  .asset-card-grid { grid-template-columns: 1fr; }
  .asset-remark-field { grid-column: auto; }
}
.quotation-risk-panel {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding: 9px 12px;
  border: 1px solid #b7791f;
  border-radius: 6px;
  background: rgba(183, 121, 31, 0.1);
}
.quotation-risk-panel > div { display: grid; grid-template-columns: 58px 1fr; gap: 6px 10px; align-items: start; }
.quotation-risk-panel small { grid-column: 2; color: var(--muted-color); }
.risk-level { border-radius: 3px; padding: 1px 5px; text-align: center; font-size: 12px; }
.risk-高 { color: #fff; background: #c53030; }
.risk-中 { color: #1a202c; background: #ecc94b; }
.trade-risk-button { color: #fff; border-color: transparent !important; font-weight: 600; }
.trade-risk-button.risk-low { background: #238636; }
.trade-risk-button.risk-medium { color: #1f2937; background: #f2c94c; }
.trade-risk-button.risk-high { background: #cf222e; }
.trade-risk-mask { z-index: 1600; }
.trade-risk-dialog { width: 760px; height: 620px; max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--border-color); }
.trade-risk-scroll { overflow: auto; padding: 12px; display: grid; align-content: start; gap: 10px; }
.trade-risk-item { padding: 10px 12px; border: 1px solid var(--border-color); border-left-width: 5px; border-radius: 6px; background: var(--panel-bg); }
.trade-risk-item.risk-high { border-left-color: #cf222e; }
.trade-risk-item.risk-medium { border-left-color: #d4a72c; }
.trade-risk-item.risk-low { border-left-color: #238636; }
.trade-risk-item header { display: flex; gap: 10px; align-items: center; }
.trade-risk-item header > span { padding: 2px 7px; border-radius: 4px; background: rgba(127,127,127,.18); font-size: 12px; }
.trade-risk-item h4 { margin: 8px 0 4px; }
.trade-risk-item p { margin: 3px 0; }
.trade-risk-advice { color: var(--muted-color); }
.trade-risk-empty { padding: 28px; text-align: center; border: 1px solid #238636; border-radius: 6px; background: rgba(35,134,54,.08); }
.quotation-input-picker { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 5px; align-items: stretch; }
.quotation-input-picker > input, .quotation-input-picker > textarea { min-width: 0; width: 100%; }
.quotation-input-picker > button { width: 48px; padding-inline: 4px; }
.quotation-history-dialog { width: 720px; height: 520px; max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); display: grid; grid-template-rows: auto 1fr auto; border: 2px solid #52647c; box-shadow: 0 18px 48px rgba(0,0,0,.48); }
.quotation-history-dialog .modal-header { padding: 18px 20px; border-bottom: 1px solid #52647c; }
.quotation-history-list { overflow: auto; display: grid; align-content: start; gap: 8px; padding: 16px 20px; }
.quotation-history-list > button { display: grid; gap: 4px; padding: 10px 12px; text-align: left; border: 1px solid var(--border-color); border-radius: 5px; background: var(--panel-bg); }
.quotation-history-list > button span { color: var(--muted-color); white-space: normal; }
.quotation-history-dialog .modal-actions, .quotation-reference-card .modal-actions { justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid #52647c; }
.quotation-history-dialog .modal-actions button, .quotation-reference-card .modal-actions button { min-width: 92px; min-height: 36px; }
.quotation-reference-card { border-width: 2px; }
.quotation-reference-delete {
  position: fixed;
  right: calc(50% - 340px);
  bottom: calc(50% - 205px);
  z-index: 1200;
  border-color: #ef4444 !important;
  color: #fecaca !important;
  background: #7f1d1d !important;
}
.fulfillment-create{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:8px}.fulfillment-batch-list{display:flex;gap:8px;overflow:auto;padding-bottom:10px}.fulfillment-batch-list button{display:grid;text-align:left;min-width:190px}.fulfillment-batch-list button.active{border-color:#38bdf8;background:#0c4a6e}.fulfillment-node-board{display:grid;grid-template-columns:repeat(5,minmax(180px,1fr));gap:10px}.fulfillment-node-board article{border:1px solid var(--border-color);border-left:5px solid #22c55e;border-radius:8px;padding:10px;background:rgba(15,23,42,.55)}.fulfillment-node-board article.warning-yellow{border-left-color:#eab308}.fulfillment-node-board article.warning-red{border-left-color:#ef4444}.fulfillment-node-board header{display:flex;justify-content:space-between;gap:8px}.fulfillment-node-board header span{font-size:11px;color:var(--text-muted)}.fulfillment-node-board article>div{display:flex;gap:5px;margin-top:8px}.fulfillment-progress,.fulfillment-empty{border:1px solid var(--border-color);border-radius:8px;padding:8px;margin:8px 0}.fulfillment-progress-head{display:flex;align-items:center;gap:12px}.fulfillment-progress-head button{margin-left:auto}.fulfillment-steps{display:grid;grid-template-columns:repeat(15,minmax(42px,1fr));gap:4px;margin-top:7px}.fulfillment-step{display:grid;place-items:center;min-height:42px;border:1px solid var(--border-color);border-radius:6px;border-top:4px solid #22c55e;font-weight:700}.fulfillment-step.warning-yellow{border-top-color:#eab308}.fulfillment-step.warning-red,.fulfillment-step.blocked{border-top-color:#ef4444}.fulfillment-step.completed{background:rgba(34,197,94,.15)}.fulfillment-step small{font-size:9px;font-weight:400;text-align:center}@media(max-width:1200px){.fulfillment-create{grid-template-columns:repeat(3,1fr)}.fulfillment-node-board{grid-template-columns:repeat(3,1fr)}.fulfillment-steps{overflow:auto;display:flex}.fulfillment-step{min-width:80px}} 
.loading-photo-wall{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:8px}.loading-photo-slot{display:grid;gap:7px;border:1px dashed var(--border-color);border-radius:8px;padding:10px;min-height:92px}.loading-photo-slot.complete{border-color:#22c55e;background:rgba(34,197,94,.1)}.loading-photo-slot.missing{border-color:#ef4444;background:rgba(239,68,68,.06)}@media(max-width:1000px){.loading-photo-wall{grid-template-columns:repeat(2,1fr)}}

/* ── 期初初始化看板（金蝶式 5 步渐进引导） ── */
.opening-wizard { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px 14px; margin: 10px 0; background: var(--panel); }
.opening-wizard-overview { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 2px 12px; border-bottom: 1px dashed var(--border); }
.opening-progress-ring { position: relative; width: 88px; height: 88px; flex: none; }
.opening-progress-ring-track { fill: none; stroke: color-mix(in srgb, var(--border) 70%, transparent); stroke-width: 8; }
.opening-progress-ring-bar { fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 44px 44px; transition: stroke-dashoffset .4s ease; }
.opening-progress-ring-value { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--primary); }
.opening-wizard-stats { display: grid; gap: 2px 18px; grid-template-columns: auto auto; align-items: center; }
.opening-wizard-stat { display: flex; flex-direction: column; }
.opening-wizard-stat-value { font-size: 16px; font-weight: 700; color: var(--text); }
.opening-wizard-stat-value.is-warn { color: #d4a72c; }
.opening-wizard-stat-value.is-locked { color: var(--primary); }
.opening-wizard-stat > span:last-child { font-size: 12px; color: var(--muted); }
.opening-wizard-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.opening-wizard-board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.opening-wizard-column { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: color-mix(in srgb, var(--panel-soft) 60%, var(--panel)); }
.opening-wizard-column-main { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.opening-wizard-step-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.opening-wizard-step-no { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 15%, var(--panel)); color: var(--primary); font-weight: 700; font-size: 12px; flex: none; }
.opening-wizard-step-head strong { display: block; font-size: 13px; }
.opening-wizard-step-head span { display: block; font-size: 11px; color: var(--muted); }
.opening-wizard-tasks { display: grid; gap: 6px; }
.opening-wizard-task { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 30px; padding: 5px 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); font-size: 12px; text-align: left; }
.opening-wizard-task:hover { border-color: var(--border); background: color-mix(in srgb, var(--primary) 8%, var(--panel)); }
.opening-wizard-task.is-done { color: var(--success); }
.opening-wizard-task-check { flex: none; width: 16px; text-align: center; font-weight: 700; color: var(--muted); }
.opening-wizard-task-check.is-done { color: var(--success); }
.opening-wizard-task-meta { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.opening-wizard-task.is-done .opening-wizard-task-meta { color: var(--success); }
.opening-wizard-task-arrow { color: var(--muted); font-size: 12px; }
/* 试算平衡 / 同步结果列表 */
.opening-trial-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; margin: 10px 0; }
.opening-trial-item { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.opening-trial-item.is-ok { border-left: 4px solid var(--success); }
.opening-trial-item.is-fail { border-left: 4px solid #ef4444; background: color-mix(in srgb, #ef4444 6%, var(--panel)); }
.opening-trial-item-head { display: flex; gap: 6px; align-items: center; margin-bottom: 3px; }
.opening-sync-rows { display: grid; gap: 8px; max-height: 220px; overflow: auto; margin: 10px 0; }
.opening-sync-row { display: grid; gap: 3px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.opening-sync-row.is-overwrite { border-color: color-mix(in srgb, #d4a72c 55%, var(--border)); background: color-mix(in srgb, #d4a72c 8%, var(--panel)); }
.opening-sync-impact { display: grid; gap: 8px; margin-top: 10px; }
@media (max-width: 1200px) { .opening-wizard-board { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
@media (max-width: 720px) { .opening-wizard-board { grid-template-columns: 1fr; } .opening-wizard-actions { margin-left: 0; width: 100%; } }

/* ===== AI Agent 设备授权审批页（/agent/device）===== */
.device-approval-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 16px 48px;
  background:
    radial-gradient(1200px 400px at 50% -80px, var(--primary-glow), transparent 65%),
    var(--bg);
}
.device-approval-nav {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.device-approval-brand { font-weight: 600; color: var(--text); }
.device-approval-card {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 32px 32px;
}
.device-approval-head { margin-bottom: 20px; }
.device-approval-head h1 { font-size: 22px; margin: 8px 0 8px; }
.device-approval-flow {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  padding: 14px 16px;
  margin: 4px 0 18px;
}
.flow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.flow-row > span { color: var(--muted); flex: none; }
.flow-row code { font-size: 12px; word-break: break-all; text-align: right; }
.flow-row code.user-code {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  padding: 3px 10px;
  border-radius: 6px;
}
.device-approval-actions { display: flex; gap: 10px; margin-top: 20px; }
.device-approval-actions button.primary { min-width: 120px; }
.device-approval-result { text-align: center; padding: 16px 0 8px; }
.device-approval-result-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}
.device-approval-result-icon.success { background: color-mix(in srgb, var(--success) 14%, var(--panel)); color: var(--success); }
.device-approval-result h2 { margin: 0 0 8px; }
.device-approval-result p { color: var(--muted); max-width: 440px; margin: 0 auto 4px; }
.device-approval-result .device-approval-actions { justify-content: center; }

/* ===== 套餐 / 配额展示条（账套管理页）===== */
.subscription-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  padding: 10px 14px;
  margin: 4px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 4%, var(--panel-soft));
}
.subscription-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.subscription-item > strong { font-weight: 600; }
.quota-pill {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--success) 14%, var(--panel));
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}
.quota-pill.is-full { background: color-mix(in srgb, #d4a72c 16%, var(--panel)); color: #d4a72c; border-color: color-mix(in srgb, #d4a72c 40%, transparent); }
.quota-pill.is-empty { background: color-mix(in srgb, #ef4444 14%, var(--panel)); color: #ef4444; border-color: color-mix(in srgb, #ef4444 40%, transparent); }
@media (max-width: 720px) {
  .subscription-strip { flex-direction: column; align-items: flex-start; }
}
