:root {
  /* 色彩：企业级 · 深绿 + 浅灰白（对齐宣传图风格） */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --primary: #1f7a5c;        /* 深绿主色 */
  --primary-600: #176548;    /* 主色 hover */
  --primary-soft: #e7f3ee;   /* 主色淡底 */
  --mint: #1f7a5c;
  --mint-600: #176548;
  --mint-soft: #e7f3ee;
  --sidebar: #14352a;        /* 深墨绿侧边栏 */
  --sidebar-2: #1c4636;
  --sidebar-text: #cfe3da;
  --sidebar-active: #1f7a5c;
  --text: #1f2a37;
  --muted: #8a96a3;
  --border: #e8edf1;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --ok: #16a34a;
  --ok-soft: #e8f6ee;
  --warn: #f59e0b;
  --warn-soft: #fff3e0;
  --accent: #f97316;         /* 橙色强调（待办/待发货） */
  --primary-ring: rgba(31, 122, 92, .18);
  --mint-ring: rgba(31, 122, 92, .18);

  /* 阴影：克制、柔和 */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, .06);
  --shadow: 0 6px 20px rgba(16, 24, 40, .08);
  --shadow-lg: 0 18px 50px rgba(16, 24, 40, .14);

  /* 圆角 */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }
a { color: var(--primary); }

