/* ============================================================
 * 悦点进销存 Web 版 · 布局层（主框架：侧边栏 + 顶栏 + 内容区）
 * 登录页 / 启动画面样式在 css/pages/login.css
 * ============================================================ */
/* ================= 主框架 ================= */
.layout { display: flex; height: 100vh; overflow: hidden; }
/* 20261111w：侧边栏由白底改回有背景色 —— 主题蓝渐变 + 白色系文字（见 base.css --side-*） */
.sidebar { width: 220px; flex: none; background: var(--side-bg); color: var(--side-t1); display: flex; flex-direction: column; border-right: none; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid var(--side-line); }
/* 20261112c：按用户口径「发光的去掉，保持动就行」——
   透明 PNG 原样显示、不套方块背景，只保留 2px 浮动 + 轻微缩放呼吸；
   不加滤镜光晕 / 明暗闪烁。 */
.sb-logo { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex: none; animation: sbBob 3.4s ease-in-out infinite; }
.sb-logo img { width: 100%; height: 100%; object-fit: contain; display: block; transform: scale(1.28); }
@keyframes sbBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.06); }
}
.sb-name { font-size: 16px; font-weight: 600; letter-spacing: 2px; color: #fff; text-shadow: 0 1px 2px rgba(4, 32, 84, .3); }
.sb-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 2px; }
.nav-group { color: var(--side-t3); font-size: 11.5px; font-weight: 600; letter-spacing: 2px; padding: 14px 12px 8px; }
/* turn130e：导航项留白统一、选中态去厚重投影 */
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 2px 0; border-radius: var(--radius-sm); color: var(--side-t2); cursor: pointer; transition: background .15s, color .15s; font-size: 14px; font-weight: 500; user-select: none; }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: none; }
/* 选中项左侧亮青短竖条：蓝底上蓝色看不见，改用品牌青色点缀，与顶栏蓝线区分 */
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--side-bar); }
/* turn130k-75：二级菜单（带子项的父级 + 子项列表）
   20261111：登录后子菜单默认全折叠，箭头成了「还能展开」的唯一提示 —— 放大提亮、固定宽度避免折叠/展开时排版跳动
   20261111b：三级导航（业务管理 → 进货管理 → 采购订单）—— 箭头样式对二级同样生效 */
