/* ============================================
   鞋业ERP系统 v8.0 - 全局样式
   ============================================ */

:root {
    /* ★★ 第253轮（老板 2026-10-09）：「导航栏再**缩窄 5%**」168 → 160（再瘦一圈） */
    --sidebar-width: 160px;   /* 240 -> 200 -> 168 -> 160 */
    --header-height: 0px;     /* ★ 09-21：取消整条顶部栏 → 归零，内容区自动铺满全屏 */
    --sidebar-bg: #1a2332;
    --sidebar-bg-hover: #2a3a52;
    --sidebar-active: #3b82f6;
    --content-bg: #f0f2f5;
    --card-bg: #ffffff;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--content-bg);
    color: var(--text-dark);
    font-size: 14px;
    overflow: hidden;
    height: 100vh;
}

/* ========== 顶部栏 ========== */
.top-header {
    height: var(--header-height);
    background: linear-gradient(135deg, #1a2332 0%, #233044 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-toggle-sidebar {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.btn-toggle-sidebar:hover {
    background: rgba(255,255,255,0.2);
}

/* ★ 老板 09-23 需求3：「侧边栏收起后打开不回来」的死路修复 ——
   收起时 .sidebar 宽度变 0，里面的折叠按钮一起消失。这个浮动按钮**只在收起时出现**，
   固定在左上角，永远可点。显示/隐藏由 app.js::syncSidebarRestore() 控制。 */
.btn-restore-sidebar {
    position: fixed;
    top: calc(var(--header-height) + 6px);
    left: 8px;
    z-index: 1060;
    display: none;              /* 默认藏（展开状态下用侧边栏里的那个按钮） */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    padding: 0;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.btn-restore-sidebar:hover {
    background: #f1f3f5;
}

.system-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-tag {
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.company-name {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.user-info:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown-menu {
    font-size: 13px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ========== 主布局 ========== */
.main-wrapper {
    display: flex;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    flex-shrink: 0;
    /* ★★ 第155轮（老板 09-30）：子菜单改成「悬停 → 右侧弹出卡片」后，这里**不能再裁溢出** ——
       原来 `overflow-y:auto` 会把绝对定位的浮层**整个裁掉**（浮层就挂在侧边栏右边）。
       放开安全：子项都进了浮层，侧边栏只剩 7 个**大类** + 顶部/底部，不再需要滚动。
       （窄屏抽屉模式在下面的 media query 里恢复 `overflow-y:auto`，那边浮层改回内联展开。） */
    overflow: visible;
    transition: width 0.3s ease;
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 1041;      /* ★ 第155轮：浮层要盖在内容区之上 */
}

.sidebar.collapsed {
    width: 0;
}

/* ★★ 第265轮（老板 2026-10-10）：「点击隐藏边栏的按钮后，**账号这里也要隐藏**」——
   收起态原来只把宽度收成 0，而 `.sidebar` 是 `overflow: visible`（第155轮为了子菜单浮层能溢出）
   ⇒ 里面的内容（顶栏的账号 + 菜单）会"漏"在内容区上（老板截图里就是那个悬空的「系统管理员」）。
   这里把收起态的内层整体藏掉；展开靠外面那个浮动的 `.btn-restore-sidebar`。
   ⚠️ **只对桌面生效**：窄屏（≤900px）抽屉模式会把 `.collapsed` 重新撑成 268px 宽，
      那时候内容必须照常显示，所以用 min-width: 901px 圈住。 */
@media (min-width: 901px) {
    .sidebar.collapsed > * { visibility: hidden; }
}

.sidebar-nav {
    padding: 8px 0;
}

/* ★★ 第155轮（老板 09-30）：「将侧边栏的展开关闭，更改为浮窗 —— 鼠标指向这个大类，右边推出来卡片」
   ⇒ 子菜单从"点击展开/收起（内联）"改成"**悬停 → 右侧弹出卡片**"：
     · `.menu-group` 作为定位锚点（relative）；
     · `.menu-group-items` 绝对定位到侧边栏右侧，默认隐藏，`:hover` 时弹出并带一点"推出来"的位移动画；
     · 浮层改成**浅色卡片**（原来那些菜单项是深色侧边栏里的白字，直接搬进白底会看不清）；
     · `::before` 是"过桥"：侧边栏与浮层之间的 8px 空隙也要能接到鼠标，否则鼠标一挪动浮层就消失。
   点击大类不再展开/收起（`toggleMenuGroup` 在桌面端改成空操作）；**窄屏抽屉仍用点击展开**（见下方 media query）。 */
.menu-group {
    margin-bottom: 4px;
    position: relative;
}

.menu-group-title {
    padding: 8px 14px 5px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color 0.2s;
}

.menu-group-title:hover {
    color: rgba(255,255,255,0.7);
}

/* ★ 第155轮：悬停整个大类时给个明显高亮 —— 让老板知道"鼠标停在这块会上右边弹卡片" */
.menu-group:hover > .menu-group-title {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border-radius: 6px;
}

.menu-group-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.5;
    /* ★ 第155轮：箭头改成"指向右侧"的提示（子菜单现在从右边弹出）——原 `chevron-down` 转 -90° */
    transform: rotate(-90deg);
}

.menu-group-title:hover .menu-group-arrow {
    opacity: 1;
}

/* 桌面端：`.collapsed` 不再参与显隐（浮窗由 :hover 控制）——
   原来的 `overflow:hidden` 也要放开，否则浮层被裁。 */
.menu-group-items {
    overflow: visible;
}

/* ★ 第155轮：浮窗卡片本体 */
.menu-group > .menu-group-items {
    position: absolute;
    left: 100%;
    top: -6px;
    margin-left: 8px;
    min-width: 172px;
    max-height: 72vh;
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .22), 0 0 0 1px rgba(15, 23, 42, .06);
    display: none;
    z-index: 1090;
}
.menu-group:hover > .menu-group-items {
    display: block;
    animation: menuCardIn .16s ease-out;
}
@keyframes menuCardIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: none; }
}
/* ★ 第242轮（老板）：「左边主菜单的二级菜单浮动显示**多保留一会**，现在太灵敏了，鼠标慢一点就丢失浮窗」
   —— 原来靠 `display:none/block` 切换（display 不能做过渡，鼠标一离开**立刻**消失）。
   桌面端改成 `visibility + opacity`：**出现不延迟、消失延迟 0.5 秒**，
   给鼠标从大类挪到浮窗的途中留出容错时间（窄屏抽屉仍是点击展开，不受影响）。 */
@media (min-width: 769px) {
    .menu-group > .menu-group-items {
        display: block;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity .14s ease, visibility 0s;               /* 延迟交给 app.js 的计时（否则"出现"也会迟疑 0.5s） */
    }
    .menu-group:hover > .menu-group-items {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition: opacity .14s ease, visibility 0s;              /* ← 出现不延迟 */
        animation: menuCardIn .16s ease-out;
    }
}
/* ★ 第242轮：JS 的「延迟收起」类（见 app.js 的 _menuHoverDelayBound）——
   出现不延迟，**收起由 JS 计时 0.5s** 后才生效。 */
.menu-group.menu-open > .menu-group-items {
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
/* 过桥：补上侧边栏与浮层之间那 8px，鼠标移过去不会掉 */
.menu-group > .menu-group-items::before {
    content: '';
    position: absolute;
    left: -10px; top: 0; width: 10px; height: 100%;
}
/* 浮层里的菜单项：浅色卡片风格（原样式是深色侧边栏用的白字） */
.menu-group > .menu-group-items .menu-item {
    color: #334155;
    border-left: 0;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 13px;
    gap: 8px;
}
.menu-group > .menu-group-items .menu-item:hover {
    background: #eef4ff;
    color: #1c5fd6;
}
.menu-group > .menu-group-items .menu-item i { color: #64748b; }
.menu-group > .menu-group-items .menu-item:hover i { color: #1c5fd6; }
/* 浮层里已置灰的项（模块未授权）保持原样可辨 */
.menu-group > .menu-group-items .menu-item.disabled,
.menu-group > .menu-group-items .menu-item.is-locked { opacity: .5; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--sidebar-bg-hover);
    color: #fff;
}

.menu-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ★ 第97轮（老板 09-26）：未授权模块 —— 菜单**仍然显示**（让客户看到有这些功能可升级），
   但置灰、加锁、点了只弹提示不跳页。真正的门禁在后端（license_guard.py），这里只是明示。 */
.menu-item.menu-locked {
    color: rgba(255, 255, 255, 0.28) !important;
    cursor: not-allowed !important;
    background: transparent !important;
    border-left-color: transparent !important;
}
.menu-item.menu-locked:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    color: rgba(255, 255, 255, 0.34) !important;
}
.menu-item.menu-locked i {
    opacity: 0.5;
}
.menu-item .menu-lock-ico {
    width: auto !important;
    font-size: 10px !important;
    opacity: 0.75;
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* ========== 内容区 ========== */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    overflow-y: auto;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

.content-area.expanded {
    margin-left: 0;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

/* ★★ 第266轮（老板 2026-10-10）：「基础档案 —— 选项卡与内容之间的**缝隙取消**」——
   第242轮把各分类的「批量上传 / 新增」按钮**搬进搜索栏**后，原来那一行虽然被 `display:none`，
   但它自带 `mb-3`（16px 下边距）⇒ 标签卡与内容之间仍留一道缝。
   这里用 `:has()` 判"这行里已经没有按钮了"（比 `:empty` 可靠，模板里有空白文本节点）再压掉。 */
#baseDataTabContent .d-flex.gap-2.mb-3:not(:has(button)) { display: none !important; margin-bottom: 0 !important; }

/* ★★★ 第268轮（老板 2026-10-10 23:44）：从 20 版设计稿里选定「**方案 11 · 反层级 · 强上弱下**」——
   设计意图：把**用户最关心的「时间」放第一行**（扫视路径最短），「日期」退到第二行做成小标签，
   但**故意给它更重的字重、更深的颜色** ⇒ "反层级"张力：小字反而比大字更"重"（这是这一版的核心）。
     · **两行竖排**（`flex-direction: column`），**不要**边框/底色/药丸/竖线/图标 —— 设计稿就是纯文字；
     · 时间 15px / 500 / #334155；日期 10.5px / 600 / #0f172a + 字距 1.3px；
     · 数字 `tabular-nums` ⇒ 秒跳动不左右抖；行高 1.2 让两行总高（约 31px）不挤占右栏。
   ⚠️ 药丸版与"方框+竖线"版都已被老板否掉，**别再手贱加回去** —— 加回去就变回被否的形态。 */
.dash-clock {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}
.dash-clock .dc-time {
    font-size: 15px; font-weight: 500;
    color: #334155; letter-spacing: .3px;
}
.dash-clock .dc-date {
    font-size: 10.5px; font-weight: 600;
    color: #0f172a; letter-spacing: 1.3px;
    text-transform: uppercase; white-space: nowrap;
}

/* ★★ 第267轮（老板 2026-10-10）：「点击左侧第一个选项卡的时候，**左边接缝处的缺口要填起来**」——
   缺口 = 紧贴标签卡的那张内容卡片**左上角有 8px 圆角**，在标签卡正下方被切掉一小块、露出页面底色
   （放大 8 倍看就是标签卡左下角与卡片左上角之间那道月牙）。
   做法：把紧贴标签卡的那张卡片**左上角改直角**（右上角仍圆角），与标签卡左下角的直角对齐 ⇒ 缺口填平。
   ⚠️ 只作用于「基础档案 / 材料管理」两个页面的**内容区直属卡片**，不动别处。 */
#baseDataTabContent > .tab-pane > .card,
#materialTabs ~ .tab-content > .tab-pane > .card { border-top-left-radius: 0; }

/* ★★ 第267轮（老板 2026-10-10）：「材料管理上面的顶部区域也取消…选项卡和下面列表的间距、衔接
   **和档案（基础档案）关联类似**」⇒ 与基础档案同一套处理：
   ① 标签卡不再留下边距；② 被搬空的那一行（残留 mb-3=16px）压掉；③ 内容紧贴标签卡。 */
#materialTabs { margin-bottom: 0 !important; }
#materialTabs + .tab-content { margin-top: 0 !important; padding-top: 0 !important; }
#baseDataTabContent > .tab-pane,
#materialTabs + .tab-content > .tab-pane { padding-top: 0 !important; }
/* 搬空的按钮行（没有按钮了）→ 整行不占位（`:has()` 比 `:empty` 可靠：模板里有空白文本节点） */
.tab-content > .tab-pane > .d-flex.gap-2.mb-3:not(:has(button)) { display: none !important; margin-bottom: 0 !important; }

/* ========== 页面通用组件 ========== */
/* ★★ 第253轮（老板 2026-10-09）：「账户这里显示**职员头像**，昵称边上有个**下拉箭头**可以下拉退出登录」 */
.sidebar-user-dd { display: inline-flex; }
.sidebar-user-dd .sidebar-user { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sidebar-user-dd .su-avatar {
    width: 20px; height: 20px; border-radius: 50%; background: #334155; color: #cbd5e1;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.sidebar-user-dd .su-caret { font-size: 9px; opacity: .55; }
.sidebar-user-dd .dropdown-menu { font-size: 13px; min-width: 140px; }

/* ★★ 第253轮（老板）：「BOM 区域顶部**元素按钮高度不统一**」——
   这一排里既有 `btn-group-sm` 里的按钮、又有独立的 `btn-sm`，取整后高度会差 1~2px（深色按钮更显眼）。
   这里统一钉死高度与内边距，视觉上一条线。 */
.bom-topbar .btn { height: 28px; padding-top: 0; padding-bottom: 0;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.bom-topbar .btn-group .btn:not(:first-child) { margin-left: -1px; }

/* ★ 第253轮：数据看板去掉大标题后，这一行（设置/刷新）**收紧下边距** —— 让左侧内容上移 */
.dash-head { margin-bottom: 8px !important; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title i {
    color: var(--primary);
}

.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px 8px 0 0 !important;
}

.card-body {
    padding: 20px;
}

/* ========== 统计卡片 ========== */
.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.2;
}

.stat-info p {
    font-size: 12px;
    color: var(--text-gray);
    margin: 0;
}

/* ========== 按钮 ========== */
.btn {
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm {
    font-size: 12px;
    padding: 4px 10px;
}

/* ========== 表格 ========== */
.table {
    font-size: 13px;
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-gray);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    white-space: nowrap;
}

.table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* DataTables 样式覆盖 */
.dataTables_wrapper {
    font-size: 13px;
}

.dataTables_filter input,
.dataTables_length select {
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
}

.dataTables_filter input {
    width: 220px;
}

/* ========== 表单 ========== */
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.form-control, .form-select {
    font-size: 13px;
    border-radius: 6px;
    border-color: var(--border-color);
    padding: 7px 12px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========== 徽章 ========== */
.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 10px;
}

.badge-status-draft { background: #e2e8f0; color: #475569; }
.badge-status-active { background: #dbeafe; color: #1e40af; }
.badge-status-done { background: #d1fae5; color: #065f46; }
.badge-status-alert { background: #fee2e2; color: #991b1b; }

/* ========== 状态标签 ========== */
.status-normal { color: var(--success); font-weight: 500; }
.status-warning { color: var(--warning); font-weight: 500; }
.status-danger { color: var(--danger); font-weight: 500; }

/* ========== 搜索栏 ========== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.search-bar .form-control {
    max-width: 300px;
}

/* ========== 弹窗 ========== */
.modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========== 图片预览 ========== */
.img-thumbnail-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.img-preview-lg {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
}

/* ========== 操作按钮组 ========== */
.action-btns {
    display: flex;
    gap: 4px;
}

.action-btns .btn {
    padding: 3px 8px;
    font-size: 12px;
}

/* ========== Toast 通知 ========== */
.toast {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ========== 响应式 ========== */
/* 窄屏布局已统一到下方「移动端适配层」（≤900px）——这里只留卡片间距。
   ★ 原来这里写的是 `.sidebar{width:0}`，只把侧边栏压窄、却不给回菜单的入口，
     手机上进不去菜单（第74轮定位并修复）。 */
@media (max-width: 900px) {
    .stat-card {
        margin-bottom: 12px;
    }
}

/* ========== 通用表格交互层 grid.js ========== */
.grid-sel-dot {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    transition: all .15s;
}
tr.grid-selected .grid-sel-dot,
.grid-sel-dot.on {
    background: var(--primary);
    border-color: var(--primary);
}
td[data-sel] { text-align: center; cursor: pointer; width: 36px; }
td[data-edit] { cursor: cell; }
td.cell-focused {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: #eff6ff;
}
tr.grid-selected > td {
    background: #eef2ff !important;
}
tr.grid-boxing > td {
    background: #dbeafe !important;
}
.grid-box-overlay {
    position: fixed;
    background: rgba(59,130,246,0.15);
    border: 1px solid var(--primary);
    pointer-events: none;
    z-index: 1500;
}
.grid-edit-input { width: 100%; }

/* ========== 侧栏内的「顶栏替代」区（老板 09-21：取消整条顶部栏后移到这里） ========== */
.sidebar-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: rgba(255,255,255,0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-foot {
    margin-top: 10px;
    padding: 8px 0 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-company {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    padding: 0 14px 4px;
}

/* ========== 仪表盘卡片看板（第69轮 2026-09-24 老板：卡式维度看板）==========
   样式：白卡 + 顶部色条 + 数字 + 两个胶囊（本月/本年），参考老板给的样板图。
   ★ 09-24 二次调整（老板："卡片太大、字体太大"）→ 尺寸整体收一档、网格改 4 列，一屏看全。 */
/* 板块分区（老板 09-24：分区 + 板块之间要明显区分）——
   每个板块是一块**浅底圆角大卡**，标题左边一根主色竖条，卡片浮在上面 */
.dash-section {
    background: #f7f9fb;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    padding: 12px 14px 14px;
}
.dash-section + .dash-section { margin-top: 16px; }
.dash-section-plain { background: transparent; border: 0; padding: 0; }
.dash-section-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 11px; padding-left: 9px;
    border-left: 4px solid var(--sec-color, #3b82f6);
    border-radius: 2px;
}
.dash-section-head i { font-size: 15px; color: var(--sec-color, #3b82f6); }
.dash-section-title { font-size: 14.5px; font-weight: 700; color: var(--text-dark); }
.dash-section-desc { font-size: 11.5px; color: var(--text-light); }
.dash-section-count {
    font-size: 11px; color: #fff; background: var(--sec-color, #3b82f6);
    border-radius: 999px; padding: 1px 9px; margin-left: auto; opacity: .9;
}

/* 列数按**容器实际宽度**自动排（快捷操作搬到右栏后，左栏变窄也不会挤） */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
    gap: 12px;
}
@media (max-width: 560px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 11px 13px 10px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    border: 1px solid rgba(16, 24, 40, .04);
    overflow: hidden;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 24, 40, .12); }
.dash-card::before {
    content: '';
    position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: var(--dash-color, var(--primary));
}
.dash-card:active { transform: translateY(-1px); }

.dash-title {
    font-size: 12px; font-weight: 600; color: var(--text-gray);
    margin-bottom: 3px; letter-spacing: .1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-value {
    font-size: 23px; font-weight: 800; line-height: 1.15;
    color: var(--text-dark); letter-spacing: -.3px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-value .u { font-size: 11.5px; font-weight: 600; color: var(--text-light); margin-left: 3px; letter-spacing: 0; }
.dash-desc {
    font-size: 11px; color: var(--text-light); margin: 1px 0 7px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dash-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.dash-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: #f1f3f5; border-radius: 999px; padding: 2px 8px;
    font-size: 10.5px; color: var(--text-gray); white-space: nowrap;
}
.dash-pill i { font-size: 11px; opacity: .7; }
.dash-pill b { color: #344054; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 合并卡内部排版（订单 / 库存）：主数字 + 并排双数字 + 紧凑行，字号都比单卡小一档 */
.dash-lg { display: flex; align-items: baseline; gap: 6px; margin: 1px 0 8px; flex-wrap: wrap; }
.dash-lg-label { font-size: 11.5px; color: var(--text-gray); font-weight: 600; }
.dash-lg-value {
    font-size: 21px; font-weight: 800; color: var(--text-dark);
    letter-spacing: -.4px; font-variant-numeric: tabular-nums;
}
.dash-lg-extra { font-size: 12px; font-weight: 700; color: var(--text-gray); }

/* 并排项：固定两列（订单卡 4 项自动排成 2×2；库存卡 2 项排成一行） */
.dash-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin: 1px 0 6px; }
.dash-inline-cell { min-width: 0; }
.dash-inline-label { font-size: 10.5px; color: var(--text-light); margin-bottom: 1px; white-space: nowrap; }
.dash-inline-value {
    font-size: 15px; font-weight: 800; color: var(--text-dark);
    letter-spacing: -.3px; white-space: nowrap; font-variant-numeric: tabular-nums;
}

.dash-row { display: flex; align-items: center; gap: 6px; padding: 1.5px 0; font-size: 11.5px; }
.dash-row-label { color: var(--text-light); flex-shrink: 0; }
.dash-row-value {
    color: var(--text-dark); font-weight: 700;
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.dash-row-right { color: var(--text-gray); margin-left: auto; white-space: nowrap; }
/* ★ 老板 09-29（需求2/3）：可以点的行（跳「入库 → 布料/复合/材料」、或「出库 → 领料/报工」）
   —— 给个淡淡的底色 + hover 提示，让老板知道这行是能点的（整卡也能点，行点击不冒泡到卡片）。 */
.dash-row-link { cursor: pointer; border-radius: 5px; padding: 2px 5px; margin: 0 -5px; transition: background .12s, color .12s; }
.dash-row-link:hover { background: color-mix(in srgb, var(--dash-color, #3b82f6) 10%, transparent); }
.dash-row-link:hover .dash-row-right { color: var(--dash-color, #3b82f6); font-weight: 600; }

/* 卡片里的补充说明（如「订单交期」下方罗列指令单号） */
.dash-note {
    font-size: 10.5px; color: #98a2b3; line-height: 1.55;
    margin: 3px 0 7px; max-height: 34px; overflow: hidden;
}

/* 右侧「快捷操作」栏（老板 09-24：搬回右边，竖排按钮） */
.dash-side .card { border-radius: 10px; }
.dash-side .card-header {
    background: transparent; border-bottom: 1px solid var(--border-color);
    font-size: 13px; font-weight: 600; color: var(--text-dark); padding: 11px 14px;
}
.dash-side .card-body { padding: 12px; }
.dash-side .btn { font-size: 12.5px; padding: 7px 12px; border-radius: 8px; text-align: left; }
.dash-side .btn i { margin-right: 6px; }

/* ★ 老板 10-01：「交期最紧的订单」每行下面多一行 **BOM 名字**，点它直接打开那张 BOM。
   两行一块（上行：指令单号+货号+剩余天数；下行：BOM）—— 悬停时整块变手型 + 浅底。 */
.dash-due-item { border-radius: 6px; transition: background .12s; }
.dash-due-item.is-link { cursor: pointer; }
.dash-due-item.is-link:hover { background: rgba(28, 95, 214, .07); }
.dash-due-bom {
    font-size: 11px; color: var(--text-light); padding: 0 5px 4px; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center; gap: 5px;
}
.dash-due-bom .dash-due-bomname { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* ★ 第171轮（老板 10-01）：「快到期的订单**并不是直接跳转到 BOM，而是跳转到订单工作台**」——
   BOM 名字那一行现在**跟随整行**跳订单工作台（不再单独跳 BOM）；
   要**只看这张 BOM** 时点行尾这个小图标（目标小、不会误点）。 */
.dash-due-bomgo {
    flex: none; border: 1px solid #cbd5e1; background: #fff; color: #7c8798;
    border-radius: 4px; padding: 0 4px; font-size: 10.5px; line-height: 15px; cursor: pointer;
}
.dash-due-bomgo:hover { border-color: #1c5fd6; color: #1c5fd6; background: #f3f7ff; }
.dash-due-item.is-link:hover .dash-due-bom { color: #1c5fd6; }

/* 设置弹窗：卡片开关（按板块分组，每块带一个「整块显示」开关） */
.dash-toggles-group + .dash-toggles-group { margin-top: 12px; }
.dash-sec-toggle {
    margin-bottom: 6px; padding-bottom: 4px;
    border-bottom: 1px dashed var(--border-color);
}
.dash-sec-label { font-weight: 700; }
.dash-sec-label span { color: var(--text-dark); }
.dash-sec-label i { color: var(--text-gray); margin-right: 2px; }
.dash-toggles-group.sec-off .dash-toggles { opacity: .4; }
.dash-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.dash-toggle {
    display: flex; align-items: center; gap: 7px; margin: 0;
    font-size: 12.5px; color: var(--text-gray); cursor: pointer;
}
.dash-toggle input { margin: 0; flex-shrink: 0; }

.dash-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-hint { font-size: 12px; color: var(--text-light); }
.dash-loading { text-align: center; color: var(--text-light); padding: 56px 0; font-size: 14px; }

@media print {
    .dash-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* 车间生产数据板块里的工具栏 */
.dash-pivot-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

/* ==========================================================================
   ========== 移动端适配层（第74轮 2026-09-24 老板：手机端查库存 / 看订单进度）==========
   设计原则（**桌面体验一律不变**，全部收在 ≤900px 的媒体查询里）：
     1) 侧边栏改「抽屉式」：滑出 + 半透明遮罩，点遮罩 / 点菜单项自动收起。
        ★ 顺带修一个死路 BUG：原来窄屏只是把 .sidebar 宽度压成 0，
          而浮动展开按钮只在 .collapsed 时才显示 → **手机上根本进不去菜单**。
     2) 触控目标 ≥44px；输入框字号 ≥16px（<16px 时 iOS 聚焦会强制放大页面）。
     3) 表格默认横向滚动；标了 .m-card 的表在窄屏变成「一条记录一张卡」。
     4) 栅格 / 表单强制单列、弹窗贴边、内边距收窄。
   ========================================================================== */

/* ---- 抽屉遮罩（桌面端不占位、不可见） ---- */
.sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1039;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}
body.drawer-open .sidebar-mask { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }

@media (max-width: 900px) {

    /* ---------- 1. 抽屉式侧边栏 ---------- */
    .sidebar {
        position: fixed !important;
        top: 0; left: 0; bottom: 0;
        width: 268px !important;
        max-width: 84vw;
        z-index: 1040;
        transform: translateX(-102%);
        transition: transform .24s ease;
        box-shadow: 0 0 30px rgba(0, 0, 0, .38);
    }
    .sidebar.collapsed { width: 268px !important; }      /* 抽屉模式下忽略桌面折叠态 */

    /* ★ 第155轮（老板 09-30）：**窄屏抽屉不用浮动卡片** —— 手机上没有"悬停"，
       这里恢复「点击展开/收起」的内联子菜单（`.collapsed` 在窄屏重新生效）。 */
    .sidebar { overflow-y: auto; }
    .menu-group > .menu-group-items {
        position: static;
        margin-left: 0;
        min-width: 0;
        max-height: none;
        overflow: visible;
        background: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        display: block;
        animation: none;
    }
    .menu-group > .menu-group-items::before { display: none; }
    .menu-group.collapsed > .menu-group-items { display: none; }
    .menu-group-arrow { transform: none; }
    .menu-group.collapsed .menu-group-arrow { transform: rotate(-90deg); }
    .menu-group > .menu-group-items .menu-item {
        color: rgba(255,255,255,.75);
        border-left: 3px solid transparent;
        border-radius: 0;
        padding: 12px 16px;
        font-size: 15px;
    }
    .menu-group > .menu-group-items .menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
    .menu-group > .menu-group-items .menu-item i { color: inherit; }
    body.drawer-open .sidebar { transform: translateX(0); }

    /* 汉堡按钮：窄屏**恒显示**（原本只在 collapsed 时显示 → 手机上进不去菜单） */
    .btn-restore-sidebar {
        display: flex !important;
        top: 10px;
        left: 10px;
        width: 44px;
        height: 44px;
        font-size: 20px;
        border-radius: 10px;
        z-index: 1038;
    }

    /* 抽屉里的菜单项加大到可点尺寸 */
    .sidebar-nav .menu-item { padding: 12px 16px; font-size: 15px; }
    .menu-group-title { font-size: 13px; padding: 10px 16px 6px; }
    .btn-toggle-sidebar { width: 44px; height: 44px; font-size: 20px; }

    /* ---------- 2. 布局与内容区 ---------- */
    .content-area {
        margin-left: 0 !important;
        padding: 62px 10px 28px;        /* 顶部 62px 给固定的汉堡按钮让位 */
    }
    .page-header { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
    /* ★ 中文标题在窄容器里会被**逐字换行**（"订单看板"竖成一列）→ 强制整体不换行 */
    .page-title {
        font-size: 17px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 8px;
    }
    .page-title > * { white-space: nowrap; }
    .page-title .fs-6 { font-size: 12px !important; }

    .card-body { padding: .6rem; }
    .card-header {
        flex-wrap: wrap;
        gap: 6px !important;            /* 覆盖各页写的 gap-2 */
        padding: .55rem .6rem;
        font-size: 13px;
    }
    /* card-header 里的筛选控件：卡片内联宽度改成自适应，不再挤成一条 */
    .card-header .form-select,
    .card-header .form-control {
        width: auto !important;
        min-width: 118px;
        flex: 1 1 128px;
        max-width: 100%;
    }
    .card-header .form-check { flex: 0 0 auto; }
    .card-header .ms-auto { margin-left: 0 !important; }
    .card-header .btn { flex: 0 0 auto; }

    /* 搜索条：竖排铺满 */
    .search-bar { flex-wrap: wrap; gap: 6px; }
    .search-bar > * { flex: 1 1 100%; max-width: 100% !important; }

    /* ---------- 3. 触控目标与表单 ---------- */
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; padding: .34rem .6rem; font-size: 13px; }
    .form-control, .form-select { min-height: 44px; font-size: 16px; }
    .form-control-sm, .form-select-sm { min-height: 38px; font-size: 16px; }
    .form-label { font-size: 13px; }
    /* 表单里的说明小字别被压成 10px */
    .small, small { font-size: 12px; }

    .nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
    .nav-tabs .nav-link { white-space: nowrap; padding: .58rem .78rem; font-size: 14px; }
    .nav-tabs::-webkit-scrollbar { height: 0; }

    /* ---------- 4. 栅格强制单列（原 col-md-6 / col-lg-3 … 在手机上堆成一条） ---------- */
    .row > [class*="col-md-"], .row > [class*="col-lg-"],
    .row > [class*="col-xl-"], .row > [class*="col-sm-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* ---------- 5. 弹窗贴边铺满（Bootstrap 默认 margin 太宽，手机上两侧留白多） ---------- */
    .modal-dialog { margin: .5rem; max-width: calc(100vw - 1rem); }
    .modal-body { max-height: calc(100vh - 190px); overflow-y: auto; }
    .modal-footer { flex-wrap: wrap; gap: 6px; }
    .modal-footer .btn { flex: 1 1 44%; }

    /* ---------- 6. 表格：横向滚动 + 触摸惯性 ---------- */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table-responsive table {
        font-size: 13px;
        margin-bottom: 0;
    }
    .table-responsive table th,
    .table-responsive table td { padding: .4rem .45rem; white-space: nowrap; }
    /* 数据密集页的「最小宽度」交给内容撑开，避免列被压成竖排单字 */

    /* ---------- 7. 仪表盘：卡片单列 + 右栏置底 ---------- */
    .dash-grid { grid-template-columns: 1fr; gap: 9px; }
    .dash-section { padding: 10px 8px 8px; }
    .dash-section-head { margin-bottom: 8px; }
    .dash-value { font-size: 21px; }
    .dash-inline { flex-wrap: wrap; gap: 6px 14px; }
    .dash-actions { grid-template-columns: 1fr 1fr; }

    /* ---------- 8. 分页条换行 ---------- */
    .erp-pager { flex-wrap: wrap; row-gap: 6px; }
}

/* ==========================================================================
   表格「卡片化」：给表格加 class="m-card"，窄屏下一条记录变成一张卡
   （字段名由 app.js::erpMarkTableCards 从 thead 写进 td[data-label]）
   桌面端完全不受影响 —— 仍是普通表格。
   ========================================================================== */
@media (max-width: 900px) {
    table.m-card {
        border: 0 !important;
        font-size: 13.5px !important;
    }
    table.m-card > thead { display: none !important; }

    table.m-card > tbody > tr {
        display: block;
        background: var(--card-bg, #fff);
        border: 1px solid var(--border-color, #e5e7eb);
        border-left: 3px solid var(--erp-accent, #3b82f6);
        border-radius: 10px;
        padding: 8px 10px 6px;
        margin-bottom: 9px;
        box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
    }
    table.m-card > tbody > tr > td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        border: 0 !important;
        padding: 3px 0 !important;
        white-space: normal !important;
        word-break: break-word;
        min-height: 0;
        text-align: right;
    }
    /* 字段名（来自表头） */
    table.m-card > tbody > tr > td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 44%;
        color: var(--text-light, #94a3b8);
        font-size: 12px;
        font-weight: 500;
        line-height: 1.6;
        text-align: left;
    }
    /* 没有 label 的单元格（操作列、空提示行）整行显示 */
    table.m-card > tbody > tr > td:not([data-label]) { justify-content: flex-end; }
    /* 空值字段不占行（否则卡片里全是「尺码 ——」这种空条） */
    table.m-card > tbody > tr > td.m-blank { display: none; }
    /* 操作按钮组：铺开、按钮变大好点 */
    table.m-card > tbody > tr > td .action-btns,
    table.m-card > tbody > tr > td .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
        width: 100%;
    }
    table.m-card > tbody > tr > td .btn { min-height: 36px; }
    /* 空态提示行（colspan 的大格子）不该被当成一条记录 */
    table.m-card > tbody > tr.m-empty {
        display: block;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 18px 0;
    }
    table.m-card > tbody > tr.m-empty > td {
        display: block;
        text-align: center !important;
        color: var(--text-light, #94a3b8);
    }
    table.m-card > tbody > tr.m-empty > td::before { content: none; }
}

/* ============================================================================
   ★★ 第88轮（老板 09-25）：把「规格管理（图册）」的样式**提到全局** ——
      原来只写在 `static/pages/material.html` 的 <style> 里，
      而 BOM 页的「新增辅料」弹窗也要用同一套图册（老板要求"要有材料管理内一样的区域"）。
      BOM 页不加载 material.html 的内联样式 → 必须放全局。
   类名带 `.cp-` 前缀、不与其他模块冲突；material.html 里的同名定义保留（行为不变）。
   ========================================================================= */
.color-pool { border:1px dashed #ced4da; border-radius:10px; padding:14px; background:#fafbfc; }
.color-pool-empty { color:#888; font-size:13px; text-align:center; padding:18px 0; }
.color-hint { font-size:12px; color:#6c757d; margin-top:8px; }
.cp-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(122px,1fr)); gap:8px; }
.cp-card { position:relative; border:1px solid #eef0f3; border-radius:8px; background:#fff; padding:7px; display:flex; flex-direction:column; gap:5px; }
.cp-card.cp-card-active { border-color:#0d6efd; box-shadow:0 0 0 2px rgba(13,110,253,.12); }
.cp-card-head { display:flex; align-items:center; justify-content:space-between; }
.cp-card-head .form-check { font-size:11px; }
.cp-card-head .form-check-input { width:14px; height:14px; margin-top:2px; }
.cp-seq { font-size:11px; color:#868e96; font-weight:600; }
.cp-thumb { width:100%; height:64px; border:1px dashed #adb5bd; border-radius:6px; display:flex; align-items:center; justify-content:center; cursor:pointer; overflow:hidden; background:#f8f9fa; color:#adb5bd; font-size:11px; text-align:center; position:relative; }
.cp-thumb img { width:100%; height:100%; object-fit:cover; }
.cp-thumb.active { border-color:#0d6efd; box-shadow:0 0 0 3px rgba(13,110,253,.15); }
.cp-thumb .thumb-del { position:absolute; top:3px; right:3px; width:18px; height:18px; border-radius:50%; background:#dc3545; color:#fff; font-size:12px; line-height:18px; padding:0; border:none; }
.cp-name { width:100%; }
.cp-fields { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.cp-field { display:flex; flex-direction:column; gap:2px; }
.cp-field label { font-size:11px; color:#868e96; margin:0; }
/* ★ 第188轮（老板 10-03）：「取消辅料编辑的这个微调按钮」——
   规格卡片（单价 / 用料 / 特价 …）的数值框不再显示浏览器原生的微调(spinner)与清除控件，
   避免误点清空。数值输入与校验不受影响。 */
.cp-field input[type="number"]::-webkit-outer-spin-button,
.cp-field input[type="number"]::-webkit-inner-spin-button,
.cp-name::-webkit-outer-spin-button,
.cp-name::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.cp-field input[type="number"]::-webkit-search-cancel-button,
.cp-field input[type="number"]::-webkit-clear-button { -webkit-appearance:none; display:none; }
.cp-field input[type="number"] { -moz-appearance:textfield; appearance:textfield; }
.cp-foot { display:flex; align-items:center; justify-content:space-between; }
.cp-add { border:1px dashed #adb5bd; border-radius:8px; background:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#adb5bd; cursor:pointer; min-height:126px; font-size:20px; }
.cp-add:hover { border-color:#0d6efd; color:#0d6efd; }
/* 弹窗里图册被压缩得矮一些（辅料表单字段多） */
.acc-spec-gallery .cp-thumb { height:56px; }
.acc-spec-gallery .cp-grid { grid-template-columns:repeat(auto-fill,minmax(116px,1fr)); }

/* ★★ 第191轮（老板 10-03）：「取消所有区域的微调按钮」——
   全站数字输入框（`input[type=number]`）不再显示浏览器原生的上下微调箭头（spinner）。
   数值输入 / 校验 / 计算全部不受影响（只是把那个容易误点的箭头隐藏）。 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