/* ---------------- 按钮 ---------------- */
.btn {
  background: var(--primary); color: #fff; border: 0; padding: 9px 16px;
  border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-xs); transition: background .15s, transform .08s ease, box-shadow .15s;
}
.btn:hover { background: var(--primary-600); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.btn.ghost:hover { background: #dce9ff; }
.btn.mint { background: var(--mint); }
.btn.mint:hover { background: var(--mint-600); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #dc2626; }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
input, select, textarea {
  font-family: inherit; font-size: 13px; padding: 9px 11px; width: 100%;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #aab4c0; }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; font-weight: 500; }
.muted { color: var(--muted); }

/* ---------------- 登录（分屏：左品牌 / 右表单）---------------- */
.login-screen {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}
/* 左侧品牌宣传区 */
.login-hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(to bottom left, #0c7a6e 0%, #14a394 44%, #e7a63e 100%);
  padding: 48px 52px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero .hero-orb { position: absolute; border-radius: 50%; filter: blur(8px); pointer-events: none; }
.login-hero .orb-1 { width: 320px; height: 320px; top: -90px; right: -70px;
  background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 70%); }
.login-hero .orb-2 { width: 260px; height: 260px; bottom: -60px; left: -50px;
  background: radial-gradient(circle, rgba(255,236,180,.30), rgba(255,236,180,0) 70%); }
.hero-brand { position: relative; display: flex; align-items: center; gap: 12px; }
.hero-logo {
  width: 44px; height: 44px; border-radius: 13px; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(2px);
}
.hero-brand-name { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.hero-brand-sub { font-size: 11px; opacity: .8; letter-spacing: 1.5px; }
.hero-body { position: relative; margin: 8px 0; }
.hero-tag {
  display: inline-block; font-size: 12px; padding: 5px 13px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  margin-bottom: 22px;
}
.hero-title { font-size: 34px; line-height: 1.25; font-weight: 800; letter-spacing: .5px; }
.hero-desc { margin-top: 16px; font-size: 13.5px; line-height: 1.8; opacity: .85; }
.hero-stats { position: relative; display: flex; gap: 30px; }
.hstat .v { font-size: 24px; font-weight: 800; }
.hstat .v span { font-size: 13px; font-weight: 600; opacity: .9; margin-left: 2px; }
.hstat .l { font-size: 12px; opacity: .82; margin-top: 2px; }

/* 右侧表单区 */
.login-form-side {
  background: #FAF8F5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 24px; position: relative;
}
.login-form-side .lang {
  position: absolute; top: 22px; right: 28px; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.login-form-side .lang .caret { font-size: 10px; }
.form-box { width: 100%; max-width: 360px; }
.form-title { font-size: 26px; font-weight: 800; color: var(--text); }
.form-sub { color: var(--muted); font-size: 13.5px; margin: 8px 0 30px; }
.field {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border: 1px solid #e7e1d6; border-radius: 10px; padding: 0 14px;
  margin-bottom: 16px; transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: #14a394; box-shadow: 0 0 0 3px rgba(20,163,148,.16); }
.field-ico { color: #9aa6b2; display: grid; place-items: center; flex: 0 0 auto; }
.field-ico svg { width: 19px; height: 19px; }
.field input { border: 0; padding: 13px 0; background: transparent; box-shadow: none; }
.field input:focus { box-shadow: none; }
.field-forgot { flex: 0 0 auto; font-size: 12.5px; color: #14a394; cursor: pointer; white-space: nowrap; }
.agree { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin: 2px 0 22px; }
.agree input { width: auto; }
.agree a { color: #14a394; text-decoration: none; }
.btn-login {
  width: 100%; background: #0e7d72; color: #fff; border: 0; border-radius: 10px;
  padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .08s;
}
.btn-login:hover { background: #0b6a61; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.login-form-side .hint {
  margin-top: 18px; font-size: 12px; color: var(--muted);
  background: #f3efe8; border: 1px dashed #e0d8c8; border-radius: 10px;
  padding: 10px 12px; line-height: 1.6;
}
.login-form-side .hint b { color: var(--text); font-weight: 600; }

/* 移动端：上下堆叠 */
@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 26px; }
  .hero-title { font-size: 26px; }
  .hero-stats { gap: 18px; }
  .login-form-side { padding: 32px 22px 44px; }
}

/* ---------------- 应用外壳 ---------------- */
.topbar {
  height: 58px; background: #fff;
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  padding: 0 18px; gap: 12px; position: sticky; top: 0; z-index: 20;
}
.logo {
  font-weight: 800; font-size: 15px; color: #fff; letter-spacing: .5px;
  background: var(--sidebar); padding: 7px 13px; border-radius: 9px;
}
.topbar .spacer { flex: 1; }
.tag { background: var(--primary-soft); color: var(--primary-600); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.top-search {
  width: 260px; max-width: 36vw; padding: 8px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: #f5f7f9; font-size: 13px; margin-left: 4px;
}
.top-search:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.bell { font-size: 17px; cursor: pointer; filter: grayscale(.15); transition: transform .12s; }
.bell:hover { transform: scale(1.1); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 auto;
}
.uname { font-size: 13px; font-weight: 600; color: var(--text); }

.body { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }

/* 侧边栏（深墨绿） */
.sidebar {
  width: 210px; background: var(--sidebar); padding: 14px 12px;
  position: sticky; top: 58px; height: calc(100vh - 58px); overflow: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary);
  display: grid; place-items: center; font-size: 17px; font-weight: 800; color: #fff;
}
.brand-logo.admin { background: linear-gradient(135deg, var(--mint), var(--primary)); }
.brand-name { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--sidebar-text); }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--sidebar-text); cursor: pointer; margin-bottom: 4px; font-size: 13.5px;
  border-left: 3px solid transparent; transition: background .15s, color .15s;
}
.nav-item .ni { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; border-left-color: #8fe3c4; font-weight: 600; }

.content { flex: 1; padding: 20px 24px; overflow: auto; background: var(--bg); }

/* ---------------- 页面头部 / 卡片 ---------------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-head h2 { font-size: 19px; font-weight: 700; }
.page-head .sub2 { color: var(--muted); font-size: 13px; }
.page-head .spacer { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px; box-shadow: var(--shadow-xs); margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 14px; font-size: 15px; font-weight: 700; padding-left: 11px;
  border-left: 3px solid var(--primary); line-height: 1.3;
}

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th {
  color: var(--muted); font-weight: 600; background: #f7fafd; font-size: 12.5px;
  position: sticky; top: 0; white-space: nowrap;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f9fbff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions button { margin-right: 6px; }
td.muted, .empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* 状态药丸 */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: #b9770a; }
.pill.off { background: var(--danger-soft); color: var(--danger); }

/* 分栏切换按钮 */
.seg { display: inline-flex; background: var(--primary-soft); border-radius: 10px; padding: 4px; gap: 4px; }
.seg-btn { border: 0; background: transparent; color: var(--primary-600); padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .12s; }
.seg-btn:hover { background: rgba(255,255,255,.6); }
.seg-btn.on { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); }

/* 筛选网格 */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 18px; align-items: end; }
.filter-grid > div { display: flex; flex-direction: column; gap: 6px; }
.filter-grid label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.filter-grid select, .filter-grid input[type=date] { width: 100%; }
.chk-line { display: flex; align-items: center; }
.chk-line label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.filter-note { margin-top: 12px; font-size: 12.5px; }

/* 合计行 */
.total-row td { background: #f3f8f5; font-weight: 700; color: var(--primary-600); border-top: 2px solid var(--border); }

/* 核销信息块 */
.recon-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px 0 2px; }
.recon-info > div { background: var(--primary-soft); border-radius: var(--r-sm); padding: 10px 12px; }
.recon-info span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.recon-info b { font-size: 16px; }
.recon-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.recon-row:last-child { border-bottom: 0; }
.tag { display: inline-block; background: var(--warn-soft); color: #b9770a; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-left: 4px; }

/* ---------------- 表单弹层 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: var(--r-lg); padding: 22px; width: 540px; max-width: 100%; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); border-top: 4px solid var(--primary); animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* 单据明细行 */
.line-row { display: grid; grid-template-columns: 2.4fr 1fr 1fr 1fr 34px; gap: 8px; align-items: end; margin-bottom: 8px; }
.line-row .amt { text-align: right; padding-top: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- 概览卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
  transition: transform .1s ease, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .85; }
.stat-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: var(--primary-soft); margin-bottom: 10px; }
.stat .v { font-size: 25px; font-weight: 700; letter-spacing: -.5px; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
/* 橙色强调卡（如待发货/应付） */
.stat.accent::before { background: var(--accent); }
.stat.accent .stat-ic { background: #fff1e6; }
.stat.accent .v { color: var(--accent); }

/* 欢迎横幅 */
.welcome {
  display: flex; align-items: center; gap: 14px; color: #fff; border-radius: var(--r);
  padding: 20px 24px; margin-bottom: 16px;
  background: linear-gradient(100deg, #176548 0%, #1f7a5c 55%, #2a9d77 100%);
  box-shadow: var(--shadow-sm);
}
.welcome-emoji { font-size: 30px; }
.welcome-title { font-size: 20px; font-weight: 800; }
.welcome-sub { font-size: 13px; opacity: .92; margin-top: 3px; }
.welcome .spacer { flex: 1; }

/* 工作台双栏 */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-cols .quick { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }

/* ---------------- 打印 ---------------- */
#print-area { display: none; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; left: 0; top: 0; width: 100%; padding: 24px; }
  .print-doc { max-width: 720px; margin: 0 auto; }
  .print-doc h2 { text-align: center; }
  .print-meta { display: flex; justify-content: space-between; margin: 12px 0; }
  .print-total { text-align: right; margin-top: 12px; font-size: 16px; }
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #1f2a37; color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 99;
  font-size: 13px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 手机端 ---------------- */
@media (max-width: 760px) {
  .body { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; display: flex; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 10px;
  }
  .brand { display: none; }
  .nav-item { white-space: nowrap; margin: 0 6px 0 0; border-left: 0; border-bottom: 3px solid transparent; padding: 8px 12px; }
  .nav-item.active { border-left: 0; border-bottom-color: var(--primary); background: var(--primary-soft); }
  .content { padding: 14px; }
  .grid2 { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  th, td { padding: 9px 7px; }
  .topbar { padding: 0 12px; }
  .logo { font-size: 14px; }
}

/* ---------------- 后台“开通模块”勾选 ---------------- */
.mod-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; margin: 0 8px 8px 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 13px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mod-check:hover { border-color: var(--primary); background: var(--primary-soft); }
.mod-check input { width: auto; margin: 0; accent-color: var(--primary); cursor: pointer; }
.mod-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-600); font-weight: 600; }

/* ---------------- 固定资产：折旧进度条 ---------------- */
.prog {
  height: 4px; border-radius: 4px; background: var(--border);
  overflow: hidden; margin: 4px 0 2px;
}
.prog > span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
