/* =========================================================================
 * 无忧 —— 样式（商务风 · 液态玻璃侧栏 · 浅青蓝主色）
 * ========================================================================= */
:root {
  /* 主色：浅青蓝（与 Logo 轨道球同族） */
  --green: #0891b2;            /* 兼容旧变量名 = 主色 */
  --green-dark: #0e7490;
  --green-light: #cffafe;
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-deep: #155e75;
  --accent: #22d3ee;
  --bg: #eef2f6;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 42, 58, .06), 0 1px 2px rgba(15, 42, 58, .04);
  --shadow-lg: 0 12px 32px rgba(8, 74, 94, .12);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* 环境光斑：给液态玻璃提供可折射的背景层次 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 420px at 10% 6%, rgba(14, 165, 200, .12), transparent 62%),
    radial-gradient(720px 520px at 92% 96%, rgba(8, 74, 94, .10), transparent 60%),
    radial-gradient(420px 320px at 78% 4%, rgba(34, 211, 238, .07), transparent 65%),
    var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ===== 应用外壳 ===== */
#app { display: flex; min-height: 100vh; }

/* ===== 液态玻璃侧栏 ===== */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  color: #e2e8f0;
  background: linear-gradient(165deg, rgba(14, 116, 144, .84) 0%, rgba(8, 74, 94, .87) 52%, rgba(5, 44, 60, .90) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border-right: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 10px 0 42px rgba(4, 30, 42, .26);
  overflow: hidden;
}
/* 顶部液态高光 */
#sidebar::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 200px; pointer-events: none;
  background: linear-gradient(180deg, rgba(103, 232, 249, .10), rgba(103, 232, 249, 0));
}
/* 底部深青氛围 */
#sidebar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 260px; pointer-events: none;
  background: linear-gradient(0deg, rgba(8, 74, 94, .30), transparent);
}
.logo {
  display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08); position: relative; z-index: 1;
}
.logo-mark {
  width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 14px rgba(2, 12, 18, .4);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.logo-svg { width: 27px; height: 27px; display: block; }
.logo-text { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 4px; }

.menu { flex: 1; padding: 14px 12px; overflow-y: auto; scrollbar-width: none; position: relative; z-index: 1; }
.menu::-webkit-scrollbar { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 3px;
  border-radius: 10px; position: relative; color: #b7c6d6; font-size: 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.menu-item:hover {
  background: rgba(255, 255, 255, .08); color: #fff;
  border-color: rgba(255, 255, 255, .10);
}
.menu-item.active {
  background: linear-gradient(115deg, rgba(8, 145, 178, .95), rgba(12, 110, 140, .95));
  border-color: rgba(103, 232, 249, .30);
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 16px rgba(6, 80, 104, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.menu-item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 10px rgba(34, 211, 238, .8);
}
.mi-icon { width: 19px; height: 19px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.mi-icon svg { width: 18px; height: 18px; display: block; }
.sidebar-foot {
  padding: 14px 18px; font-size: 12px; color: #7d90a3; line-height: 1.8; position: relative; z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .02);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.icp-link { color: #7d90a3; text-decoration: none; font-size: 11px; }
.icp-link:hover { color: #a9bccf; text-decoration: underline; }
.login-icp { margin-top: 16px; text-align: center; }
.login-icp a { color: #94a3b8; text-decoration: none; font-size: 12px; }
.login-icp a:hover { text-decoration: underline; }
.aging-total td { font-weight: 600; background: #f1f5f9; border-top: 2px solid #cbd5e1; }
.stmt-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin: 4px 0 16px; }
.stmt-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid #0e7490; padding-bottom: 10px; margin-bottom: 12px; }
.stmt-head b { font-size: 16px; }
.stmt-head span { color: #475569; font-size: 13px; }
.stmt-sum { display: flex; flex-wrap: wrap; gap: 18px; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #334155; }
.stmt-sum b { margin-left: 4px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  height: 58px; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.tb-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.tb-right { display: flex; align-items: center; gap: 14px; }
.tb-user { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tb-avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
  background: linear-gradient(135deg, #0891b2, #0e7490);
  box-shadow: 0 2px 6px rgba(8, 145, 178, .35);
}
.tb-role { color: var(--muted); font-size: 12px; background: #f1f5f9; padding: 2px 8px; border-radius: 10px; }

#content { padding: 22px; flex: 1; }

/* ===== 连接状态徽标 ===== */
.conn-badge { font-size: 12px; padding: 3px 10px; border-radius: 12px; cursor: default; }
.conn-ok { background: var(--green-light); color: var(--green-dark); }
.conn-local { background: #e0f2fe; color: #0369a1; }
.conn-down { background: #fee2e2; color: #b91c1c; cursor: pointer; }
.conn-bad { background: #fee2e2; color: #b91c1c; cursor: pointer; }
.conn-connecting { background: #fef3c7; color: #b45309; }

/* ===== 更新横幅 ===== */
#update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: #fef3c7; color: #92400e; text-align: center; padding: 8px;
  font-size: 13px; box-shadow: var(--shadow);
}
#update-banner a { font-weight: 700; text-decoration: underline; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent;
  border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; font-weight: 500;
  transition: all .15s; background: #fff; color: var(--text);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #0891b2, #0e7490); color: #fff;
  box-shadow: 0 2px 8px rgba(8, 145, 178, .30);
}
.btn-primary:hover { background: linear-gradient(135deg, #0e7490, #155e75); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #f6f9fb; border-color: #cbd5e1; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-refresh { padding: 5px 10px; line-height: 1; }
.btn-refresh .icon-refresh { display: block; }
.btn-refresh:hover .icon-refresh { color: var(--primary); }
.btn-refresh.spinning .icon-refresh { animation: spin .6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { border: none; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 6px; width: 28px; height: 28px; line-height: 1; }
.btn-icon:hover { background: #fee2e2; color: var(--danger); }
.btn-link { border: none; background: transparent; color: var(--primary); cursor: pointer; font-size: 13px; padding: 0 6px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.btn-del { color: var(--danger); }

/* ===== 列表页 ===== */
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.list-head h2 { margin: 0; font-size: 18px; letter-spacing: .5px; }
.count { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.list-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; min-width: 200px; outline: none; background: #fff; }
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8, 145, 178, .12); }
.select-inline { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; background: #fff; }

/* ===== 表头筛选按钮 ===== */
.th-filterable { cursor: pointer; }
.th-filterable .th-label { display: inline-block; }
.th-filterable:hover .th-label { color: var(--primary); }
.th-filter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; padding: 0 3px;
  margin-left: 2px; vertical-align: middle; position: relative; outline: none;
}
.th-filter-btn .fp-arrow {
  display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #94a3b8; transition: border-top-color .15s;
}
.th-filter-btn:hover .fp-arrow { border-top-color: var(--primary); }
.th-filter-btn.open .fp-arrow,
.th-filter-btn.active .fp-arrow { border-top-color: var(--primary); }
.th-filter-btn.active::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}

/* ===== 筛选下拉面板 ===== */
.filter-panel {
  position: fixed; z-index: 1100; min-width: 200px; max-width: 280px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(8, 74, 94, .14); padding: 10px; box-sizing: border-box;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.fp-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fp-search { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; font-size: 13px; margin-bottom: 6px; outline: none; box-sizing: border-box; }
.fp-search:focus { border-color: var(--primary); }
.fp-options { max-height: 230px; overflow-y: auto; }
.fp-option { padding: 7px 9px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text); }
.fp-option:hover { background: #f1f5f9; }
.fp-option.selected { background: var(--green-light); color: var(--green-dark); }
.fp-date { display: flex; flex-direction: column; gap: 8px; }
.fp-date label { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fp-date-input { border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font-size: 13px; outline: none; }
.fp-date-input:focus { border-color: var(--primary); }
.fp-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }

.table-wrap { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; border: 1px solid rgba(226, 232, 240, .7); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; white-space: nowrap; }
.data-table thead th { background: #f8fafc; color: #475569; font-weight: 600; font-size: 12px; letter-spacing: .3px; border-bottom: 1px solid var(--border); }
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .12s; }
.data-table tbody tr:hover { background: #f6fafb; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .empty { text-align: center; color: var(--muted); padding: 32px; }
.td-act { text-align: right; }
.th-act { text-align: right; }
.text-danger { color: var(--danger); }

/* ===== 状态徽标 ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warn { background: #fef3c7; color: #b45309; }
.badge-ok { background: var(--green-light); color: var(--green-dark); }

/* ===== 页签 ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 16px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-body { min-height: 200px; }

/* ===== 工作台 ===== */
.dash-hello { font-size: 16px; margin-bottom: 18px; }
.dash-role { color: var(--muted); font-size: 13px; margin-left: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid rgba(226, 232, 240, .7); }
.stat-val { font-size: 24px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-money .stat-val { color: var(--primary-dark); }
.dash-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.dash-panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid rgba(226, 232, 240, .7); }
.dash-panel h3 { margin: 0 0 14px; font-size: 15px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { margin-bottom: 4px; }
.todo-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.todo-list a:hover { background: #f6fafb; }
.todo-tag { flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.tag-p0 { background: #7f1d1d; color: #fff; }
.tag-p1 { background: #fee2e2; color: #b91c1c; }
.tag-p2 { background: #fef3c7; color: #b45309; }
.tag-p3 { background: #e0f2fe; color: #0369a1; }
.tag-p4 { background: #f3e8ff; color: #7c3aed; }
.todo-title { font-weight: 600; flex-shrink: 0; }
.todo-desc { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa-btn { border: 1px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; color: var(--text); background: #fff; }
.qa-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 条形图 ===== */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 90px; flex-shrink: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 16px; background: #eef2f6; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #0891b2, #22d3ee); border-radius: 8px; min-width: 2px; }
.bar-val { width: 70px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ===== 权限矩阵 ===== */
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.perm-table td { text-align: center; }
.perm-mod { text-align: left !important; font-weight: 600; }
.perm-cell input { width: 16px; height: 16px; cursor: pointer; }
.matrix-foot { margin-top: 14px; }

/* ===== 表单 / 弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(7, 26, 36, .5); z-index: 1000;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 860px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(4, 20, 28, .30); }
.modal.modal-sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { border: none; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 非阻塞提示 toast（替代原生 alert） */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 3000; max-width: 80vw;
  background: #0c3140; color: #fff;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; line-height: 1.6;
  box-shadow: 0 10px 32px rgba(4, 20, 28, .35); cursor: pointer;
  border: 1px solid rgba(103, 232, 249, .18);
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item.full { grid-column: 1 / -1; }
.form-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.req { color: var(--danger); }
.form-item input, .form-item select, .form-item textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px; outline: none; background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8, 145, 178, .12); }
.form-item input:disabled, .form-item select:disabled, .form-item textarea:disabled { background: #f8fafc; color: var(--muted); }

/* 密码字段：眼睛图标切换 明文/掩码 */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { width: 100%; padding-right: 40px; box-sizing: border-box; }
.pwd-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.pwd-toggle:hover { color: #111827; background: #f1f5f9; }
.pwd-toggle.is-on { color: var(--primary); }

/* 文件上传（盖章合同） */
.form-item input[type="file"] { padding: 7px; font-size: 13px; }
.file-preview { margin-top: 2px; }
.file-preview img { max-width: 160px; max-height: 120px; border: 1px solid var(--border); border-radius: 8px; display: block; object-fit: cover; }
.file-hint { font-size: 11px; color: var(--muted); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 24px; transition: .2s; cursor: pointer; }
.switch span:before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span:before { transform: translateX(20px); }

/* 明细编辑器 */
.items-section { margin-top: 16px; }
.items-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.items-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 4px 6px; border-bottom: 1px solid var(--border); }
.items-table td { padding: 4px; }
.items-table input, .items-table select { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px; font-size: 13px; outline: none; font-family: inherit; background: #fff; }
.items-table input:focus, .items-table select:focus { border-color: var(--primary); }
.items-table td:first-child { min-width: 140px; }
.items-table td:nth-child(2) { width: 70px; }
.items-table .item-unit { display: block; text-align: center; color: #64748b; padding: 7px 2px; }
.items-table .item-code { display: block; text-align: center; color: #475569; font-variant-numeric: tabular-nums; padding: 7px 2px; white-space: nowrap; }
.items-table .item-readonly { display: block; color: #0e7490; font-weight: 600; padding: 7px 2px; }
.items-table .item-readonly.is-placeholder { color: #94a3b8; font-weight: 400; }
.items-table .item-unit { font-size: 12px; }
.items-table .item-readonly .price-tag {
  display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px;
  background: #e0f2fe; color: #0369a1; font-size: 11px; font-style: normal; font-weight: 400;
  vertical-align: 1px;
}

/* ===== 登录页 ===== */
.login-wrap {
  width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 560px at 18% 12%, rgba(14, 165, 200, .50) 0%, transparent 58%),
    radial-gradient(760px 560px at 86% 90%, rgba(8, 90, 116, .52) 0%, transparent 55%),
    radial-gradient(500px 380px at 70% 8%, rgba(34, 211, 238, .18) 0%, transparent 60%),
    linear-gradient(160deg, #0b3547 0%, #072433 55%, #041620 100%);
}
.login-card {
  background: rgba(255, 255, 255, .98); border-radius: 16px; padding: 38px 36px 32px;
  width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}
.login-logo {
  width: 80px; height: 80px; margin: 0 auto; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #f0fcff 0%, #ddf6fc 58%, rgba(221, 246, 252, 0) 74%);
}
.login-logo .logo-svg { width: 74px; height: 74px; }
.login-card h1 { margin: 14px 0 4px; font-size: 25px; letter-spacing: 12px; text-indent: 12px; font-weight: 700; color: #0f2530; }
.login-sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; letter-spacing: 3px; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.login-form input { border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8, 145, 178, .12); }
.login-form label.login-remember { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; cursor: pointer; }
.login-form label.login-remember input[type="checkbox"] { width: 16px; height: 16px; padding: 0; margin: 0; flex: 0 0 auto; }
.login-alert { text-align: left; font-size: 12px; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; line-height: 1.6; }
.alert-danger { background: #fee2e2; color: #b91c1c; }
.alert-info { background: #e0f2fe; color: #0369a1; }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .logo { border-bottom: none; padding: 12px 16px; }
  .menu { display: flex; flex-direction: row; overflow-x: auto; padding: 8px; }
  .menu-item { white-space: nowrap; }
  .menu-item.active::before { display: none; }
  .sidebar-foot { display: none; }
  #topbar { height: auto; min-height: 54px; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .tb-role { display: none; }
  #content { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  .list-head h2 { font-size: 16px; }
}

/* ===== 入库/出库单 明细横向平铺（单行展示，可横向滚动） ===== */
.doc-flat th, .doc-flat td { padding: 7px 10px; }
.doc-flat thead th { font-size: 11.5px; }
.doc-flat tbody td { font-size: 12.5px; }
/* 同一单据后续明细行的主字段留空，视觉上更易辨识分组 */
.doc-flat tbody tr.doc-cont { border-top: none; }
.doc-flat tbody tr.doc-cont td { color: #475569; }
