/* ══════════════════════════════════════════════════════════════
   WMS Brain v2 · 深度整改（对齐 PM 采购智脑设计系统）
   2026-10-26 · 令牌桥接 + 扁平组件 + 暗色主题 + 交互精修
   加载顺序：brain-skin.css 之后（本文件为最终覆盖层）
   ══════════════════════════════════════════════════════════════ */

:root {
  /* ── PM 同源设计令牌 ── */
  --accent: #0057d2;
  --accent-strong: #0040b0;
  --accent-weak: rgba(0, 87, 210, 0.08);
  --topbar-grad: linear-gradient(90deg, #022879 0%, #0040b0 60%, #0a6ed1 100%);
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2f8;
  --text: #0b1b36;
  --text-heading: #0f1e33;
  --muted: #566a87;
  --border: #e3e8f0;
  --border-soft: #edf1f8;
  --ok: #059669;     --ok-bg: #e9f7f1;
  --warn: #d97706;   --warn-bg: #fdf3e3;
  --danger: #dc2626; --danger-bg: #fdecec;
  --info: #2563eb;   --info-bg: #e9f0fd;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --gutter: 24px;
  --shadow: 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 8px 24px -8px rgba(16,24,40,.14);
  --brain-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei UI', 'Helvetica Neue', sans-serif;

  /* ── 旧变量名桥接（WMS 各 css 全量继承） ── */
  --primary: var(--accent);
  --primary-hover: var(--accent-strong);
  --primary-50: #e9f0fd;  --primary-100: #d5e3fb; --primary-200: #adc6f5;
  --primary-300: #7ea5ee; --primary-400: #4d82e4; --primary-500: #0a6ed1;
  --primary-600: var(--accent); --primary-700: var(--accent-strong);
  --primary-800: #022879; --primary-900: #021c56;
  --gray-50: var(--surface-2); --gray-100: var(--surface-3); --gray-200: var(--border);
  --gray-300: #d6dee9; --gray-400: #93a5bd; --gray-500: var(--muted);
  --gray-600: #33415a; --gray-700: var(--text-heading); --gray-800: var(--text); --gray-900: var(--text);
  --success: var(--ok);      --success-light: var(--ok-bg);
  --warning: var(--warn);    --warning-light: var(--warn-bg);
  --danger-light: var(--danger-bg);
  --card: var(--surface);
  --hover: var(--surface-2);
  --bg-primary: var(--surface);
  --bg-secondary: var(--bg);
  --bg-tertiary: var(--surface-3);
  --bg-page: var(--bg);
  --text-primary: var(--text);
  --text-secondary: #33415a;
  --text-tertiary: var(--muted);
  --border-light: var(--border-soft);
  --border-medium: var(--border);
  --focus-ring: 0 0 0 3px var(--accent-weak);
  --transition-fast: .15s ease;
  --gradient-sidebar: linear-gradient(180deg, #022879 0%, #0040b0 55%, #0a6ed1 100%);

  /* ── 统计卡渐变降调为克制浅底（对齐 PM 扁平风） ── */
  --gradient-stat-blue:   linear-gradient(135deg, #e9f0fd 0%, #d5e3fb 100%);
  --gradient-stat-green:  linear-gradient(135deg, #e9f7f1 0%, #d2efe2 100%);
  --gradient-stat-purple: linear-gradient(135deg, #eef2f8 0%, #d5e3fb 100%);
  --gradient-stat-pink:   linear-gradient(135deg, #fdf3e3 0%, #f9e8c9 100%);
}

/* ══ 暗色主题 ══ */
:root[data-theme='dark'] {
  --bg: #0e1526;
  --surface: #16203a;
  --surface-2: #1b2745;
  --surface-3: #223055;
  --text: #e6edf7;
  --text-heading: #f4f7fb;
  --muted: #8fa1bd;
  --border: #26334f;
  --border-soft: #1f2b47;
  --accent: #4d8dff;
  --accent-strong: #79a8ff;
  --accent-weak: rgba(77,141,255,.16);
  --ok: #34d399;    --ok-bg: rgba(52,211,153,.13);
  --warn: #fbbf24;  --warn-bg: rgba(251,191,36,.13);
  --danger: #f87171; --danger-bg: rgba(248,113,113,.13);
  --info: #60a5fa;  --info-bg: rgba(96,165,250,.13);
  --gradient-sidebar: linear-gradient(180deg, #0a1220 0%, #0d1a33 60%, #12305c 100%);
  --gradient-stat-blue:   linear-gradient(135deg, #16203a 0%, #1b2c52 100%);
  --gradient-stat-green:  linear-gradient(135deg, #16203a 0%, #16332e 100%);
  --gradient-stat-purple: linear-gradient(135deg, #16203a 0%, #24305a 100%);
  --gradient-stat-pink:   linear-gradient(135deg, #16203a 0%, #33291b 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 24px -8px rgba(0,0,0,.5);
}

/* ══ 全局基底 ══ */
body { font-family: var(--brain-font); background: var(--bg) !important; color: var(--text); transition: background-color .2s ease, color .2s ease; }
::selection { background: var(--accent-weak); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ══ 侧栏（深蓝渐变 · 扁平 · 左竖条 active）══ */
.sidebar { background: var(--gradient-sidebar) !important; box-shadow: none !important; }
.sidebar-header { border-bottom: 1px solid rgba(255,255,255,.10); }
.sidebar-header h1 { letter-spacing: .06em; font-weight: 800; }
.nav-section-title { color: rgba(255,255,255,.42) !important; font-size: 10.5px !important; letter-spacing: 1.4px; text-transform: uppercase; }
.sidebar .nav-item {
  position: relative; color: rgba(255,255,255,.72);
  border-radius: 8px; margin: 0 4px 2px; transition: background-color .18s ease, color .18s ease;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,.10) !important; color: #fff; }
.sidebar .nav-item.active {
  background: rgba(255,255,255,.16) !important; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}
.sidebar .nav-item.active::before {
  content: ''; position: absolute; left: -4px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: #7dd3fc;
}
.nav-item-icon svg { width: 18px; height: 18px; }
.user-profile:hover { background: rgba(255,255,255,.08); }
.logout-btn { background: rgba(255,255,255,.10) !important; border: 1px solid rgba(255,255,255,.20) !important; color: #fff !important; border-radius: 8px !important; transition: var(--transition-fast, .15s ease); }
.logout-btn:hover { background: rgba(255,255,255,.20) !important; }

/* 主题切换按钮（wms-theme.js 注入） */
.wms-theme-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 8px); margin: 2px 4px 6px; padding: 9px 10px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.85);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: .15s ease; font-family: inherit;
}
.wms-theme-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.wms-theme-btn svg { width: 15px; height: 15px; flex: none; }
.wms-theme-btn .ic-sun { display: none; }
:root[data-theme='dark'] .wms-theme-btn .ic-sun { display: inline-block; }
:root[data-theme='dark'] .wms-theme-btn .ic-moon { display: none; }
.sidebar.collapsed .wms-theme-btn span { display: none; }

/* ══ 主区 / 顶栏 ══ */
.main-content { background: var(--bg) !important; }
.top-bar {
  background: var(--surface) !important; box-shadow: none !important;
  border-bottom: 1px solid var(--border) !important;
}
.breadcrumb, .breadcrumb-item { color: var(--muted) !important; }
.breadcrumb-item:hover { color: var(--accent) !important; }
.top-bar-action { position: relative; color: var(--muted); border-radius: 8px; }
.top-bar-action:hover { background: var(--surface-2); color: var(--accent); }
.top-bar-action-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; border-radius: 8px;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
}
.user-menu-avatar, .user-avatar { background: var(--accent-weak) !important; color: var(--accent) !important; font-weight: 700; }

/* ══ 页面头 ══ */
.page-header-modern { border-bottom: 1px solid var(--border) !important; }
.page-title-modern { color: var(--text-heading) !important; font-weight: 800; letter-spacing: .01em; }
.page-subtitle-modern { color: var(--muted) !important; }

/* ══ 统计卡：渐变 → PM 式浅底 + 左竖条 + 等宽大数字 ══ */
.stat-card-modern, .stat-card, .stock-card, .location-card {
  background: var(--surface) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
  box-shadow: none !important; position: relative;
}
.stat-card-modern::before, .stat-card::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.stat-card-modern { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.stat-card-modern:hover, .stat-card:hover, .stock-card:hover {
  border-color: var(--accent) !important; box-shadow: var(--shadow-lg) !important;
}
.stat-card-modern[onclick]:hover { transform: none; }
.stat-card-modern .stat-card-value, .stat-card .stat-value, .stock-value {
  font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--text-heading) !important; line-height: 1.2;
}
.stat-card-modern .stat-card-label, .stat-card .stat-label, .stock-label {
  font-size: 12px; color: var(--muted) !important; letter-spacing: .02em;
}
.stat-card-blue::before   { background: var(--accent); }
.stat-card-green::before  { background: var(--ok); }
.stat-card-yellow::before { background: var(--warn); }
.stat-card-cyan::before, .stat-card-purple::before { background: var(--info); }
.stat-card-pink::before   { background: var(--danger); }
.stat-card-icon {
  background: var(--surface-3) !important; border-radius: 10px;
  width: 44px; height: 44px; font-size: 20px;
}

/* ══ 卡片 / 工具栏 / 容器 ══ */
.card, .chart-card, .table-container, .filter-toolbar-modern,
.stock-filters, .stock-filters-section, .records-section, .location-section {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important; border-radius: var(--radius) !important;
}
.filter-toolbar-modern { padding: 14px 16px; }
.chart-card h3, .chart-title, .card h3, .card-title, .location-section h3, .records-header h3 {
  color: var(--text-heading) !important; font-weight: 700;
}
.chart-header, .card-header, .records-header, .location-section h3 { border-bottom: 1px solid var(--border-soft) !important; }
.outbound-card { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: none !important; }
.outbound-card:hover { border-color: var(--accent) !important; box-shadow: var(--shadow-lg) !important; transform: none !important; }

/* ══ 表格：扁平 · 吸顶 · 斑马 · 等宽数字 ══ */
.table, .data-table, .records-table { font-size: 13px; color: var(--text); }
.table thead th, .data-table thead th, .records-table thead th {
  background: var(--surface-2) !important; color: var(--text-heading) !important;
  font-weight: 600; font-size: 12.5px; padding: 11px 14px;
  border-bottom: 1px solid var(--border) !important; position: sticky; top: 0; z-index: 5;
}
.table tbody td, .data-table tbody td, .records-table tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-soft) !important;
  color: var(--text) !important; background: transparent;
}
.table tbody tr:hover td, .data-table tbody tr:hover td, .records-table tbody tr:hover td { background: var(--surface-2) !important; }

/* ══ 按钮：实底 · 无渐变 · hover 加深 · 按压反馈 ══ */
.btn, .btn-primary, .btn-secondary, .btn-secondary-modern, .btn-primary-modern, .stock-filter-btn, .stock-filter-btn-inline {
  font-family: inherit; border-radius: var(--radius) !important;
  transition: .15s ease; box-shadow: none !important;
}
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-primary-modern:active { transform: translateY(1px); }
.btn-primary, .btn-primary-modern {
  background: var(--accent) !important; color: #fff !important; border: 1px solid transparent !important;
}
.btn-primary:hover, .btn-primary-modern:hover { background: var(--accent-strong) !important; transform: none; box-shadow: 0 4px 12px rgba(0,87,210,.25) !important; }
.btn-secondary, .btn-secondary-modern {
  background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important;
}
.btn-secondary:hover, .btn-secondary-modern:hover { background: var(--surface-2) !important; border-color: var(--accent) !important; color: var(--accent) !important; }
.btn-danger { background: var(--danger) !important; color: #fff !important; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

/* 筛选 chips（库存状态等）统一 PM 胶囊 */
.stock-filter-btn, .stock-filter-btn-inline, .view-toggle-btn, .tab-btn {
  border-radius: var(--radius-pill) !important; font-weight: 600;
  background: var(--surface) !important; color: var(--muted) !important;
  border: 1px solid var(--border) !important;
}
.stock-filter-btn:hover, .stock-filter-btn-inline:hover, .view-toggle-btn:hover, .tab-btn:hover {
  border-color: var(--accent) !important; color: var(--accent) !important; transform: none;
}
.stock-filter-btn.active, .stock-filter-btn-inline.active, .view-toggle-btn.active, .tab-btn.active {
  background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important;
}
.view-toggle-modern { background: var(--surface-3) !important; border-radius: var(--radius-pill) !important; padding: 3px; }

/* ══ 徽章：浅底深字（PM 语义） ══ */
.status-badge, .badge, .repair-status, .record-type-badge, .cat-badge, .loc-badge {
  border-radius: var(--radius-pill) !important; font-weight: 600; font-size: 11.5px;
  padding: 4px 10px;
}
.status-success, .badge-ok, .repair-status.已完成, .status-badge:is(.green, .success) { background: var(--ok-bg) !important; color: var(--ok) !important; }
.status-warning, .badge-warn { background: var(--warn-bg) !important; color: var(--warn) !important; }
.status-danger, .badge-danger { background: var(--danger-bg) !important; color: var(--danger) !important; }
.status-info, .badge-info { background: var(--info-bg) !important; color: var(--info) !important; }

/* ══ 表单 ══ */
.form-input, .form-textarea, .form-select, .search-input, input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  background: var(--surface) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
  font-family: inherit; font-size: 13.5px; transition: .15s ease;
}
.form-input:focus, .form-textarea:focus, .search-input:focus, input:focus, select:focus, textarea:focus {
  outline: none !important; border-color: var(--accent) !important; box-shadow: var(--focus-ring) !important;
}
::placeholder { color: #93a5bd; }
.form-label, label { color: var(--text-secondary) !important; font-weight: 600; font-size: 12.5px; }
.form-label-required::after { content: ' *'; color: var(--danger); }

/* ══ 弹窗：遮罩 + 入场动效 ══ */
.modal-overlay, .overlay { background: rgba(11,27,54,.45) !important; }
.modal-content, .modal-card, .dialog {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-lg) !important; color: var(--text) !important;
}
.modal.show .modal-content, .modal.show .modal-card { animation: wmsPop .18s ease; }
@keyframes wmsPop { from { transform: scale(.97) translateY(6px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-header { border-bottom: 1px solid var(--border-soft) !important; }
.modal-footer { border-top: 1px solid var(--border-soft) !important; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-header h2, .modal-header h3 { color: var(--text-heading) !important; font-weight: 800; }
.modal-close { color: var(--muted) !important; border-radius: 8px; }
.modal-close:hover { background: var(--danger-bg) !important; color: var(--danger) !important; }

/* ══ 空态 ══ */
.empty-state, .empty-state-card { color: var(--muted) !important; }
.empty-state-icon { opacity: .5; }

/* ══ 详情弹窗内块 ══ */
.stats-bar, .product-header, .record-tabs, .detail-*, .info-row { color: var(--text); }
.stat-bar-item { background: var(--surface-2) !important; border: 1px solid var(--border-soft) !important; border-radius: var(--radius) !important; }
.stat-bar-item .stat-value { color: var(--text-heading) !important; font-variant-numeric: tabular-nums; }
.stat-bar-item .stat-label { color: var(--muted) !important; }

/* ══ 登录页 ══ */
.auth-page, .auth-container { background: var(--topbar-grad) !important; }
.auth-form-container, .auth-form { background: var(--surface) !important; border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-lg) !important; color: var(--text) !important; }
.auth-title { color: var(--text-heading) !important; }
.auth-subtitle, .auth-footer { color: var(--muted) !important; }

/* ══ 深色模式下仍写死浅色内容的组件兜底 ══ */
:root[data-theme='dark'] .outbound-card-body > div, 
:root[data-theme='dark'] .inbound-card,
:root[data-theme='dark'] .records-table-container,
:root[data-theme='dark'] .photo-preview,
:root[data-theme='dark'] .chart-container,
:root[data-theme='dark'] .pagination { background: transparent !important; }
:root[data-theme='dark'] .location-qty-list > div,
:root[data-theme='dark'] .record-card { background: var(--surface-2) !important; color: var(--text) !important; }
:root[data-theme='dark'] img { opacity: .92; }

/* ══ 响应式 ══ */
@media (max-width: 1200px) {
  .stats-row-modern { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
  :root { --gutter: 14px; }
  .stats-row-modern { grid-template-columns: 1fr !important; }
  .filter-toolbar-modern .search-input { max-width: none; }
  .top-bar { padding: 10px 14px !important; }
}

/* ══════════════════════════════════════════════════════════════
   deep-2 · 仪表盘/页面级深修（修复快捷卡溢出 + 对齐 brain 扁平风）
   ══════════════════════════════════════════════════════════════ */

/* ── 网格溢出根治：1fr 默认 min-width:auto，长文本会撑破轨道 ── */
/* deep-5 修正：保留各页原列数，只让子项可收缩防溢出 */
.quick-actions-section { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid > *, .charts-grid > *, .stats-row-modern > *, .quick-actions-section > * { min-width: 0; }
@media (max-width: 768px) {
  .quick-actions-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 快捷操作卡：扁平白底 + 文本截断不溢出 ── */
.quick-action-card {
  min-width: 0; padding: 18px 16px !important;
  background: var(--surface) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
  box-shadow: none !important; text-align: left !important;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.quick-action-card:hover { transform: none !important; border-color: var(--accent) !important; box-shadow: var(--shadow-lg) !important; }
.quick-action-card::before { display: none !important; }
.quick-action-icon-wrapper {
  width: 40px !important; height: 40px !important; border-radius: 10px !important;
  background: var(--accent-weak) !important; box-shadow: none !important; margin-bottom: 10px !important;
}
.quick-action-icon, .quick-action-icon-wrapper svg, .quick-action-icon-wrapper i { color: var(--accent) !important; background: transparent !important; }
.quick-action-card:nth-child(1) .quick-action-icon-wrapper,
.quick-action-card:nth-child(2) .quick-action-icon-wrapper,
.quick-action-card:nth-child(3) .quick-action-icon-wrapper,
.quick-action-card:nth-child(4) .quick-action-icon-wrapper { background: var(--accent-weak) !important; }
.quick-action-title { font-size: 14px !important; font-weight: 700 !important; color: var(--text-heading) !important; }
.quick-action-desc {
  font-size: 12px !important; color: var(--muted) !important;
  white-space: normal !important; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ── 统计卡（dashboard 版 .stat-card）：扁平 + 左竖条 + 等宽数字 ── */
.stats-grid .stat-card {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important; box-shadow: none !important;
  position: relative; overflow: hidden; min-width: 0;
}
.stats-grid .stat-card::after {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.stats-grid .stat-card.warning::after { background: var(--warn); }
.stats-grid .stat-card.danger::after  { background: var(--danger); }
.stats-grid .stat-card.success::after { background: var(--ok); }
.stat-header { gap: 10px; }
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: var(--surface-3) !important; color: var(--accent) !important;
}
.stat-content { min-width: 0; }
.stats-grid .stat-value, .stat-card .stat-value {
  font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--text-heading) !important; line-height: 1.2;
}
.stats-grid .stat-label, .stat-card .stat-label { font-size: 12px; color: var(--muted) !important; }
.stat-desc, .stat-trend { font-size: 11.5px !important; color: var(--muted) !important; }
.stat-trend.up { color: var(--ok) !important; }
.stat-trend.down { color: var(--danger) !important; }

/* ── 图表卡：扁平边框，去装饰条 ── */
.chart-card {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important; box-shadow: none !important; min-width: 0;
}
.chart-card::before { display: none !important; }
.chart-header { flex-wrap: wrap; gap: 8px; }
.chart-card .chart-title { font-size: 14px; font-weight: 700; color: var(--text-heading) !important; }
.chart-actions .ops-tab { border-radius: var(--radius-pill) !important; }
.ops-tab.active { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.ops-tab:hover { border-color: var(--accent) !important; color: var(--accent) !important; }

/* ── 最近操作表：徽章统一 + hover ── */
.recent-ops-table th {
  background: var(--surface-2) !important; color: var(--text-heading) !important;
  font-weight: 600; border-bottom: 1px solid var(--border) !important;
}
.recent-ops-table td { border-bottom: 1px solid var(--border-soft) !important; color: var(--text) !important; }
.recent-ops-table tr:nth-child(even) { background: transparent; }
.recent-ops-table tbody tr:hover { background: var(--surface-2) !important; }
.ops-type-badge { border-radius: var(--radius-pill) !important; font-weight: 600; }
.ops-type-badge.in   { background: var(--ok-bg) !important; color: var(--ok) !important; }
.ops-type-badge.out  { background: var(--info-bg) !important; color: var(--info) !important; }
.ops-type-badge.repair { background: var(--warn-bg) !important; color: var(--warn) !important; }
.ops-qty.in { color: var(--ok) !important; }
.ops-qty.out { color: var(--danger) !important; }
.ops-date { color: var(--muted) !important; font-variant-numeric: tabular-nums; }

/* ── 通用：卡片视图网格 + 长文本防溢出兜底 ── */
.cards-grid, .inbound-cards-grid, .stock-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.outbound-info-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.outbound-card, .inbound-card { min-width: 0; }
.outbound-info-value, .inbound-info-value {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-name, .outbound-id, .outbound-date { min-width: 0; }
.item-card .item-name { word-break: break-all; }

/* deep-2b · 宽表格横向滚动兜底 + 单元格内长文本截断 */
.table-container, .records-table-container { overflow-x: auto; }
.data-table, .records-table, .table { min-width: 100%; }
.data-table td .badge { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.group-header > span:first-child, .order-item > div:first-child > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-row, .info-row { min-width: 0; }
.detail-row span:last-child, .info-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 顶栏通知区在小屏折叠（防右上溢出） ── */
.top-bar-right { flex: none; gap: 10px; }
@media (max-width: 768px) {
  .top-bar-action + .user-menu .user-menu-name { display: none; }
}

/* deep-2c · 订单选择列表溢出精修（灵哥截图：长订单名把"未开始"徽章挤出容器） */
.order-item, .order-group { min-width: 0; overflow: hidden; }
.order-item > div { min-width: 0; }
.order-item > div:first-child { display: flex !important; align-items: center; min-width: 0; }
.order-item > div:first-child > span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-item > div:first-child > span:last-child { flex: none; }
.order-item > div:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-header { min-width: 0; }
.group-header > span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-header > span:first-child > span { white-space: nowrap; }
#hierarchicalOrderList { overflow-x: hidden; }
#selectedOrderDisplay { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 物品联想下拉同治 */
.autocomplete-item { min-width: 0; }
.autocomplete-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════
   deep-5-modal · 出入库弹窗规整（只锚定独有 ID/类，零跨页影响）
   ══════════════════════════════════════════════════════════════ */
#addOutModal .modal-container { max-width: 960px; }
#addInModal .modal-container { max-width: 620px; }

/* 订单窄列：chips 自动换行、搜索框/列表/提示条全列宽自适应 */
.out-order-col { min-width: 0; }
.out-order-col .quick-filter-btn { padding: 3px 8px !important; font-size: 10.5px !important; }
.out-order-col #hierarchicalOrderList { max-height: 300px; }
.out-order-col .order-item { padding: 6px 8px !important; }
.out-order-col .group-header { padding: 7px 8px !important; font-size: 12px !important; }

/* 列表里关联订单徽章限宽（长订单名不再撑列） */
#outboundListBody .badge { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.outbound-card .outbound-info-item { min-width: 0; }
.outbound-card .outbound-info-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 编辑弹窗数字/日期字段等宽对齐（数据规整） */
#addOutModal .form-input, #addInModal .form-input { font-variant-numeric: tabular-nums; }
#addOutModal .form-group, #addInModal .form-group { margin-bottom: 12px; }
#addOutModal .form-label, #addInModal .form-label { margin-bottom: 4px; display: inline-block; }

/* 暗色模式弹窗字段底色修正（readonly 灰底在暗色下刺眼） */
:root[data-theme='dark'] #addOutModal .form-input[readonly],
:root[data-theme='dark'] #addInModal .form-input[readonly] {
  background: var(--surface-3) !important; color: var(--muted) !important;
}

/* de-emoji v1 · Lucide 图标尺寸 + 空图标容器隐藏 */
.nav-item-icon svg, .stat-card-icon svg, .stat-icon svg, .quick-action-icon svg { width:18px; height:18px; display:block; }
.stat-card-icon:has(svg), .stat-icon:has(svg) { background:var(--surface-3) !important; display:grid; place-items:center; color:var(--accent); }
.empty-state-icon:empty, .stat-card-icon:empty, .stat-icon:empty, .quick-action-icon:empty, .nav-item-icon:empty { display:none; }
.page-title-modern, .card-title, .modal-header h2 { letter-spacing:.01em; }
