:root {
  --navy: #0f2744;
  --navy-2: #173a5e;
  --brand: #2563EB;
  --brand-2: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 2px 10px rgba(15, 39, 68, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "Segoe UI", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
button, input, select { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.login-card { width: 380px; background: var(--card); border-radius: 14px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo, .side-logo { width: 52px; height: 52px; border-radius: 12px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; margin: 0 auto 12px; }
.login-brand h1 { font-size: 20px; color: var(--navy); }
.login-brand p { color: var(--muted); font-size: 12px; margin-top: 4px; letter-spacing: 1px; }
.login-card label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
.login-card input, .modal-card input, input.inp, select.inp { width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #f8fafc; outline: none; }
.login-card input:focus, .modal-card input:focus, input.inp:focus, select.inp:focus { border-color: var(--brand); background: #fff; }
.err-msg { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 6px; }
.login-tip { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; }

/* 按钮 */
.btn-primary { padding: 10px 18px; border: none; border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer; font-weight: 500; }
.btn-primary:hover { background: var(--brand-2); }
.btn-primary:disabled { background: #93b4f5; cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-ghost { padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; }
.btn-sm { padding: 6px 12px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; }
.btn-sm:hover { border-color: var(--brand); color: var(--brand); }

/* 主框架 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px; font-size: 16px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand .side-logo { width: 36px; height: 36px; font-size: 18px; margin: 0; border-radius: 9px; }
.nav-list { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 22px; cursor: pointer; font-size: 14px; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: #fff; color: var(--navy); font-weight: 600; border-left-color: var(--brand); }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; }
.side-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.user-meta { display: flex; flex-direction: column; font-size: 13px; color: #fff; }
.user-meta small { color: #94a3b8; font-size: 11px; }
.btn-logout { width: 100%; padding: 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: transparent; color: #cbd5e1; cursor: pointer; }
.btn-logout:hover { background: rgba(255,255,255,.1); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h2 { font-size: 18px; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.topbar-right select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.badge-info { background: #e0edff; color: var(--brand-2); }
.badge-warn { background: #fef3c7; color: #b45309; }
.page-content { padding: 22px 26px; flex: 1; overflow-y: auto; }

/* 卡片/表格 */
.card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h3 { font-size: 15px; color: var(--navy); margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 20px; }
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 600; color: var(--navy); margin-top: 6px; }
.stat-card .value.red { color: var(--danger); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar label { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; position: sticky; top: 0; }
tr:hover td { background: #f8fbff; }
.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 8px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 13px; }

/* 步骤条/勾稽 */
.steps { display: flex; gap: 10px; flex-wrap: wrap; }
.step { flex: 1; min-width: 150px; padding: 14px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.step .n { font-size: 12px; color: var(--muted); }
.step .t { font-size: 14px; font-weight: 600; margin: 4px 0; }
.step.done { background: #f0fdf4; border-color: #bbf7d0; }
.step .st { font-size: 12px; }

/* 弹层 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: #fff; border-radius: 12px; padding: 26px; width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-card h3 { margin-bottom: 10px; color: var(--navy); }
.modal-card p { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 8px; z-index: 99; box-shadow: var(--shadow); }
.toast.err { background: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.mono { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; }
