/* ========================================
   村强民富 - 生产管理系统
   样式表
   ======================================== */

/* ===== 重置与基础 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-width: 220px;
  --topbar-height: 56px;
  --color-bg: #f0f2f5;
  --color-sidebar: #04342C;
  --color-sidebar-hover: #0A3D36;
  --color-sidebar-active: #0F6E56;
  --color-white: #ffffff;
  --color-primary: #0F6E56;
  --color-primary-dark: #085041;
  --color-primary-light: #E1F5EE;
  --color-success: #16A34A;
  --color-success-light: #DCFCE7;
  --color-warning: #D97706;
  --color-warning-light: #FEF3C7;
  --color-danger: #DC2626;
  --color-danger-light: #FEE2E2;
  --color-info: #2563EB;
  --color-info-light: #DBEAFE;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-text-light: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-dark: #d1d5db;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ===== 布局 ===== */
#app {
  display: flex;
  height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.logo-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  padding-left: 38px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: var(--color-sidebar-hover);
  color: #e2e8f0;
}

.nav-item.active {
  background: var(--color-sidebar-active);
  color: #fff;
  font-weight: 500;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* 分组导航 */
.nav-group {
  margin-bottom: 8px;
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.nav-group-icon {
  font-size: 14px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 500;
}

.user-role {
  font-size: 11px;
  color: #64748b;
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-text);
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-display {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

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

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

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

.btn-success:hover {
  background: #059669;
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background: #f9fafb;
  color: var(--color-text);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 卡片 ===== */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.card-body {
  padding: 20px;
}

/* ===== KPI 卡片 ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary);
}

.kpi-card.kpi-success::before { background: var(--color-success); }
.kpi-card.kpi-warning::before { background: var(--color-warning); }
.kpi-card.kpi-info::before { background: var(--color-info); }

.kpi-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.kpi-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-left: 4px;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 8px;
}

.kpi-trend.up { color: var(--color-success); }
.kpi-trend.down { color: var(--color-danger); }

.kpi-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 32px;
  opacity: 0.15;
}

/* ===== 表格 ===== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--color-text);
  vertical-align: middle;
}

tbody tr:nth-child(even) {
  background: #fafbfc;
}

tbody tr:hover {
  background: #E6F5F0;
}

tbody tr:last-child td {
  border-bottom: none;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--color-text-secondary); }
.font-bold { font-weight: 600; }
.font-mono { font-family: "SF Mono", "Fira Code", monospace; }

/* ===== 状态标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.tag-success { background: var(--color-success-light); color: #065f46; }
.tag-warning { background: var(--color-warning-light); color: #92400e; }
.tag-danger { background: var(--color-danger-light); color: #991b1b; }
.tag-info { background: var(--color-info-light); color: #4338ca; }
.tag-default { background: #f3f4f6; color: var(--color-text-secondary); }

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: var(--color-text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15,110,86,0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ===== 模态框 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.modal-lg { width: 720px; }
.modal-md { width: 520px; }
.modal-sm { width: 400px; }
.modal-xl { width: 900px; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-danger); }
.toast.warning { background: var(--color-warning); }
.toast.info { background: var(--color-info); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 进度条 ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar-fill.success { background: var(--color-success); }
.progress-bar-fill.warning { background: var(--color-warning); }
.progress-bar-fill.danger { background: var(--color-danger); }
.progress-bar-fill.primary { background: var(--color-primary); }

/* ===== 网格布局 ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--color-text-light);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.empty-state-icon {
  font-size: 52px;
  margin-bottom: 14px;
  opacity: 0.7;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 500;
}

/* ===== 图表容器 ===== */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  max-width: 100%;
}

/* ===== 间距 ===== */
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ===== BOM 展开 ===== */
.bom-level {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bom-level-1 { padding-left: 0; }
.bom-level-2 { padding-left: 24px; }

.bom-tree-line {
  color: var(--color-text-light);
  font-family: monospace;
}

/* ===== 甘特图 ===== */
.gantt-container {
  overflow-x: auto;
}

.gantt-row {
  display: flex;
  align-items: center;
  height: 40px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.gantt-label {
  width: 120px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.gantt-track {
  flex: 1;
  height: 28px;
  background: #f3f4f6;
  border-radius: 4px;
  position: relative;
  margin: 0 4px;
}

.gantt-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}

/* ===== 工具栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.toolbar .spacer {
  flex: 1;
}

.search-input {
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 220px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 8px center no-repeat;
  outline: none;
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15,110,86,0.12);
}

/* ===== 统计行 ===== */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

/* ===== 统计卡片（列表页通用，与 KPI 卡片风格统一） ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary);
}
.stat-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}
.page-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.page-header h1 {
  margin: 0 0 4px;
}
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: block;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .col-3, .col-4, .col-6, .col-8 {
    grid-column: span 12;
  }
  .modal-lg, .modal-md, .modal-sm, .modal-xl {
    width: 95vw;
  }
}

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #04342C 0%, #021F1A 50%, #0F6E56 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}
.login-logo-icon { font-size: 40px; }
.login-logo-text { font-size: 28px; font-weight: 700; color: #04342C; }
.login-subtitle {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 28px;
}
.login-form { margin-bottom: 24px; }
.login-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 8px;
  border: 1px solid #fecaca;
}
.login-hint {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
}
.login-hint-title {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
  font-weight: 600;
}
.login-hint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.login-hint-item {
  display: inline-block;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.login-hint-item:hover {
  background: #0F6E56;
  color: #fff;
  border-color: #0F6E56;
}
.btn-block { width: 100%; }
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #dc2626; }

/* ===== 子页签（合并导航） ===== */
.subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.subtab {
  padding: 9px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
}
.subtab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.subtab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.subtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 8px;
  border-radius: 9px;
  background: var(--color-danger, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.subtab.active .subtab-badge {
  background: #fff;
  color: var(--color-primary, #0F6E56);
}

/* ===== BOM 表单（初处理鱼种卡片） ===== */
.pp-card {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 10px);
  margin-bottom: 12px;
  background: #fff;
  overflow: hidden;
}
.pp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.pp-card-title { font-size: 13px; font-weight: 600; color: var(--color-text, #1f2937); }
.pp-card-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 14px;
}
.pp-field { display: flex; flex-direction: column; gap: 6px; }
.pp-inline { display: flex; gap: 6px; align-items: center; }
.pp-inline .form-input { flex: 1; min-width: 0; }
.pp-inline .form-select { width: 64px; flex-shrink: 0; }
.pp-pct { color: #6b7280; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.pp-row-total { margin-top: 6px; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: #f3f4f6; }
.pp-total-ok { color: #059669; background: #ecfdf5; }
.pp-total-bad { color: #dc2626; background: #fef2f2; }
.pp-clean-pct-hint { color: #059669; }
.pp-waste-pct-hint { color: #dc2626; }
@media (max-width: 680px) {
  .pp-card-body { grid-template-columns: 1fr; }
}

/* ===== 全局 UI 升级（v=20260802s） ===== */

/* 详情区域 */
.detail-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.detail-row {
  display: flex;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  width: 90px;
  flex-shrink: 0;
  color: var(--color-text-secondary);
  font-weight: 500;
}
.detail-value {
  color: var(--color-text);
  font-weight: 500;
}

/* 紧凑标签（替代 tag 用于表格内） */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-primary { background: #E1F5EE; color: #0F6E56; }
.badge-success { background: #d1fae5; color: #047857; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0e7ff; color: #4338ca; }
.badge-default { background: #f3f4f6; color: #6b7280; }

/* 操作栏 */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: #fafbfc;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex-wrap: wrap;
}

/* 页面分区标题 */
.page-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--color-primary);
}

/* 信息网格 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.info-item {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.info-item-label {
  font-size: 11px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.info-item-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

/* 子页签内容区 */
.tab-content {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-top: none;
  padding: 16px 0;
}

/* 分割线 */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 14px 0;
}

/* 高亮数字 */
.num-highlight {
  font-family: "DIN Alternate", "SF Mono", "Fira Code", monospace;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* 表格内操作按钮组 */
.table-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.table-actions .btn-xs {
  padding: 2px 6px;
  font-size: 11px;
}

/* ===== 商品管理表格（gm-*） ===== */
.gm-table-wrap {
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.gm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.gm-table thead th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.gm-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--color-text);
  vertical-align: middle;
  font-size: 13px;
}
.gm-table tbody tr:nth-child(even) {
  background: #fafbfc;
}
.gm-table tbody tr:hover {
  background: #E6F5F0;
}
.gm-table tbody tr:last-child td {
  border-bottom: none;
}
.gm-row-selected {
  background: #E6F5F0 !important;
}
/* 列宽分配（共9列，固定布局避免换行压缩） */
.gm-th-check, .gm-td-check { width: 34px; text-align: center; }
.gm-th-code, .gm-td-code { width: 100px; }
.gm-th-name, .gm-td-name { min-width: 160px; }
.gm-th-cat, .gm-td-cat { width: 70px; }
.gm-th-spec, .gm-td-spec { width: 120px; }
.gm-th-unit, .gm-td-unit { width: 52px; }
.gm-th-price, .gm-td-price { width: 90px; text-align: right; }
.gm-th-cost, .gm-td-cost { width: 100px; text-align: right; font-weight: 500; color: #0f766e; }
.gm-th-actions, .gm-td-actions { width: 260px; }
.gm-th-stock, .gm-td-stock { width: 96px; text-align: right; }
.gm-stock-has { color: #06463A; font-weight: 500; }
.gm-stock-zero { color: #9ca3af; }
/* 库存金额列（现有库存 × 单位成本），权限受限时显示锁 */
.gm-th-amt, .gm-td-amt { width: 110px; text-align: right; font-weight: 500; color: #b45309; }
.gm-amt { color: #b45309; }
.gm-code-link {
  color: #0F6E56;
  font-weight: 500;
  font-family: monospace;
}
.gm-code-link:hover { text-decoration: underline; }
/* 品名/规格：单行显示、完整不截断（列宽按内容自动撑开，窄屏横向滚动） */
.gm-name {
  display: block;
  white-space: nowrap;
  font-weight: 500;
  color: var(--color-text);
}
.gm-spec {
  display: block;
  white-space: nowrap;
  color: #4b5563;
}
.gm-td-price { color: #b45309; }
.gm-muted { color: #9ca3af; }
.gm-empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px 12px;
}
/* 操作按钮组：更紧凑、视觉更统一 */
.gm-actions {
  flex-wrap: wrap;
  gap: 4px 2px;
}
.gm-actions .btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 6px;
}

/* 出入明细弹窗 - 批次库存区块 */
.gm-batch-block {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.gm-batch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gm-batch-count {
  font-size: 12px;
  font-weight: 400;
  color: #0F6E56;
  background: #E6F5F0;
  padding: 2px 8px;
  border-radius: 10px;
}
.gm-batch-empty {
  font-size: 13px;
  color: #9ca3af;
  padding: 8px 0;
}
.gm-sub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin: 6px 0 10px;
}


/* 进度环/状态指示器 */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-success { background: var(--color-success); }
.status-dot-warning { background: var(--color-warning); }
.status-dot-danger { background: var(--color-danger); }
.status-dot-info { background: var(--color-info); }
.status-dot-muted { background: #d1d5db; }

/* 工具提示式小字 */
.hint-text {
  font-size: 11px;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* 卡片内无内边距表格 */
.card .table-wrapper {
  border: none;
  border-radius: 0;
}
.card thead th {
  border-radius: 0;
}

/* ===== 生产计划看板 ===== */
.plan-board { display:grid; grid-template-columns:repeat(6, minmax(190px,1fr)); gap:12px; align-items:start; overflow-x:auto; padding-bottom:8px; }
.plan-board-col { background:#f8fafc; border:1px solid #e5e7eb; border-radius:10px; min-width:190px; display:flex; flex-direction:column; }
.plan-board-col.pb-col-draft { border-top:3px solid #9ca3af; }
.plan-board-col.pb-col-pending { border-top:3px solid #f59e0b; }
.plan-board-col.pb-col-scheduled { border-top:3px solid #0F6E56; }
.plan-board-col.pb-col-producing { border-top:3px solid #10b981; }
.plan-board-col.pb-col-done { border-top:3px solid #22c55e; }
.plan-board-col.pb-col-delivered { border-top:3px solid #6366f1; }
.plan-board-head { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; font-weight:700; font-size:13px; color:#374151; border-bottom:1px solid #eef2f7; }
.plan-board-count { background:#e5e7eb; color:#374151; border-radius:10px; padding:1px 9px; font-size:12px; }
.plan-board-body { padding:10px; display:flex; flex-direction:column; gap:10px; min-height:60px; }
.plan-board-empty { text-align:center; color:#cbd5e1; font-size:13px; padding:14px 0; }
.plan-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px; cursor:pointer; transition:box-shadow .15s, transform .15s; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.plan-card:hover { box-shadow:0 4px 14px rgba(0,0,0,.12); transform:translateY(-2px); }
.plan-card-overdue { border-color:#fca5a5; background:#fff5f5; }
.plan-card-top { display:flex; align-items:center; justify-content:space-between; }
.plan-card-id { font-size:13px; font-weight:700; color:#1f2937; }
.plan-card-customer { font-size:13px; color:#374151; margin:4px 0 6px; font-weight:600; }
.plan-card-items { font-size:12px; color:#6b7280; line-height:1.5; max-height:40px; overflow:hidden; }
.plan-card-meta { display:flex; justify-content:space-between; font-size:12px; color:#6b7280; margin:8px 0 6px; }
.plan-card-progress-txt { font-size:11px; color:#6b7280; text-align:right; margin-top:2px; }
.plan-card-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.plan-card-actions .btn { flex:1; min-width:auto; }

/* 逾期提醒条 */
.plan-overdue-bar { margin-top:14px; padding:10px 14px; border-radius:8px; background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; font-size:13px; }
.plan-overdue-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.plan-overdue-chip { background:#fff; border:1px solid #fecaca; border-radius:6px; padding:3px 9px; cursor:pointer; font-size:12px; color:#b91c1c; }
.plan-overdue-chip:hover { background:#fee2e2; }

/* 产线负荷 */
.line-load-wrap { margin-bottom:16px; }
.line-load-title { font-size:14px; font-weight:700; margin-bottom:10px; color:#374151; }
.line-load-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:12px; }
.line-load-card { background:#fff; border:1px solid #e5e7eb; border-left:4px solid #9ca3af; border-radius:8px; padding:10px 12px; }
.line-load-card.ll-ok { border-left-color:#22c55e; }
.line-load-card.ll-warn { border-left-color:#f59e0b; }
.line-load-card.ll-danger { border-left-color:#ef4444; }
.ll-name { font-weight:700; font-size:13px; color:#1f2937; }
.ll-meta { font-size:12px; color:#6b7280; margin:4px 0; }
.ll-txt { font-size:12px; color:#6b7280; }

/* KPI 危险态 */
.kpi-danger { background:#fef2f2 !important; border-color:#fecaca !important; }
.kpi-danger .kpi-value { color:#dc2626; }

/* 进度表行高亮 */
.row-overdue { background:#fff5f5 !important; }
.row-risk { background:#fffbeb !important; }

/* ===== 移动端适配（≤768px 手机/小平板） =====
   说明：桌面端布局完全不变，仅在窄屏下启用抽屉式侧边栏 + 网格塌缩 + 弹窗收窄。
   抽屉逻辑由 js/app.js 的 menuToggle 控制（切换 .sidebar.open），此处只负责样式。 */
@media (max-width: 768px) {
  /* 显示顶部汉堡按钮 */
  .menu-toggle { display: inline-flex; }

  /* 侧边栏改为离屏抽屉 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 2000;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3);
  }
  .sidebar.open { transform: translateX(0); }

  /* 抽屉遮罩（点击关闭），纯 CSS 显示，点击由 index.html 内联处理 */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1500;
  }
  .sidebar.open ~ .sidebar-backdrop { display: block; }

  .main-content { width: 100%; }

  /* 顶栏收窄 */
  .topbar { padding: 0 14px; gap: 10px; }
  .page-title { font-size: 16px; }
  .date-display { display: none; }

  /* 内容区内边距减小 */
  .view-container { padding: 12px; }

  /* 网格塌缩为单列 / 双列 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-12 { grid-template-columns: 1fr; }
  .grid-12 > * { grid-column: auto !important; }

  /* 卡片内边距减小 */
  .card { margin-bottom: 12px; }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 12px 14px; }

  /* 加大点击区域 */
  .btn { padding: 10px 14px; font-size: 14px; }
  .btn-sm { padding: 6px 10px; }

  /* 弹窗收窄并允许底部按钮换行 */
  .modal { width: auto !important; max-width: 94vw; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding: 14px 16px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; }

  /* Toast 在小屏占满宽度 */
  .toast-container { right: 10px; left: 10px; top: 10px; }

  /* 表单行在窄屏单列 */
  .form-row { flex-direction: column; gap: 10px; }
}

/* ===== 微交互升级（v=20260908ui） ===== */

/* 统一焦点环 */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* 滚动条美化（webkit） */
.sidebar-nav::-webkit-scrollbar,
.view-container::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.sidebar-nav::-webkit-scrollbar-thumb,
.view-container::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
}
.view-container::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.view-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.32);
}

/* 卡片轻抬（不位移，避免密集表格抖动） */
.card:hover, .kpi-card:hover, .stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: none;
}

/* 骨架屏 / 加载占位 */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #eef1f4;
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-line { height: 14px; margin: 10px 0; }
.skeleton-block { height: 80px; margin: 12px 0; }

/* 空状态插画强调 */
.empty-state-icon {
  background: radial-gradient(circle at 50% 40%, var(--color-primary-light) 0%, transparent 70%);
  border-radius: 50%;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

/* 区隔标题激活态强调 */
.page-section-title {
  border-left-color: var(--color-primary);
}

/* ============================================================
   2026-09-13 首页 + 导航 改造（批次 1+2）
   —— 纯新增，不覆盖任何既有选择器 ——
   背景：app.js 渲染导航用到 10 个类，线上 style.css 一条都没定义，
   其中 .hidden 缺失导致 nav-cat-body 永远收不起来、43 项全展开。
   同时首页改为「角色感知工作台」，需要一套骨架/组件类。
   ============================================================ */

/* ---------- ① 通用：折叠开关（app.js:373 classList.toggle('hidden') 依赖） ---------- */
.hidden { display: none !important; }

/* ---------- ② 侧栏分类树 ---------- */
.nav-cat { margin-bottom: 4px; }

.nav-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.nav-cat-head:hover { background: var(--color-sidebar-hover); color: #fff; }
.nav-cat-head .nav-label { flex: 1; }

.nav-cat-arrow {
  font-size: 10px;
  color: #64748b;
  transition: transform 0.15s;
}

.nav-cat-body {
  padding: 2px 0 6px 8px;
  border-left: 1px solid rgba(255,255,255,0.06);
  margin-left: 12px;
}

.nav-sub-title {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #5b7a72;
  letter-spacing: 0.06em;
  user-select: none;
}

/* 叶子落在分类里：比分类头弱一档，靠左侧小圆点对齐 */
.nav-leaf {
  padding: 8px 12px;
  font-size: 13.5px;
}

.nav-leaf-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4d6b64;
  flex: 0 0 5px;
  transition: background 0.15s;
}
.nav-leaf:hover .nav-leaf-dot { background: #94a3b8; }
.nav-leaf.active .nav-leaf-dot { background: #fff; }

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

/* 当前叶子所在分类：分类头常亮 */
.active-cat > .nav-cat-head {
  color: #fff;
  background: rgba(15,110,86,0.22);
}
.active-cat > .nav-cat-head .nav-cat-arrow { color: #7dd3b8; }

/* 侧栏计数徽标（H6：只在 >0 且非全量时由 JS 输出） */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #b45309;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  flex: 0 0 auto;
}

/* ---------- ③ 首页 · 角色感知工作台 ---------- */
.hm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.hm-greet {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.hm-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.hm-scope {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 2px;
}
.hm-date { font-size: 13px; color: var(--color-text-light); }

/* KPI 行：一行 4 格，共用边框（不是 4 张独立卡） */
.hm-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 18px;
}
.hm-kpi {
  padding: 15px 16px;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.15s;
}
.hm-kpi:last-child { border-right: none; }
.hm-kpi:hover { background: #f8fafc; }
.hm-kpi-top { display: flex; align-items: center; gap: 8px; }
.hm-kpi-ico { font-size: 16px; }
.hm-kpi-label { font-size: 12.5px; color: var(--color-text-secondary); }
.hm-kpi-val {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.05;
  color: #0f172a;
}
.hm-kpi-val.urgent { color: var(--color-danger); }
.hm-kpi-sub { margin-top: 5px; font-size: 12px; color: var(--color-text-light); }

/* 待办流 */
.hm-todo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.hm-todo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.hm-todo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
.hm-todo.urgent { border-left: 3px solid var(--color-danger); }
.hm-todo-ico { font-size: 20px; flex: 0 0 auto; }
.hm-todo-main { flex: 1; min-width: 0; }
.hm-todo-label { font-size: 14px; font-weight: 600; color: #0f172a; }
.hm-todo-desc {
  margin-top: 3px;
  font-size: 12px;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-todo-count {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 17px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.hm-todo-count.on { background: var(--color-danger); color: #fff; }
.hm-todo-count.done { background: var(--color-success-light); color: #15803d; }

/* 快捷入口 */
.hm-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hm-quick-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.hm-quick-item:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
}

/* 提示带 */
.hm-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border-left: 3px solid var(--color-primary);
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
}
.hm-tip-ico { flex: 0 0 auto; }

.hm-sec {
  margin-bottom: 18px;
}
.hm-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.hm-sec-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.hm-sec-extra { font-size: 12px; color: var(--color-text-light); }

/* 窄屏：KPI 2 列、待办 1 列 */
@media (max-width: 900px) {
  .hm-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .hm-kpi { border-bottom: 1px solid var(--color-border); }
  .hm-todo-grid { grid-template-columns: 1fr; }
}

/* ---------- ④ 首页执行页：6 格 KPI 标签/副文不折行（窄屏下原本折成两行） ---------- */
.dash-kpi .stat-card > div:first-child > div + div { white-space: nowrap; }
.dash-kpi .stat-sub { font-size: 11px; line-height: 1.4; }   /* 副文允许折行，不截断金额 */
