/* ============ 刀具工厂ERP base.css —— 布局与皮肤（参照参考站 #0D1B2A/#10B981/#F0F2F5） ============ */
:root {
  --side-w: 230px;
  --top-h: 48px;
  --c-side: #0D1B2A;
  --c-side-hover: rgba(255,255,255,.06);
  --c-side-active: rgba(16,185,129,.15);
  --c-side-text: #A7B6C2;
  --c-primary: #10B981;
  --c-primary-dark: #059669;
  --c-primary-light: #ECFDF5;
  --c-blue: #3B82F6;
  --c-orange: #F59E0B;
  --c-red: #EF4444;
  --c-bg: #F0F2F5;
  --c-card: #FFFFFF;
  --c-text: #333333;
  --c-text2: #909399;
  --c-border: #E4E7ED;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--c-text); background: var(--c-bg);
}
.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
.login-wrap { display: flex; min-height: 100vh; }
.login-left {
  flex: 1.2; position: relative; color: #fff;
  background:
    linear-gradient(100deg, rgba(6,14,26,.86) 0%, rgba(6,14,26,.58) 46%, rgba(6,14,26,.22) 100%),
    url("../img/login-bg.jpg") center right / cover no-repeat;
  display: flex; flex-direction: column; justify-content: center; padding: 80px 72px;
}
.login-brand { display: flex; align-items: center; gap: 18px; }
.login-logo {
  width: 64px; height: 64px; border-radius: 14px; background: var(--c-primary);
  display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: bold;
}
.login-brand h1 { font-size: 30px; letter-spacing: 2px; }
.login-brand p { color: #9DB4C4; margin-top: 6px; }
.login-features { margin-top: 48px; list-style: none; }
.login-features li { color: #C3D2DD; line-height: 2.4; font-size: 15px; }
.login-features li::before { content: "✔"; color: var(--c-primary); margin-right: 10px; }
.login-right { width: 420px; background: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px 56px; }
.login-right h2 { font-size: 22px; margin-bottom: 28px; color: var(--c-text); }
.login-form label { display: block; color: var(--c-text2); font-size: 13px; margin: 16px 0 6px; }
.login-form input, .login-form select {
  width: 100%; height: 40px; border: 1px solid var(--c-border); border-radius: 4px;
  padding: 0 12px; font-size: 14px; outline: none; background: #fff;
}
.login-form input:focus, .login-form select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(16,185,129,.12); }
.select-wrap { position: relative; }
.login-form button { margin-top: 28px; height: 42px; font-size: 15px; }
.login-tip { margin-top: 16px; color: var(--c-text2); font-size: 12px; text-align: center; }

/* ---------- 主框架 ---------- */
.app-frame { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--side-w); background: var(--c-side); color: var(--c-side-text);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-icon {
  width: 38px; height: 38px; border-radius: 9px; background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 19px; flex-shrink: 0;
}
.logo-name { color: #fff; font-size: 15px; font-weight: 600; }
.logo-sub { font-size: 12px; color: #7A8EA0; margin-top: 2px; }
.side-menu { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.menu-group { margin-top: 6px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 0 16px 0 14px; height: 44px;
  cursor: pointer; color: var(--c-side-text); border-left: 3px solid transparent; user-select: none;
  position: relative; transition: background .15s, color .15s;
}
.menu-item:hover { background: var(--c-side-hover); color: #E5EDF3; }
.menu-item.active { background: var(--c-side-active); color: #fff; border-left-color: var(--c-primary); font-weight: 600; }
.menu-item .m-ico { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.menu-item .m-arrow { margin-left: auto; font-size: 10px; transition: transform .15s; }
.menu-item.open .m-arrow { transform: rotate(90deg); }
.menu-sub { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.menu-group.open .menu-sub { max-height: 600px; }
.sub-item {
  padding: 0 16px 0 48px; height: 36px; line-height: 36px; cursor: pointer; color: #8FA3B3;
  font-size: 13px; border-left: 3px solid transparent; user-select: none;
}
.sub-item:hover { color: #fff; background: var(--c-side-hover); }
.sub-item.active { color: #fff; background: var(--c-side-active); border-left-color: var(--c-primary); }
.menu-badge {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: var(--c-red); color: #fff; border-radius: 9px; min-width: 18px; height: 18px;
  font-size: 11px; line-height: 18px; text-align: center; padding: 0 5px; font-weight: normal;
}
.sidebar-footer { padding: 12px 16px; font-size: 11px; color: #5A6E80; border-top: 1px solid rgba(255,255,255,.08); }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--top-h); background: #fff; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0;
}
.breadcrumb { color: var(--c-text2); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.breadcrumb a { color: var(--c-text2); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb .cur { color: var(--c-text); }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.bell-wrap { position: relative; cursor: pointer; color: #606266; display: flex; align-items: center; }
.bell-wrap:hover { color: var(--c-primary); }
.bell-badge {
  position: absolute; top: -7px; right: -9px; background: var(--c-red); color: #fff;
  border-radius: 9px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; text-align: center; padding: 0 4px;
}
.topbar-company { color: var(--c-text2); }
.topbar-sep { width: 1px; height: 14px; background: var(--c-border); }
.topbar-user { color: var(--c-text); font-weight: 600; }
.topbar-logout { color: var(--c-text2); cursor: pointer; }
.topbar-logout:hover { color: var(--c-red); }

.page-container { flex: 1; overflow: auto; padding: 16px 20px 24px; min-width: 0; }

/* ---------- 卡片与页面通用 ---------- */
.card { background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; max-width: 100%; min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-title::before { content: ""; width: 4px; height: 16px; background: var(--c-primary); border-radius: 2px; margin-right: 8px; }
.card-title-text { flex: 1; display: flex; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar input[type="text"], .toolbar select {
  height: 32px; border: 1px solid var(--c-border); border-radius: 4px; padding: 0 10px; font-size: 13px; outline: none; background: #fff;
}
.toolbar input[type="text"] { min-width: 240px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--c-primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.text-gray { color: var(--c-text2); } .text-red { color: var(--c-red); } .text-green { color: var(--c-primary); }
.fsz12 { font-size: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--c-border);
  background: #fff; color: #606266; font-size: 13px; cursor: pointer; white-space: nowrap; user-select: none;
}
.btn:hover { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-light); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-blue { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }
.btn-blue:hover { background: #2563EB; border-color: #2563EB; color: #fff; }
.btn-orange { background: var(--c-orange); border-color: var(--c-orange); color: #fff; }
.btn-orange:hover { background: #D97706; border-color: #D97706; color: #fff; }
.btn-red { background: #fff; border-color: var(--c-red); color: var(--c-red); }
.btn-red:hover { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 3px; }
.btn[disabled], .btn.is-readonly { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
.link-btn { color: var(--c-blue); cursor: pointer; font-size: 13px; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.ops { display: flex; flex-wrap: nowrap; align-items: center; gap: 0 10px; white-space: nowrap; }
.ops .link-btn + .link-btn { margin-left: 0; }
.link-danger { color: var(--c-red); }
.link-success { color: var(--c-primary-dark); }
.link-warning { color: var(--c-orange); }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; max-width: 100%; max-height: calc(100vh - 220px); }
table.data-table { width: max-content; min-width: 100%; height: auto; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-weight: 600; color: var(--c-text2); font-size: 12px; cursor: pointer; user-select: none;
  padding: 6px 8px; border-bottom: 1px solid var(--c-border); background: #fff; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.data-table td { padding: 4px 8px; border-bottom: 1px solid #F2F4F7; vertical-align: middle; white-space: nowrap; line-height: 1.3; height: auto; }
.data-table th.col-sticky, .data-table td.col-sticky {
  position: sticky; right: 0; z-index: 3; background: #fff; box-shadow: -8px 0 8px rgba(15, 23, 42, .06);
}
.data-table th.col-sticky { z-index: 4; top: 0; }
.data-table tbody tr:nth-child(even) { background: #FAFAFA; }
.data-table tbody tr:hover { background: #F0FDF4; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .empty-row td { text-align: center; color: var(--c-text2); padding: 36px 0; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.tag-blue { background: #DBEAFE; color: #1D4ED8; }
.tag-green { background: #D1FAE5; color: #047857; }
.tag-orange { background: #FEF3C7; color: #B45309; }
.tag-red { background: #FEE2E2; color: #B91C1C; }
.tag-gray { background: #E5E7EB; color: #4B5563; }
.tag-purple { background: #EDE9FE; color: #6D28D9; }

/* ---------- 统计卡 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 21px; color: #fff; flex-shrink: 0; }
.stat-val { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--c-text2); font-size: 12px; margin-top: 4px; }

/* ---------- 流程条（工作台闭环） ---------- */
.flow-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flow-node {
  padding: 6px 14px; border-radius: 16px; background: #F3F4F6; color: #6B7280; font-size: 13px; cursor: pointer;
}
.flow-node.done { background: #D1FAE5; color: #047857; }
.flow-node:hover { box-shadow: 0 0 0 2px rgba(16,185,129,.35); }
.flow-arrow { color: var(--c-text2); font-size: 14px; }
.flow-enter { margin-top: 10px; text-align: right; }

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .topbar, .toolbar, .no-print { display: none !important; }
  .page-container { padding: 0; overflow: visible; }
  body { background: #fff; }
}

.live-refresh{border:1px solid #abcbca;border-radius:5px;background:#f0faf8;color:#135c53;font:inherit;font-size:12px;padding:3px 8px;white-space:nowrap;cursor:pointer}.live-refresh[data-status="wait"],.live-refresh[data-status="error"]{background:#fff5df;color:#714100;border-color:#dab56d}.live-refresh:focus-visible{outline:2px solid #176d9a;outline-offset:2px}@media(max-width:660px){.topbar-company,.topbar-sep{display:none}.live-refresh{padding:3px 4px}}