/* 20261112n：右三角放大提亮（14 → 19px），点击区域同步加大，hover 再放大一点 */
.nav-item .nav-caret, .nav-sub-item .nav-caret { margin-left: auto; font-style: normal; font-size: 19px; line-height: 20px; width: 20px; height: 20px; text-align: center; color: rgba(255, 255, 255, .72); flex: none; transition: transform .15s, color .15s; padding: 2px 4px; cursor: pointer; }
.nav-item .nav-caret:hover, .nav-sub-item .nav-caret:hover { color: #fff; transform: scale(1.18); }
.nav-item:hover .nav-caret, .nav-sub-item:hover .nav-caret { color: #fff; }
.nav-sub { padding: 2px 0 4px 26px; }
/* 三级缩进收窄（26 → 12），220px 侧边栏放得下「进货入库单」这种四字项 */
.nav-sub .nav-sub { padding-left: 12px; }
.nav-sub-item { display: flex; align-items: center; gap: 6px; padding: 8px 12px; margin: 1px 0; border-radius: var(--radius-sm); color: var(--side-sub); font-size: 13px; cursor: pointer; transition: background .15s, color .15s; user-select: none; }
.nav-sub-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sub-item:hover { background: var(--side-hover); color: #fff; }
.nav-sub-item.active { background: rgba(255, 255, 255, .15); color: #fff; font-weight: 500; position: relative; }
/* 20261111w：二级选中也加一条亮青竖条，与一级选中同一套语言 */
.nav-sub-item.active::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 2px; height: 14px; border-radius: 0 2px 2px 0; background: var(--side-bar); }
/* 分组父级（进货管理 / 销售管理 / 财务）比叶子略亮；落在末级时祖先用 trail 浅底提示路径 */
.nav-sub-item.nav-branch { color: var(--side-t2); font-size: 13.5px; font-weight: 500; }
.nav-sub-item.nav-branch.trail { color: #fff; background: var(--side-hover); }
.nav-sub-item[data-depth="2"] { font-size: 12.5px; padding-left: 10px; }
.sb-foot { padding: 14px; text-align: center; color: var(--side-t3); font-size: 11px; border-top: 1px solid var(--side-line); }
/* turn130k-52：备案号常驻侧边栏底部，可点击跳转工信部备案查询 */
.sb-icp { display: block; margin-top: 6px; color: var(--side-t3); font-size: 11px; text-decoration: none; transition: color .2s; }
.sb-icp:hover { color: #fff; text-decoration: underline; }
/* 2026-10-31：底部互链 → 订货商城，比备案号略亮一档，保证能被注意到 */
.sb-mall { color: rgba(255, 255, 255, .88); font-weight: 500; }
.sb-mall:hover { color: #fff; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; flex: none; background: var(--card); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; box-shadow: none; z-index: 5; }
.tb-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.tb-title { font-size: 17px; font-weight: 600; }
.tb-sub { color: var(--t3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; align-items: center; gap: 10px; flex: none; }
/* 20261111p：徽标改为「名称 + 去启用」两段式（flex），名称过长只压缩名称，按钮始终可见 */
.org-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 500; max-width: 300px; white-space: nowrap; }
.org-badge .ob-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.org-badge.on { background: rgba(0, 180, 42, .1); color: var(--ok); }
.org-badge.off { background: rgba(255, 125, 0, .12); color: var(--warn); }
.org-badge.off .ob-enable {
  flex: none; cursor: pointer; color: #fff; background: var(--warn);
  border-radius: 999px; padding: 1px 8px; font-size: 11.5px; line-height: 17px;
}
.org-badge.off .ob-enable:hover { filter: brightness(.93); }
.org-badge.off .ob-enable:focus-visible { outline: 2px solid var(--warn); outline-offset: 2px; }
.user-role { font-size: 12px; color: var(--brand); background: rgba(22, 119, 255, .08); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
/* 20261113s：问候与用户名贴在一起（不继承 .tb-right 的 10px gap），
   包一层 inline-flex 让「晚上好，用户18585823911」读起来是一句完整的话。 */
.user-greet-wrap { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; }
.user-greet { font-size: 13px; color: var(--t2); white-space: nowrap; }
.user-chip { font-size: 13px; color: var(--t2); white-space: nowrap; }
.content { flex: 1; overflow-y: auto; padding: 18px 24px 30px; }

/* ============================================================
 * 20261111x：顶部多标签栏（浏览器标签式导航）
 * - 左侧固定「首页」按钮回工作台；右侧为每个已打开页面一个可关闭 tab
 * - tab 太多时横向滚动，不挤压侧边栏 / 顶栏
 * - 非激活页面从 DOM 摘下（保留节点与事件），避免隐藏页面里的重复 id
 *   被 document.querySelector 命中，切回时原样挂回，表单状态不丢
 * ============================================================ */
.view-tabs {
  flex: none; display: flex; align-items: stretch; gap: 0;
  height: 38px; padding: 0 12px; background: var(--card);
  border-bottom: 1px solid var(--line-soft); overflow-x: auto; overflow-y: hidden;
  z-index: 4;
}
.view-tabs::-webkit-scrollbar { height: 3px; }
.view-tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.vt-home {
  flex: none; width: 46px; margin: 5px 8px 5px 0; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--t2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.vt-home:hover { color: var(--brand); border-color: var(--brand); background: rgba(22, 119, 255, .06); }
/* 20261111k：工作台固定为房子 tab，激活态与普通 tab 一致 */
/* 20261111o：激活 tab 底部显示蓝色线条表示选中（房子 tab 同口径） */
.vt-home.active { color: var(--brand); border-color: var(--line); background: #fff; font-weight: 600; box-shadow: inset 0 -2px 0 var(--brand); }
.vt-home svg { width: 16px; height: 16px; }
.vt-list { display: flex; align-items: stretch; flex: none; }
.vt-tab {
  position: relative; flex: none; display: flex; align-items: center; gap: 8px;
  min-width: 92px; max-width: 210px; padding: 0 10px 0 14px; cursor: pointer;
  margin: 5px 3px 0; border: 1px solid var(--line-soft); border-bottom: none;
  border-radius: 8px 8px 0 0; background: #f7f8fa; color: var(--t2);
  font-size: 12.5px; white-space: nowrap; user-select: none;
}
.vt-tab:hover { background: #eef2f7; color: var(--t1); }
.vt-tab.active { background: #fff; color: var(--brand); border-color: var(--line); font-weight: 600; box-shadow: 0 -2px 6px rgba(29, 33, 41, .04); }
/* 20261111o：激活 tab 底部的白条改为蓝色选中线（用户口径：tab 下面一条蓝色线条表示选中） */
.vt-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); }
.vt-label { overflow: hidden; text-overflow: ellipsis; }
.vt-x {
  flex: none; width: 16px; height: 16px; line-height: 14px; text-align: center;
  border-radius: 4px; color: var(--t3); font-size: 15px; font-weight: 400;
}
.vt-x:hover { background: rgba(245, 63, 63, .12); color: var(--danger); }
.view-pane { min-height: 100%; }
