/* fairliar 库存管理系统 —— 前端样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --line: #e5e8ef;
  --text: #1d2333;
  --muted: #707a8f;
  --primary: #4f63f7;
  --primary-dark: #3a4cd1;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --sidebar: #161c2c;
  --hero-from: #4f63f7;
  --hero-to: #7d5bff;
  --radius: 12px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  display: flex; overflow: hidden;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 220px; min-width: 220px; height: 100vh; background: var(--sidebar);
  color: #cfd6e4; display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 10px 10px 18px; }
.brand .brand-logo { width: 164px; aspect-ratio: 10 / 3; object-fit: cover; filter: invert(1); opacity: .95; }
.brand .brand-sub { color: #7f88a0; font-size: 10.5px; letter-spacing: .35em; width: 164px; text-align: center; text-indent: .35em; }
.brand:not(.no-img) .logo, .brand:not(.no-img) h1 { display: none; }
.brand.no-img { flex-direction: row; align-items: center; gap: 10px; }
.brand.no-img .brand-logo, .brand.no-img .brand-sub { display: none; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  color: #fff; font-weight: 800; font-style: italic; font-family: Georgia, serif;
}
.brand h1 { font-size: 17px; color: #fff; letter-spacing: 1px; }
.brand small { display: block; font-size: 11px; color: #8b94a9; font-weight: normal; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  color: #aeb7c9; text-decoration: none; border-radius: 9px; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav .icon { font-size: 17px; width: 22px; text-align: center; }
.sidebar .foot { font-size: 11px; color: #5d6679; padding: 12px 10px 0; line-height: 1.7; border-top: 1px solid rgba(255,255,255,.07); }

/* ---------- 主区域 ---------- */
.main { flex: 1; height: 100vh; overflow-y: auto; padding: 24px 28px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-head h2 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--text); padding: 8px 14px; border-radius: 9px;
  font-size: 13.5px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, .select, textarea.input {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 14px;
  background: #fff; color: var(--text); outline: none; font-family: inherit;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.field > .input, label.field > .select { width: 100%; margin-top: auto; } /* 网格中标签换行时输入框仍底边对齐 */
.form-grid input.input, .form-grid .select, label.field > .select { height: 38px; } /* select 与 input 等高，彻底对齐 */

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8f9fc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.badge.blue { background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--primary); }
.badge.green { background: #e8f7ee; color: var(--green); }
.badge.amber { background: #fdf3e3; color: var(--amber); }
.badge.red { background: #fdeaea; color: var(--red); }
.badge.gray { background: #eef0f4; color: var(--muted); }

.thumb { width: 42px; height: 52px; border-radius: 7px; object-fit: cover; background: #eef0f4; border: 1px solid var(--line); display: block; }
.thumb.lg { width: 64px; height: 80px; }
.thumb.placeholder { display: flex; align-items: center; justify-content: center; color: #b9c0cf; font-size: 18px; }
.sku-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.sku-cell .t1 { font-weight: 600; }
.sku-cell .t2 { color: var(--muted); font-size: 12px; margin-top: 2px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }

/* ---------- 工作台 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat.warn .v { color: var(--red); }
.stat .sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); border-color: transparent; box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 28%, transparent); }
.stat.hero .k, .stat.hero .sub { color: rgba(255,255,255,.85); }
.stat.hero .v { color: #fff; }

/* ---------- 仪表盘两栏 ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-row .name { width: 130px; flex: none; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar { flex: 1; height: 10px; background: #eef0f5; border-radius: 6px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--hero-from), var(--hero-to)); border-radius: 6px; }
.bar-row .qty { width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.perf-val { width: 150px; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.25; }
.perf-val small { display: block; color: var(--muted); font-size: 11px; }

/* ---------- 扫码作业 ---------- */
.scan-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .scan-layout { grid-template-columns: 1fr; } }
.scan-input-wrap { position: relative; margin: 4px 0 14px; }
.scan-input {
  width: 100%; font-size: 19px; padding: 15px 18px 15px 52px; border: 2px solid var(--primary);
  border-radius: 12px; outline: none; font-family: ui-monospace, Menlo, monospace; background: #fbfcff;
}
.scan-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.scan-input-wrap .scan-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; }
.tabs { display: inline-flex; background: #eef0f5; border-radius: 10px; padding: 3px; gap: 2px; }
.tabs button { border: none; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.tabs button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(20,30,60,.1); }
.scan-card-main { text-align: center; }
.scan-card-main img { width: 200px; height: 250px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.scan-card-main .big-name { font-size: 17px; font-weight: 700; margin-top: 12px; }
.scan-card-main .attrs { margin-top: 6px; color: var(--muted); }
.scan-card-main .attrs b { color: var(--text); font-size: 15px; }
.stock-mini { margin-top: 12px; text-align: left; }
.stock-mini .li { display: flex; justify-content: space-between; padding: 5px 2px; border-bottom: 1px dashed #edf0f5; font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.8; background: #f7f8fb; border-radius: 9px; padding: 10px 14px; }
.qty-input { width: 64px; text-align: center; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; }
.cart-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.sale-panel { background: #f7f8fb; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 12px; }
.qty-step { display: inline-flex; align-items: center; gap: 4px; }
.qty-step button { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 16px; cursor: pointer; line-height: 1; }
.qty-step button:hover { border-color: var(--primary); color: var(--primary); }
.del-btn { padding: 6px 12px; font-size: 14px; }
.cart-foot { position: sticky; bottom: -1px; background: var(--card); padding: 12px 0 4px; border-top: 1px solid var(--line); z-index: 5; }
.btn-big { padding: 12px 22px; font-size: 15px; border-radius: 10px; }
.key-hint { opacity: .65; font-size: 11px; font-weight: normal; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.amt-big { white-space: nowrap; }
.amt-big b { font-size: 34px; color: var(--red); font-variant-numeric: tabular-nums; }
.holds { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.hold-chip { background: #fff7e8; border: 1px solid #f5d9a8; border-radius: 9px; padding: 6px 10px; font-size: 12.5px; display: inline-flex; gap: 8px; align-items: center; }
.hold-chip small { color: var(--muted); }
.hold-chip button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px; }
.hold-chip button:hover { border-color: var(--primary); color: var(--primary); }
.done-card { text-align: center; padding: 12px 0; color: var(--muted); font-size: 14px; }
.done-code { font-family: ui-monospace, Menlo, monospace; font-size: 20px; color: var(--text); margin-top: 10px; }
.done-amt { font-size: 42px; font-weight: 800; color: var(--red); margin: 6px 0; font-variant-numeric: tabular-nums; }
.done-tip { margin-top: 10px; line-height: 1.9; font-size: 13px; }

/* ---------- 工资表：列色 + 对齐 ---------- */
.pay-tbl col.cg-basis { background: #eef4ff; }
.pay-tbl col.cg-comm { background: #e2ecff; }
.pay-tbl col.cg-base { background: #f3f4f7; }
.pay-tbl col.cg-ot { background: #f3eefd; }
.pay-tbl col.cg-perf { background: #e9f7ef; }
.pay-tbl col.cg-bonus { background: #f0faf0; }
.pay-tbl col.cg-fine { background: #fdecec; }
.pay-tbl col.cg-social { background: #fdf1ec; }
.pay-tbl col.cg-total { background: #e9ecff; }
.pay-tbl th, .pay-tbl td { padding-left: 8px; padding-right: 8px; text-align: center; }
.pay-tbl td.num, .pay-tbl th.num { text-align: center; }
.pay-input {
  width: 86px; text-align: center; background: rgba(255,255,255,.75);
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px;
  font-size: 13.5px; font-variant-numeric: tabular-nums; display: inline-block;
}
.pay-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); outline: none; }
.sale-panel .sale-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.sale-panel .sale-row > label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.sale-amount { margin-top: 10px; display: flex; gap: 14px; align-items: baseline; font-size: 14px; }
.sale-amount b { font-size: 22px; color: var(--red); }
.cart-foot .total { font-size: 15px; }
.cart-foot .total b { font-size: 20px; color: var(--primary); }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sim-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; cursor: pointer; background: #fff; text-align: left; }
.sim-item:hover { border-color: var(--primary); }
.sim-item img { width: 30px; height: 38px; border-radius: 5px; object-fit: cover; }
.sim-item .n { font-size: 12px; line-height: 1.4; }
.sim-item .n small { color: var(--muted); display: block; }

/* ---------- 商品分类侧栏 ---------- */
.prod-layout { display: flex; gap: 16px; align-items: flex-start; }
.cat-side {
  width: 172px; flex: none; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; max-height: calc(100vh - 140px); overflow-y: auto;
}
.cat-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 12px; border: none; border-radius: 8px; background: none;
  font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left;
}
.cat-item:hover { background: #f1f3f9; }
.cat-item.active { background: var(--primary); color: #fff; }
.cat-item .cnt { font-size: 12px; color: var(--muted); }
.cat-item.active .cnt { color: rgba(255,255,255,.85); }
@media (max-width: 900px) { .prod-layout { flex-direction: column; } .cat-side { width: 100%; flex-direction: row; flex-wrap: wrap; position: static; } }

/* ---------- 缩略图悬停放大 ---------- */
#imgPreview {
  position: fixed; display: none; z-index: 500; pointer-events: none;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 18px 50px rgba(15,25,60,.28);
}
#imgPreview img { width: 316px; height: 410px; object-fit: contain; display: block; border-radius: 10px; background: #f7f8fb; }

/* ---------- 扫码开单：模式色 + 加大字号 ---------- */
#scanTabs button { font-size: 15px; padding: 10px 22px; }
#scanTabs .icon, #scanTabs button { line-height: 1.2; }
#scanCard .scan-input { font-size: 21px; padding: 17px 18px 17px 58px; }
#scanCard .scan-input-wrap .scan-ico { font-size: 24px; }
#scanCard .tbl { font-size: 14px; }
#scanCard .qty-input { font-size: 15px; font-weight: 600; }
/* 出库 = 绿色（主营开单动作） */
.mode-out #scanTabs button.active { background: var(--green); color: #fff; }
.mode-out .scan-input { border-color: var(--green); }
.mode-out .scan-input:focus { box-shadow: 0 0 0 4px rgba(22,163,74,.16); }
.mode-out #btnCommit { background: var(--green); border-color: var(--green); }
.mode-out #btnCommit:hover { background: #128a40; }
/* 入库 = 蓝紫（库存增加） */
.mode-in #scanTabs button.active { background: var(--primary); color: #fff; }
.mode-in .scan-input { border-color: var(--primary); }
.mode-in .scan-input:focus { box-shadow: 0 0 0 4px rgba(79,99,247,.16); }
.mode-in #btnCommit { background: var(--primary); border-color: var(--primary); }
.mode-in #btnCommit:hover { background: var(--primary-dark); }
/* 查询 = 中性灰（只看不动账） */
.mode-query #scanTabs button.active { background: #6e7687; color: #fff; }
.mode-query .scan-input { border-color: #aab2c2; background: #fafbfd; }
.mode-query .scan-input:focus { box-shadow: 0 0 0 4px rgba(110,118,135,.14); }

/* ---------- 商品 ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.prod-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all .15s; }
.prod-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(25,35,70,.1); border-color: color-mix(in srgb, var(--primary) 38%, #fff); }
.prod-card .img { width: 100%; height: 210px; object-fit: cover; background: #eef0f4; display: block; }
.prod-card.off-sale { opacity: .55; }
.prod-card.off-sale .img { filter: grayscale(.8); }
.prod-card .body { padding: 12px 14px; }
.prod-card .name { font-weight: 600; font-size: 14.5px; }
.prod-card .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; justify-content: space-between; }
.prod-card .price { color: var(--red); font-weight: 700; font-size: 15px; }
.color-group { margin-bottom: 22px; }
.color-group .cg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.color-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.upload-btn input[type=file] { display: none; }

/* ---------- 模态框 / 提示 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,20,35,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 22px 24px; width: 560px; max-width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(10,15,40,.25); }
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .form-grid .full { grid-column: 1 / -1; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1d2333; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(10,15,40,.3); animation: pop .18s ease; max-width: 80vw; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 登录 ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: stretch; background: #f7edf0;
}
.login-left { /* 封面占左侧黄金比例 */
  flex: 0 0 61.8%; position: relative; overflow: hidden;
  background: #e9d3d8 url('/brand/cover.jpg') center / cover no-repeat;
}
.login-left::after { /* 与右侧衔接的轻微收边 */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(43,26,35,0) 88%, rgba(43,26,35,.18) 100%);
}
.login-brandmark {
  position: absolute; top: 28px; left: 32px; z-index: 1;
  width: min(218px, 24vw); aspect-ratio: 10 / 3; object-fit: cover;
  filter: drop-shadow(0 1px 10px rgba(255,255,255,.55));
}
.login-right { /* 大牌画册式留白面板 */
  flex: 1 1 auto; position: relative; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fdf9fa 0%, #f6ebee 100%); padding: 48px 42px 76px;
}
.login-right::before { /* 内嵌细线画框 */
  content: ''; position: absolute; inset: 16px;
  border: 1px solid rgba(43,26,35,.13); pointer-events: none;
}
.login-tag { display: block; margin-top: 10px; font-size: 10px; letter-spacing: .42em; color: #b59aa4; }
.login-copy {
  position: absolute; bottom: 27px; left: 0; right: 0; text-align: center;
  font-size: 10px; letter-spacing: .4em; color: #b09aa3;
}
.login-card { /* 表单直接落在面板上，画册式留白 */
  position: relative; z-index: 1; width: 322px; max-width: 100%;
  transform: translateY(-2vh);
}
.login-card .input { background: #fff; border-color: #e8d9de; }
.login-card .btn.primary { background: #18151b; border-color: #18151b; }
.login-card .btn.primary:hover { background: #322a35; }
.login-card .input:focus { border-color: #c9a3b0; box-shadow: 0 0 0 3px rgba(201,163,176,.22); }
.login-card .login-foot { color: #97838c; }
.login-card .lc-brand small { color: #8a7580; }
.lc-brand { text-align: center; padding: 0 0 26px; }
.lc-brand img { width: 226px; aspect-ratio: 10 / 3; object-fit: cover; }
.lc-brand h1 { display: none; font-size: 26px; color: var(--text); }
.lc-brand small { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: .32em; margin-top: 0; }
.lc-brand.no-img img { display: none; }
.lc-brand.no-img h1 { display: block; }
@media (max-width: 900px) {
  .login-screen { flex-direction: column; }
  .login-left { flex: 0 0 30vh; }
  .login-brandmark { width: 158px; top: 18px; left: 20px; }
  .login-right { flex: 1 1 auto; padding: 30px 24px 58px; }
  .login-card { transform: none; }
}
.login-card .brand { padding: 0 0 18px; }
.login-card .brand h1 { color: var(--text); }
.login-card .brand small { color: var(--muted); }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 15px; margin-top: 4px; }
.login-err { color: var(--red); font-size: 13px; min-height: 20px; margin-bottom: 4px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; line-height: 1.7; }

/* ---------- 侧栏用户卡片 ---------- */
.userbox { border-top: 1px solid rgba(255,255,255,.07); margin-top: 8px; padding: 12px 10px 4px; font-size: 13px; }
.userbox .u-name { color: #fff; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.userbox .u-role { font-size: 11px; color: #8b94a9; margin-top: 3px; }
.userbox .u-ops { display: flex; gap: 6px; margin-top: 10px; }
.userbox .u-ops button {
  flex: 1; background: rgba(255,255,255,.07); border: none; color: #aeb7c9;
  border-radius: 7px; padding: 6px 0; font-size: 12px; cursor: pointer;
}
.userbox .u-ops button:hover { background: rgba(255,255,255,.14); color: #fff; }
.notif-bell { position: relative; background: none; border: none; cursor: pointer; font-size: 15px; margin-left: auto; padding: 2px 4px; }
.notif-badge {
  position: absolute; top: -6px; right: -8px; background: var(--red); color: #fff;
  font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 99px; min-width: 16px; text-align: center;
}
.notif-item {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border-radius: 9px; cursor: pointer; border-bottom: 1px solid #f0f2f6;
}
.notif-item:hover { background: #f4f6fb; }
.notif-item.unread { background: color-mix(in srgb, var(--primary) 9%, #fff); }
.notif-item.unread:hover { background: color-mix(in srgb, var(--primary) 15%, #fff); }

/* ---------- 改密提醒 ---------- */
.crm-li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.crm-li:hover { background: #f4f6fb; }
.crm-li + .crm-li { border-top: 1px dashed #eef0f5; }

.pw-banner {
  background: #fdeaea; color: var(--red); border: 1px solid #f5c2c2; border-radius: 10px;
  padding: 10px 16px; margin-bottom: 16px; font-size: 13.5px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.lowcell { background: #fdeaea !important; color: var(--red); font-weight: 700; }
.warncell { background: #fdf3e3 !important; color: var(--amber); font-weight: 600; }
.barcode-svg { display: block; }
.checkline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }

/* ---------- 主题选择器 ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 560px) { .theme-grid { grid-template-columns: repeat(2, 1fr); } }
.theme-card { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 9px; cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s; }
.theme-card:hover { border-color: var(--primary); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.theme-card .tc-prev { display: flex; align-items: center; gap: 5px; height: 44px; border-radius: 8px; padding: 0 8px; }
.theme-card .tc-prev i { flex: 1; height: 18px; border-radius: 5px; }
.theme-card .tc-prev em { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.theme-card .tc-name { display: block; font-size: 12.5px; margin-top: 8px; color: var(--text); }
.theme-card.active .tc-name { font-weight: 600; color: var(--primary); }

/* ---------- 工作台公告栏（醒目、可滚动播放，颜色按紧急度固定不随主题） ---------- */
.ann-bar {
  display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-radius: 12px;
  margin-bottom: 16px; font-size: 16px; font-weight: 600; color: #fff;
  box-shadow: 0 5px 18px rgba(0,0,0,.10); animation: annIn .3s ease;
}
.ann-bar .ann-ico { font-size: 21px; flex: none; line-height: 1; }
.ann-bar .ann-text { flex: 1; min-width: 0; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.ann-bar .ann-nav { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: normal; opacity: .9; white-space: nowrap; }
.ann-bar.ann-info   { background: linear-gradient(135deg, #2f80ed, #1e5fc4); }
.ann-bar.ann-warn   { background: linear-gradient(135deg, #f0932b, #db7a14); }
.ann-bar.ann-urgent { background: linear-gradient(135deg, #ec5b60, #c0392b); }
@keyframes annIn { from { opacity: .25; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ann-badge.info { background: #e6f0fd; color: #1e5fc4; }
.ann-badge.warn { background: #fdf0e0; color: #b96a10; }
.ann-badge.urgent { background: #fde7e8; color: #c0392b; }

/* ---------- 设置页二级目录（左侧分区菜单） ---------- */
.settings-layout { display: flex; gap: 18px; align-items: flex-start; }
.settings-nav {
  width: 180px; flex: none; position: sticky; top: 0;
  display: flex; flex-direction: column; gap: 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
}
.settings-body { flex: 1; min-width: 0; }
.set-nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: none; border-radius: 9px;
  font-size: 13.5px; color: var(--text); cursor: pointer; transition: background .15s, color .15s;
}
.set-nav-item:hover { background: #f1f3f9; }
.set-nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.set-nav-item .set-ic { font-size: 16px; width: 20px; text-align: center; flex: none; }
@media (max-width: 820px) {
  .settings-layout { flex-direction: column; }
  .settings-nav { width: 100%; flex-direction: row; flex-wrap: wrap; position: static; }
  .set-nav-item { width: auto; }
}
