﻿/* ===========================================================
   物资管理系统 V4.0 — app styles
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; color: var(--ink); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted { color: var(--muted); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity var(--dur-slow) var(--ease-out);
}
.boot-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-700));
  animation: bootPulse 1.1s var(--ease-in-out) infinite;
}
@keyframes bootPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.86); opacity: 0.55; }
}

/* ===========================================================
   AUTH
   =========================================================== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(380px, 0.95fr);
  background: var(--surface);
}

.auth-art {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  align-items: center;
  color: #fff;
  background:
    radial-gradient(1100px 700px at 8% -10%, #3b82f6 0%, transparent 55%),
    radial-gradient(900px 600px at 90% 105%, #1e3a8a 0%, transparent 60%),
    linear-gradient(160deg, #1d4ed8 0%, #1e40af 45%, #0f2a63 100%);
}
.auth-art::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 40% 40%, #000 20%, transparent 100%);
  pointer-events: none;
}
.auth-art-inner { position: relative; z-index: 1; max-width: 520px; }
.auth-headline { font-size: clamp(1.9rem, 3.2vw, 2.9rem); margin: var(--s7) 0 var(--s4); color: #fff; letter-spacing: -0.03em; line-height: 1.18; }
.auth-sub { color: rgba(255,255,255,.78); max-width: 42ch; }
.auth-points { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s3); }
.auth-points li { display: flex; align-items: center; gap: var(--s3); color: rgba(255,255,255,.9); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #93c5fd; box-shadow: 0 0 0 4px rgba(147,197,253,.18); }

.auth-glass {
  margin-top: var(--s8);
  display: grid; gap: 2px;
  padding: var(--s4);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.6);
}
.auth-glass-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 8px; color: rgba(255,255,255,.78); }
.auth-glass-row b { color: #fff; font-family: var(--font-num); font-size: 1.05rem; }

.auth-panel { display: grid; align-content: center; justify-items: center; gap: var(--s5); padding: clamp(24px, 4vw, 56px); background: var(--surface); }
.auth-card { width: min(420px, 100%); }
.auth-tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: var(--s6); }
.auth-tab { border: 0; background: transparent; color: var(--muted); padding: 7px 20px; border-radius: var(--r-pill); font-weight: 550; transition: color var(--dur) var(--ease-out), background var(--dur) var(--ease-out); }
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }

.auth-form { display: grid; gap: var(--s4); }
.auth-form h2 { font-size: 1.5rem; }
.auth-form .muted { margin-top: -6px; margin-bottom: var(--s2); }
.auth-error { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: var(--r-sm); font-size: .8125rem; }
.auth-demo { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); color: var(--muted); font-size: .8125rem; }
.auth-foot { color: var(--muted); font-size: .75rem; }

/* ===========================================================
   SHELL
   =========================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: var(--s5) var(--s3) var(--s4);
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: var(--s3); padding: 4px 10px var(--s5); min-width: 0; }
.brand-mark {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), var(--accent-700));
  box-shadow: 0 6px 16px -6px rgba(37,99,235,.7);
  display: grid; place-items: center; color: #fff;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-mark-app { background: none; box-shadow: none; }
.brand-mark-app img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.brand-text { display: grid; min-width: 0; line-height: 1.3; }
.brand-text strong { font-size: .9375rem; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: .6875rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.brand-lg .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.brand-lg strong { color: #fff; font-size: 1.0625rem; }
.brand-lg span { color: rgba(255,255,255,.65); }

.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 2px var(--s4); display: grid; align-content: start; gap: 2px; scrollbar-width: thin; }
.nav-group { margin-top: var(--s4); padding: 0 10px 6px; font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav-group:first-child { margin-top: 0; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: var(--s3);
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: .8438rem;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .78; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item:active { transform: scale(.985); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-700); font-weight: 600; }
.nav-item.is-active svg { opacity: 1; color: var(--accent); }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -2px; top: 50%; translate: 0 -50%;
  width: 3px; height: 18px; border-radius: 3px; background: var(--accent);
}
.nav-item.is-locked { opacity: .45; cursor: not-allowed; }
.nav-item .nav-badge { margin-left: auto; font-size: .6875rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 0 6px; border-radius: var(--r-pill); }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s3); }
.user-card { display: flex; align-items: center; gap: var(--s3); padding: 8px 10px; border-radius: var(--r-md); transition: background var(--dur) var(--ease-out); }
.user-card:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .8125rem; font-weight: 650; color: #fff; background: linear-gradient(140deg, var(--accent), var(--accent-700)); flex: none; }
.user-meta { min-width: 0; line-height: 1.3; }
.user-meta b { display: block; font-size: .8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: .6875rem; color: var(--muted); }
.user-card .icon-btn { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s5);
  padding: 0 var(--s7);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.page-head { min-width: 0; overflow: hidden; }
.page-head h1 { font-size: 1.125rem; }
.page-head p { font-size: .75rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s2); flex: none; }

.search-mini {
  display: flex; align-items: center; gap: var(--s2);
  height: 38px; padding: 0 10px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); min-width: 240px;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.search-mini:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search-mini svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search-mini input { border: 0; outline: 0; background: transparent; width: 100%; font-size: .8125rem; }
.search-mini kbd { font-family: var(--font-num); font-size: .625rem; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; white-space: nowrap; }

.view { padding: var(--s6) clamp(16px, 1.6vw, 36px) var(--s7); display: grid; gap: var(--s6); align-content: start; min-height: calc(100vh - var(--topbar-h)); max-width: 1800px; width: 100%; margin: 0 auto; }
.view.is-fixed { display: block; height: calc(100vh - var(--topbar-h)); min-height: 0; overflow: hidden; }
.view.is-fixed > .grid { height: 100%; min-height: 0; }

/* ===========================================================
   COMPONENTS
   =========================================================== */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: .8125rem; font-weight: 550; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--line-strong); box-shadow: var(--sh-sm); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); box-shadow: 0 6px 16px -8px rgba(37,99,235,.8); }
.btn-primary:hover { --btn-bg: var(--accent-600); --btn-bd: var(--accent-600); box-shadow: 0 10px 22px -10px rgba(37,99,235,.9); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--ink-2); }
.btn-ghost:hover { --btn-bg: var(--surface-2); }
.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: .75rem; border-radius: var(--r-xs); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink-2);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.card-pad { padding: var(--s6); }
.card-hover:hover { box-shadow: var(--sh-md); border-color: var(--line-strong); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s5) var(--s6); border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: .9375rem; }
.card-head .muted { font-size: .75rem; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: var(--s6); }
.card-body.tight { padding: var(--s4) var(--s5); }

.section-title { display: flex; align-items: baseline; gap: var(--s3); }
.section-title h2 { font-size: 1rem; }
.section-title p { color: var(--muted); font-size: .75rem; }

.grid { display: grid; gap: var(--s5); }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* KPI */
.kpi { padding: var(--s5) var(--s5) var(--s4); display: grid; gap: var(--s3); }
.kpi-top { display: flex; align-items: center; gap: var(--s3); }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-label { font-size: .75rem; color: var(--muted); }
.kpi-value { font-family: var(--font-num); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.kpi-value small { font-size: .75rem; font-weight: 500; color: var(--muted); margin-left: 4px; font-family: var(--font); }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; font-size: .6875rem; color: var(--muted); }

.progress { height: 6px; border-radius: var(--r-pill); background: var(--bg-deep); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #60a5fa); width: 0; transition: width var(--dur-slow) var(--ease-out); }
.progress.is-warn > i { background: linear-gradient(90deg, #d97706, #f59e0b); }
.progress.is-danger > i { background: linear-gradient(90deg, #dc2626, #f87171); }
.progress.is-ok > i { background: linear-gradient(90deg, #059669, #34d399); }

/* table */
.table-wrap { overflow: auto; border-radius: inherit; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .8125rem; }
.tbl thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
  padding: 10px var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl tbody td { padding: 11px var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.tbl tbody tr:hover { background: var(--accent-soft-2); }
.tbl tbody tr.is-selected { background: var(--accent-soft); }
.tbl tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .cell-strong { font-weight: 600; color: var(--ink); }
.tbl .cell-sub { display: block; font-size: .6875rem; color: var(--muted); }
.tbl td.right, .tbl th.right { text-align: right; }
.tbl .code { font-family: var(--font-num); font-size: .75rem; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: .6875rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.no-dot::before { display: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent-700); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: .75rem; transition: all var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* tabs / segmented */
.tabs { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); width: fit-content; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 550; padding: 7px 14px; border-radius: var(--r-sm); transition: all var(--dur) var(--ease-out); }
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { background: var(--surface); color: var(--accent-700); box-shadow: var(--sh-xs); }

/* fields */
.field { display: grid; gap: 6px; font-size: .8125rem; }
.field > span { color: var(--ink-2); font-weight: 550; font-size: .75rem; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0;
  height: 38px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); outline: 0;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur);
}
.field textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
.field .hint { font-size: .6875rem; color: var(--muted); }
.field-row { display: grid; gap: var(--s4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.toolbar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

.empty { display: grid; justify-items: center; gap: var(--s3); padding: var(--s9) var(--s5); text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .4; }
.empty b { color: var(--ink-2); font-weight: 600; }

.notice { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--accent-soft-2); border: 1px solid var(--accent-soft); color: var(--ink-2); font-size: .8125rem; }
.notice svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 2px; }
.notice.is-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.is-warn svg { color: var(--warn); }

/* ===========================================================
   INVENTORY — 24 列表头台账
   =========================================================== */
.inv-name { display: grid; gap: 1px; }
.inv-name b { font-weight: 600; }
.inv-name span { font-size: .6875rem; color: var(--muted); }
.inv-stock { display: grid; gap: 5px; min-width: 110px; justify-items: end; }
.inv-stock .progress { width: 100%; }
.inv-stock b { font-family: var(--font-num); font-size: .8125rem; font-weight: 600; }
.tbl tbody tr[data-code] { cursor: pointer; }

.ledger-wrap { max-height: calc(100vh - 205px); min-height: 260px; border-radius: 0; overflow-y: auto; overflow-x: hidden; }
.tbl-ledger { table-layout: fixed; min-width: 2260px; }
.tbl-ledger th, .tbl-ledger td { padding: 9px 10px; white-space: nowrap; }
.tbl-ledger th.center, .tbl-ledger td.center { text-align: center; }
.tbl-ledger .cell-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-ledger .sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 2; box-shadow: inset -1px 0 0 var(--line); }
.tbl-ledger thead .sticky-col { background: var(--surface-2); z-index: 3; }
.tbl-ledger tbody tr:hover .sticky-col { background: var(--accent-soft-2); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.dot-warn { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); vertical-align: middle; }
.input-ro { background: var(--surface-2) !important; color: var(--muted); }

.form-group { display: grid; gap: 12px; }
.form-group-title { font-size: .6875rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.drawer-group { margin-bottom: 16px; }
.drawer-group-title { font-size: .6875rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; margin-bottom: 8px; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; font-size: .8125rem; }
.drawer-grid > div > div:last-child { word-break: break-all; }

.cell-sub2 { display: block; font-size: .625rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-hint { font-size: .75rem; padding: 8px 12px; border-radius: 10px; line-height: 1.55; }
.cls-hint.is-ok { background: var(--ok-soft); color: var(--ok); }
.cls-hint.is-warn { background: var(--warn-soft); color: var(--warn); }
.mini-select { height: 32px; width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 0 8px; font-size: .75rem; }

/* ===========================================================
   DASHBOARD
   =========================================================== */
.welcome { display: flex; align-items: flex-end; gap: var(--s5); flex-wrap: wrap; }
.welcome h2 { font-size: 1.375rem; letter-spacing: -0.025em; }
.welcome p { color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.welcome .toolbar { margin-left: auto; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.quick {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  text-align: left; transition: all var(--dur) var(--ease-out); min-height: 62px;
}
.quick:hover { border-color: var(--accent); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.quick:active { transform: translateY(0) scale(.995); }
.quick .qi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.quick .qi svg { width: 17px; height: 17px; }
.quick b { display: block; font-size: .8125rem; font-weight: 600; }
.quick span { font-size: .6875rem; color: var(--muted); }
.quick.is-urgent .qi { background: var(--warn-soft); color: var(--warn); }

.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s3); padding: 10px 0; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 8px; top: 28px; bottom: -4px; width: 1px; background: var(--line); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; margin: 7px 0 0 4px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-item.is-warn .tl-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.tl-item.is-ok .tl-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.tl-body { min-width: 0; }
.tl-body b { font-size: .8125rem; font-weight: 550; display: block; }
.tl-body span { font-size: .6875rem; color: var(--muted); }

.alert-list { display: grid; gap: var(--s3); }
.warn-row { display: grid; grid-template-columns: minmax(0,1fr) 88px; gap: var(--s3); align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.warn-row b { font-size: .8125rem; font-weight: 550; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row span { font-size: .6875rem; color: var(--muted); }

/* ===========================================================
   PAGES
   =========================================================== */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.filters .field { gap: 4px; }
.filters .field input, .filters .field select { height: 34px; font-size: .8125rem; }

.stat-line { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.stat-line b { color: var(--ink); font-family: var(--font-num); font-size: .875rem; }

.table-foot { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.table-foot .spacer { margin-left: auto; }

.pager { display: flex; gap: 4px; }
.pager button { min-width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: .75rem; color: var(--ink-2); }
.pager button:hover { border-color: var(--accent); color: var(--accent); }
.pager button.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* label printing */
.label-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s5); align-items: start; }
.label-preview {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
  display: grid; gap: var(--s4);
}
.label-card {
  width: 80mm; min-height: 50mm; padding: 4mm;
  background: #fff; color: #111;
  border: 1px solid #d8dee9; border-radius: 3mm;
  display: grid; grid-template-columns: 1fr 26mm; gap: 3mm;
  font-size: 8pt; line-height: 1.35;
}
.label-card .lc-title { font-size: 10pt; font-weight: 700; letter-spacing: .02em; margin-bottom: 1.5mm; padding-bottom: 1.5mm; border-bottom: .3mm solid #111; }
.label-card .lc-row { display: grid; grid-template-columns: 16mm 1fr; gap: 1mm; }
.label-card .lc-row span { color: #555; }
.label-card .lc-row b { font-weight: 600; word-break: break-all; }
.label-card .lc-qr { display: grid; place-items: center; align-content: center; gap: 1mm; }
.label-card .lc-qr svg { width: 24mm; height: 24mm; display: block; }
.label-card .lc-qr em { font-style: normal; font-size: 6pt; font-family: var(--font-num); color: #333; letter-spacing: .02em; }

.select-list { display: grid; gap: 6px; max-height: 560px; overflow: auto; padding-right: 4px; }
.select-row { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: var(--s3); align-items: center; padding: 9px 10px; border-radius: var(--r-sm); border: 1px solid transparent; transition: all var(--dur-fast) var(--ease-out); cursor: pointer; }
.select-row:hover { background: var(--surface-2); }
.select-row.is-selected { background: var(--accent-soft); border-color: var(--accent); }
.select-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.select-row b { font-size: .8125rem; font-weight: 550; display: block; }
.select-row span { font-size: .6875rem; color: var(--muted); }

/* diesel calculator */
.calc { display: grid; gap: var(--s4); }
.calc-block { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); background: var(--surface-2); }
.calc-block h4 { font-size: .8125rem; margin-bottom: var(--s3); display: flex; align-items: center; gap: 6px; }
.calc-block h4 .badge { margin-left: auto; }
.calc-out { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--s3); }
.calc-res { padding: var(--s4); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.calc-res span { font-size: .6875rem; color: var(--muted); display: block; }
.calc-res b { font-family: var(--font-num); font-size: 1.25rem; font-weight: 600; }
.calc-res b.neg { color: var(--danger); }
.calc-res b.pos { color: var(--ok); }

/* report */
.report-run { display: grid; gap: var(--s4); place-items: center; padding: var(--s8) var(--s6); text-align: center; }
.report-run .ring { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.report-run .progress { width: min(420px, 100%); height: 8px; }

.report-doc { display: grid; gap: var(--s5); }
.report-head { display: flex; align-items: flex-end; gap: var(--s4); padding-bottom: var(--s4); border-bottom: 2px solid var(--ink); }
.report-head h2 { font-size: 1.25rem; }
.report-head .muted { font-size: .75rem; }
.report-head .spacer { margin-left: auto; text-align: right; font-size: .75rem; color: var(--muted); }
.report-total { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--s3); }
.report-total div { padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.report-total span { font-size: .6875rem; color: var(--muted); display: block; }
.report-total b { font-family: var(--font-num); font-size: 1.125rem; }

/* org */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s4); }
.dept-card { padding: var(--s5); display: grid; gap: var(--s3); }
.dept-card .type { font-size: .6875rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.dept-card h4 { font-size: .9375rem; }
.dept-card .person { display: flex; align-items: center; gap: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--line); }
.dept-card .person .avatar { width: 28px; height: 28px; font-size: .75rem; }
.dept-card .person span { font-size: .6875rem; color: var(--muted); display: block; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: var(--s6); align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--topbar-h) + var(--s6)); }
.settings-nav button { text-align: left; padding: 9px 12px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink-2); font-size: .8125rem; font-weight: 500; }
.settings-nav button:hover { background: var(--surface-2); }
.settings-nav button.is-active { background: var(--accent-soft); color: var(--accent-700); font-weight: 600; }
.settings-panel { display: grid; gap: var(--s5); }
.set-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .set-text { min-width: 0; }
.set-row .set-text b { display: block; font-size: .8125rem; font-weight: 600; }
.set-row .set-text span { font-size: .6875rem; color: var(--muted); }
.set-row .set-ctl { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: .75rem; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--surface); color: var(--accent-700); box-shadow: var(--sh-xs); font-weight: 600; }

.switch { width: 40px; height: 23px; border-radius: var(--r-pill); border: 0; background: var(--line-strong); position: relative; transition: background var(--dur) var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--sh-xs); transition: transform var(--dur) var(--ease-out); }
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(17px); }

/* role cards */
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--s4); }
.role-card { padding: var(--s5); display: grid; gap: 6px; }
.role-card h4 { display: flex; align-items: center; gap: var(--s2); font-size: .875rem; }
.role-card p { font-size: .75rem; color: var(--muted); }

/* ===========================================================
   OVERLAYS
   =========================================================== */
.modal-root, .drawer-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12, 20, 36, 0.42);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease-out);
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed; z-index: 91; left: 50%; top: 50%;
  translate: -50% -50%;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  opacity: 0; transform: scale(.97) translateY(8px); pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.modal.is-open { opacity: 1; transform: none; pointer-events: auto; }
.modal-wide { width: min(880px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s6) var(--s4); border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1rem; }
.modal-head p { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: var(--s5) var(--s6); overflow-y: auto; overflow-x: hidden; display: grid; gap: var(--s4); }
.modal-foot { display: flex; gap: var(--s3); justify-content: flex-end; padding: var(--s4) var(--s6); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.drawer {
  position: fixed; z-index: 91; top: 0; right: 0; bottom: 0;
  width: min(460px, 100vw);
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-left: 1px solid var(--glass-line);
  box-shadow: var(--sh-lg);
  transform: translateX(102%); transition: transform var(--dur-slow) var(--ease-out);
}
.drawer.is-open { transform: none; }

.toast-root { position: fixed; z-index: 120; left: 50%; bottom: 28px; translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-md);
  font-size: .8125rem; color: var(--ink);
  animation: toastIn 260ms var(--ease-out);
}
.toast svg { width: 16px; height: 16px; color: var(--ok); }
.toast.is-error svg { color: var(--danger); }
.toast.is-info svg { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* skeleton shimmer */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg-deep) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ===========================================================
   PRINT
   =========================================================== */
.print-area { display: none; }
@media print {
  body { background: #fff; }
  .app, .auth, .toast-root, .modal-root, .drawer-root, .overlay, #boot { display: none !important; }
  .print-area { display: block !important; }
  .print-page { width: 100%; padding: 0; }
  .print-labels { display: grid; grid-template-columns: repeat(2, auto); gap: 4mm; justify-content: start; }
  .label-card { break-inside: avoid; border: 1px solid #999; }
  @page { margin: 8mm; }
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: minmax(0, 1fr); }
  .label-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .app.is-wide { grid-template-columns: minmax(0, 1fr); }
  .app.is-wide .brand-text, .app.is-wide .nav-group, .app.is-wide .nav-item span, .app.is-wide .user-meta { display: initial; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0;
    width: 264px; transform: translateX(-102%);
    transition: transform var(--dur-slow) var(--ease-out);
    box-shadow: var(--sh-lg);
  }
  .sidebar.is-open { transform: none; }
  .topbar { padding: 0 var(--s5); }
  .view { padding: var(--s5); }
  .only-mobile { display: grid !important; }
  .grid-3, .quick-grid, .role-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; display: flex; overflow: auto; }
}

@media (max-width: 720px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .view { padding: var(--s4); gap: var(--s4); }
  .grid-4, .grid-3, .grid-2, .quick-grid, .role-cards, .report-total, .calc-out { grid-template-columns: minmax(0, 1fr); }
  .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); }
  .search-mini { display: none; }
  .page-head h1 { font-size: 1rem; }
  .topbar { height: 64px; padding: 0 var(--s4); gap: var(--s3); }
  .welcome { align-items: flex-start; gap: var(--s3); }
  .welcome .toolbar { margin-left: 0; width: 100%; }
  .welcome .toolbar .btn { flex: 1; }
  .label-card { width: 100%; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .card-pad { padding: var(--s4); }
  .card-head { padding: var(--s4); }
  .card-body { padding: var(--s4); }
}

.only-mobile { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 一屏显示的紧凑表格：百分比列宽 + 全部居中（提高选择器权重，覆盖通用表格样式） */
.tbl.tbl-fit { table-layout: fixed; width: 100%; font-size: .71875rem; }
.tbl.tbl-fit thead th { font-size: .6875rem; letter-spacing: 0; text-transform: none; text-align: center; padding: 8px 3px; }
.tbl.tbl-fit th, .tbl.tbl-fit td { padding: 6px 3px; text-align: center; vertical-align: middle; white-space: nowrap; }
.tbl.tbl-fit tbody td { padding: 6px 3px; text-align: center; }
.tbl.tbl-fit td .cell-clip, .tbl.tbl-fit td .num { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.tbl-fit tbody tr { cursor: pointer; }
.tbl.tbl-fit td .dot-warn { margin-left: 2px; }

/* 宽表模式：台账页收起侧栏文字，给表格更多横向空间 */
.app.is-wide { grid-template-columns: 68px minmax(0, 1fr); }
.app.is-wide .sidebar { padding: var(--s5) 8px var(--s4); }
.app.is-wide .brand { padding: 4px 4px var(--s5); justify-content: center; }
.app.is-wide .brand-text,
.app.is-wide .nav-group,
.app.is-wide .nav-item span,
.app.is-wide .nav-item .nav-badge,
.app.is-wide .user-meta,
.app.is-wide .user-card .icon-btn { display: none; }
.app.is-wide .nav-item { justify-content: center; padding: 10px 6px; }
.app.is-wide .nav-item.is-active::before { left: -6px; }
.app.is-wide .user-card { justify-content: center; padding: 8px 4px; }
.app.is-wide .view { max-width: none; padding: var(--s6) var(--s6); }
/* 窄屏：宽表模式不应把主内容挤到图标栏里（覆盖前面的 .app.is-wide 规则） */
@media (max-width: 1024px) {
  .app.is-wide { grid-template-columns: minmax(0, 1fr); }
  .app.is-wide .sidebar { width: 264px; padding: var(--s5) var(--s3) var(--s4); }
  .app.is-wide .brand { padding: 4px 10px var(--s5); justify-content: flex-start; }
  .app.is-wide .brand-text { display: grid; }
  .app.is-wide .nav-group { display: block; }
  .app.is-wide .nav-item { justify-content: flex-start; padding: 9px 10px; }
  .app.is-wide .nav-item span { display: inline; }
  .app.is-wide .nav-item .nav-badge { display: inline-flex; }
  .app.is-wide .nav-item.is-active::before { left: -2px; }
  .app.is-wide .user-card { justify-content: flex-start; padding: 8px 10px; }
  .app.is-wide .user-meta { display: block; }
  .app.is-wide .user-card .icon-btn { display: grid; }
  .app.is-wide .view { max-width: none; padding: var(--s4); }
}
/* 窄窗口：列宽不足时改为横向滚动，保证每个单元格可读 */
@media (max-width: 1279px) {
  .ledger-wrap { overflow-x: auto; }
  .tbl.tbl-fit.tbl-24 { min-width: 1488px; }
  .tbl.tbl-fit.tbl-19 { min-width: 1330px; }
}
/* ===========================================================
   INBOUND
   =========================================================== */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.import-summary { display: flex; align-items: center; gap: 10px; padding: 12px 0 10px; flex-wrap: wrap; }
.import-summary .spacer { margin-left: auto; }
.row-warn td { background: var(--warn-soft); }
.upload-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); min-height: 64px; cursor: pointer; transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.upload-box:hover { border-color: var(--accent); background: var(--accent-soft-2); }
.upload-box.is-drag { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }
.upload-box .btn { margin-left: auto; flex: none; }
.upload-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.upload-ico svg { width: 18px; height: 18px; }
.upload-text { display: grid; gap: 2px; min-width: 0; }
.upload-text b { font-size: .8125rem; font-weight: 600; }
.upload-text span { font-size: .6875rem; color: var(--muted); }
.recent-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .75rem; }
.recent-row:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid .span-2 { grid-column: auto; } }
.tbl-rec { font-size: .75rem; }
.tbl-rec .code { font-size: .65625rem; padding: 1px 5px; }

.doc-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.doc-row { display: grid; gap: 2px; font-size: .8125rem; min-width: 0; }
.doc-row span { color: var(--muted); font-size: .6875rem; }
.doc-row b { font-weight: 600; word-break: break-all; }
.arrive { width: 100%; height: 28px; text-align: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-family: var(--font-num); font-size: .75rem; }
.arrive:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
@media (max-width: 900px) { .doc-card { grid-template-columns: 1fr 1fr; } }
/* 批量入库编辑器 */
.batch-editor { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.batch-tbl { table-layout: fixed; width: 100%; }
.batch-tbl thead th { background: var(--surface-2); font-size: .6875rem; text-align: center; padding: 8px 6px; white-space: nowrap; }
.batch-tbl td { padding: 4px 5px; vertical-align: middle; text-align: center; }

.batch-tbl td[data-cls] { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-tbl .icon-btn { width: 28px; height: 28px; }
.batch-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.batch-total { margin-left: auto; font-size: .75rem; color: var(--muted); }
.batch-total b { color: var(--ink); font-family: var(--font-num); font-size: 1rem; margin-left: 4px; }
@media (max-width: 900px) { .batch-tbl { min-width: 760px; } .batch-editor { overflow-x: auto; } }
/* 出库：扫码与批量 */
.scan-bar { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.scan-bar:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.scan-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.scan-ico svg { width: 18px; height: 18px; }
.scan-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 38px; font-size: .875rem; }
.scan-card { display: grid; grid-template-columns: 96px minmax(0, 1fr) 190px; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.scan-qr svg { width: 88px; height: 88px; display: block; }
.scan-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; font-size: .75rem; }
.scan-meta span { display: block; color: var(--muted); font-size: .6875rem; }
.scan-meta b { font-weight: 600; }
.scan-action { display: grid; gap: 8px; }
.cart-qty { width: 100%; height: 30px; text-align: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-family: var(--font-num); font-size: .75rem; }
.row-mat { width: 100%; height: 32px; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 0 6px; font-size: .8125rem; }
.row-mat:hover { border-color: var(--line); background: var(--surface); }
.row-mat:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: var(--ring); }
@media (max-width: 900px) { .scan-card { grid-template-columns: 1fr; } .scan-meta { grid-template-columns: 1fr 1fr; } }
/* ===========================================================
   图标导航（80px 竖条，悬停显示名称）
   =========================================================== */
.nav-sep { display: none; }
.nav-tip {
  position: fixed; z-index: 130; transform: translateY(-50%);
  background: var(--ink); color: var(--surface);
  font-size: .75rem; line-height: 1; padding: 8px 10px; border-radius: 8px;
  white-space: nowrap; box-shadow: var(--sh-md); pointer-events: none;
}
.nav-tip::before {
  content: ""; position: absolute; left: -4px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 8px; height: 8px; background: var(--ink); border-radius: 1px;
}

@media (min-width: 1025px) {
  .sidebar { padding: 16px 8px 12px; }
  .brand { justify-content: center; padding: 2px 0 var(--s5); }
  .brand-text { display: none; }
  .nav-group { display: none; }
  .nav-sep { display: block; height: 1px; background: var(--line); margin: 8px 8px; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item span { display: none; }
  .nav-item .nav-badge { display: none; }
  .nav-item.is-active::before { left: -8px; }
  .nav { justify-items: center; }
  .user-card { justify-content: center; padding: 8px 0; }
  .user-meta, .user-card .icon-btn { display: none; }
  .user-card .avatar { cursor: pointer; }
}
/* 台账页：固定一屏，表格内部滚动 */
.page-fill { display: flex; flex-direction: column; gap: var(--s5); height: 100%; min-height: 0; }
.flex-card { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.flex-card > div[id$="Table"] { flex: 1 1 auto; min-height: 0; display: flex; }
.flex-card .ledger-wrap { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
/* ===========================================================
   入库 / 出库：左右分栏、固定一屏
   =========================================================== */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: 100%; min-height: 0; }
.col-left { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.col-right { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex: none; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.mode-card svg { width: 18px; height: 18px; color: var(--muted); }
.mode-card b { font-size: .875rem; }
.mode-card span { font-size: .6875rem; color: var(--muted); }
.mode-card:hover { border-color: var(--accent); box-shadow: var(--sh-sm); }
.mode-card.is-active { border-color: var(--accent); background: var(--accent-soft); }
.mode-card.is-active svg, .mode-card.is-active b { color: var(--accent-700); }
.left-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.left-card .pane-head { flex: none; }
.left-card .form-fields { flex: 1 1 auto; overflow: auto; }
.left-card .hint-box { flex: none; }
.upload-card { flex: 1 1 auto; margin: 14px; border: 2px dashed var(--line-strong); border-radius: 14px; background: linear-gradient(180deg, #fbfcfe, #f6f8fc);
  display: grid; place-items: center; cursor: pointer; transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); min-height: 0; }
.upload-card:hover { border-color: var(--accent); background: var(--accent-soft-2); }
.upload-card.is-drag { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }
.drop-zone { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 16px; }
.drop-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.drop-ico svg { width: 30px; height: 30px; }
.drop-zone b { font-size: 1.0625rem; }
.drop-zone > span { color: var(--muted); font-size: .8125rem; }
.drop-zone .btn { margin-top: 8px; }
.drop-zone em { font-style: normal; color: var(--muted); font-size: .6875rem; margin-top: 6px; }
.pane-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pane-head h3 { font-size: .9375rem; }
.pane-head p { font-size: .6875rem; color: var(--muted); margin-top: 2px; }
.pane-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.doc-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); flex: none; }
.doc-item { display: grid; gap: 2px; min-width: 0; }
.doc-item span { font-size: .625rem; color: var(--muted); }
.doc-item b { font-size: .75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fill-table { flex: 1 1 auto; min-height: 0; overflow: auto; }
.fill-table .empty { padding: var(--s7) var(--s5); }
.cell-input { width: 100%; min-width: 0; height: 30px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 0 4px; font-size: .71875rem; color: var(--ink); }
.cell-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.cell-select { width: 100%; min-width: 0; height: 30px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 0 4px; font-size: .6875rem; color: var(--ink); }
.cell-select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 14px 16px; align-content: start; }
.form-fields .span-2 { grid-column: span 2; }
.form-fields .field input, .form-fields .field select { height: 34px; font-size: .8125rem; }
.hint-box { display: flex; align-items: center; gap: 8px; margin: 0 16px 14px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft-2); color: var(--ink-2); font-size: .75rem; }
.hint-box svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.batch-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; flex: none; }
.col-right .table-foot { flex: none; }
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); height: auto; }
  .col-left, .col-right { min-height: 420px; }
}
/* 分栏表格：压缩内边距，避免内容撑出横向滚动 */
.fill-table table { width: 100%; }
.fill-table th, .fill-table td { overflow: hidden; }
.fill-table select, .fill-table input { max-width: 100%; }
.tbl.batch-tbl td { padding: 3px 4px; }
.tbl.batch-tbl thead th { padding: 7px 4px; }
.col-right .table-foot { padding: 10px 16px; gap: 14px; }
.col-right .table-foot .field { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.col-right .table-foot .field > span { font-size: .6875rem; color: var(--muted); white-space: nowrap; }
.col-right .table-foot .mini-select,
.col-right .table-foot input { height: 28px; font-size: .75rem; }
/* ===========================================================
   柴油管理：左窄右宽
   =========================================================== */
.diesel-split { grid-template-columns: 360px minmax(0, 1fr); }
.diesel-form { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.diesel-fields { flex: 1 1 auto; overflow: auto; padding: 10px; display: grid; gap: 8px; align-content: start; }
.diesel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diesel-fields .field { gap: 3px; }
.diesel-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); display: grid; gap: 6px; }
.dg-title { font-size: .75rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dg-title b { margin-left: auto; font-family: var(--font-num); color: var(--accent-700); font-size: .8125rem; }
.diesel-sub { font-size: .625rem; color: var(--muted); letter-spacing: .06em; }
.diesel-fields .field span { font-size: .6875rem; }
.diesel-fields .field input { height: 30px; font-size: .75rem; }
.diesel-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-2); flex: none; }
.diesel-summary div { display: grid; gap: 2px; }
.diesel-summary span { font-size: .625rem; color: var(--muted); }
.diesel-summary b { font-family: var(--font-num); font-size: .875rem; }
.diesel-summary b.diff.is-warn { color: var(--warn); }
@media (max-width: 1180px) { .diesel-split { grid-template-columns: minmax(0, 1fr); } }
.gas-split { grid-template-columns: 360px minmax(0, 1fr); }
@media (max-width: 1180px) { .gas-split { grid-template-columns: minmax(0, 1fr); } }
/* ===========================================================
   炸药管理：左窄导入、右宽台账
   =========================================================== */
.expl-split { grid-template-columns: 360px minmax(0, 1fr); }
.import-zones { display: grid; gap: 10px; padding: 10px; }
.drop-mini { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; padding: 10px 12px; border: 1.5px dashed var(--line-strong); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out); }
.drop-mini .dm-ico { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.drop-mini .dm-ico svg { width: 20px; height: 20px; }
.drop-mini b { font-size: .8125rem; }
.drop-mini .dm-status { font-size: .6875rem; color: var(--muted); line-height: 1.45; }
.drop-mini:hover { border-color: var(--accent); background: var(--accent-soft-2); }
.drop-mini.is-drag { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }
.expl-tbl thead tr:first-child th { border-bottom: 1px solid var(--line); font-size: .6875rem; padding: 6px 3px; }
.expl-tbl thead tr:nth-child(2) th { font-size: .625rem; padding: 4px 2px; }
.expl-tbl tbody td { font-size: .6875rem; }
.preview-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.preview-wrap .tbl th, .preview-wrap .tbl td { font-size: .6875rem; }
@media (max-width: 1180px) { .expl-split { grid-template-columns: minmax(0, 1fr); } }
/* ===========================================================
   通勤车用油：左窄右侧 8 卡台账
   =========================================================== */
.commute-split { grid-template-columns: 360px minmax(0, 1fr); }
.cm-tbl thead tr:first-child th { font-size: .6875rem; padding: 6px 2px; }
.cm-tbl thead tr:nth-child(2) th { font-size: .625rem; padding: 4px 2px; }
.cm-tbl tbody td { font-size: .6875rem; padding: 4px 3px; }
.cm-form { display: flex; flex-direction: column; min-height: 0; }
.cm-form .form-fields { padding: 10px; gap: 8px; }
.cm-form .field input, .cm-form .field select { height: 30px; font-size: .75rem; }
.cm-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.cm-edit-card { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 6px; background: var(--surface-2); }
.cm-edit-card b { font-size: .75rem; }
.cm-edit-card .field { gap: 2px; }
.cm-edit-card .field input { height: 28px; font-size: .75rem; }
@media (max-width: 1180px) { .commute-split { grid-template-columns: minmax(0, 1fr); } }
/* ===========================================================
   查询中心
   =========================================================== */
.query-page { gap: var(--s5); }
.query-hero { padding: 22px 24px; display: grid; gap: 14px; }
.qh-head h2 { font-size: 1.35rem; letter-spacing: -.02em; }
.qh-head p { font-size: .8125rem; color: var(--muted); margin-top: 3px; }
.query-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 8px 10px 8px 14px; }
.query-search .qs-ico { display: grid; place-items: center; color: var(--muted); }
.query-search .qs-ico svg { width: 18px; height: 18px; }
.query-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.0625rem; height: 38px; color: var(--ink); }
.query-search input:focus { outline: none; }
.query-search input::placeholder { color: var(--muted); }
.query-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .8125rem; color: var(--ink-2); transition: all var(--dur-fast) var(--ease-out); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.query-summary { display: flex; align-items: center; gap: 18px; padding: 0 4px; font-size: .8125rem; color: var(--muted); }
.query-summary b { color: var(--ink); font-family: var(--font-num); }
.query-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.q-groups { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.q-group { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.q-group-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; user-select: none; transition: background var(--dur) var(--ease-out); }
.q-group-head:hover { background: var(--surface-2, #f6f8fb); }
.qg-arrow { width: 14px; color: var(--muted); font-size: 12px; }
.qg-notice { font-weight: 600; letter-spacing: .01em; }
.qg-meta { margin-left: auto; color: var(--muted); font-size: 13px; }
.q-group-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 5px; transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.q-card:hover { border-color: var(--accent); box-shadow: var(--sh-sm); }
.q-card.is-zero { opacity: .62; }
.qc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qc-code { font-family: var(--font-num); font-size: .6875rem; color: var(--muted); letter-spacing: .04em; }
.qc-status { font-size: .625rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.qc-status.is-ok { background: var(--accent-soft); color: var(--accent-700); }
.qc-status.is-low { background: var(--warn-soft); color: var(--warn); }
.qc-status.is-zero { background: var(--surface-2); color: var(--muted); }
.qc-name { font-size: 1rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-spec { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-stock { display: flex; align-items: baseline; gap: 4px; margin-top: 2px; }
.qc-stock b { font-family: var(--font-num); font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; }
.qc-stock span { font-size: .8125rem; color: var(--muted); }
.qc-meta, .qc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: .6875rem; color: var(--muted); }
.qc-meta span, .qc-foot { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===========================================================
   标签打印（50 × 80mm）
   =========================================================== */
.label-page { gap: var(--s5); }
.label-toolbar { padding: 16px 18px; display: grid; gap: 14px; }
.lt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lt-head h2 { font-size: 1.2rem; }
.lt-head p { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.lt-stats { display: flex; gap: 16px; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.lt-stats b { color: var(--ink); font-family: var(--font-num); }
.lt-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.query-search.sm { width: 320px; padding: 4px 8px 4px 12px; border-radius: 10px; }
.query-search.sm input { height: 30px; font-size: .8125rem; }
.label-groups { display: grid; gap: 18px; }
.label-group { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 18px; }
.lg-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); margin-bottom: 14px; }
.lg-title { display: flex; align-items: baseline; gap: 10px; }
.lg-title b { font-size: .9375rem; }
.lg-title span { font-size: .6875rem; color: var(--muted); }
.lg-head .btn { margin-left: auto; }
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(334px, 1fr)); gap: 14px; }
.label-item { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.label-item:hover { border-color: var(--accent); }
.label-item.is-selected { border-color: var(--accent); box-shadow: var(--ring); }
.label-item .label-check { justify-self: end; }

.label-card.l80 { width: 80mm; height: 50mm; padding: 2mm; background: #fff; color: #111;
  border: 1px solid #d8dee9; border-radius: 2mm; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 28mm; grid-template-rows: auto 1fr; column-gap: 2mm; row-gap: 0; }
.label-card.l80 .lc-head { grid-column: 1 / -1; border-bottom: .4mm solid #111; padding-bottom: 1.2mm; min-width: 0; }
.label-card.l80 .lc-name { font-size: 14pt; font-weight: 700; line-height: 1.12; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.label-card.l80 .lc-spec { font-size: 12pt; font-weight: 700; color: #222; margin-top: .4mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-card.l80 .lc-meta { display: flex; flex-direction: column; justify-content: space-between; gap: 0; height: 100%; min-width: 0; }
.label-card.l80 .lc-row { display: block; font-size: 12pt; line-height: 1.18; }
.label-card.l80 .lc-row:last-child { margin-top: 0; min-height: 10mm; display: block; }
.label-card.l80 .lc-row span { color: #111; font-weight: 700; }
.label-card.l80 .lc-row b { font-weight: 700; word-break: break-word; overflow-wrap: anywhere; }
.label-card.l80 .lc-row:first-child b { font-size: 12pt; letter-spacing: .02em; }

.label-card.l80 .lc-qr { display: grid; justify-items: center; align-content: start; gap: .8mm; min-width: 0; }
.label-card.l80 .lc-qr svg { width: 27mm; height: 27mm; display: block; }
.label-card.l80 .lc-qr em { font-style: normal; font-family: var(--font-num); font-size: 7.5pt; font-weight: 600; letter-spacing: .04em; }

@media print {
  .print-page.is-label { margin: 0; padding: 0; }
  .print-labels.is-label { display: block; margin: 0; padding: 0; }
  .print-labels.is-label .label-card.l80 { border: none; border-radius: 0; margin: 0; page-break-inside: avoid; break-inside: avoid; }
  .print-labels.is-label .label-card.l80 + .label-card.l80 { page-break-before: always; break-before: page; }
}
/* ===========================================================
   项目组织
   =========================================================== */
.org-page { gap: var(--s5); }
.org-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s5); align-items: stretch; }
.org-depts { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.dept-list { padding: 8px; display: grid; gap: 3px; overflow: auto; align-content: start; }
.dept-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px;
  padding: 9px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; }
.dept-item:hover { background: var(--surface-2); }
.dept-item.is-active { background: var(--accent-soft); border-color: var(--accent); }
.di-name { font-size: .8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.di-type { font-size: .5625rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; white-space: nowrap; }
.di-count { font-size: .6875rem; color: var(--muted); font-family: var(--font-num); }
.di-acts { display: none; gap: 0; }
.dept-item:hover .di-acts { display: flex; }
.dept-item:hover .di-count { display: none; }
.org-people { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.org-people .fill-table { flex: 1 1 auto; min-height: 0; overflow: auto; }
.org-people .empty { padding: 56px 20px; }
.row-acts { display: flex; align-items: center; gap: 2px; }
.row-acts .icon-btn, .row-acts .btn { flex: none; }
.role-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 16px 12px; }
.role-legend div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.role-legend b { font-size: .75rem; }
.role-legend span { font-size: .6875rem; color: var(--muted); line-height: 1.45; }
@media (max-width: 900px) { .role-legend { grid-template-columns: 1fr; } }
.invite-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-code { font-family: var(--font-num); font-size: 1rem; font-weight: 700; letter-spacing: .18em;
  padding: 7px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-700);
  border: 1px dashed var(--accent); }
/* 导入预览 · 变动明细 */
.merge-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.merge-sum > div { background: var(--surface-2, #f6f8fb); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.merge-sum span { color: var(--muted); font-size: 12px; }
.merge-sum b { font-size: 14px; }
.merge-changes { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 320px; }
.mc-head { position: sticky; top: 0; background: var(--surface-2, #f6f8fb); padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.chg { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.chg:last-child { border-bottom: 0; }
.chg-type { flex: 0 0 auto; font-size: 11px; color: var(--blue, #1a6dff); background: rgba(26,109,255,.1); border-radius: 6px; padding: 1px 6px; }
.chg-field { color: var(--muted); }
.chg-val { margin-left: auto; font-variant-numeric: tabular-nums; }
/* 站点切换（矿山 / 产业园） */
.site-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2, #f1f5fb); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.site-switch button { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.site-switch button.is-active { background: var(--blue, #1a6dff); color: #fff; font-weight: 600; }
.site-switch.auth-site { display: flex; width: fit-content; margin: 18px auto 8px; }
/* 出库单打印 */
.slip-pick { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.slip-group-item { border-bottom: 1px solid var(--line); }
.slip-group-item:last-child { border-bottom: 0; }
.slip-pick-row { display: grid; grid-template-columns: 24px 84px 92px 1fr 1fr 56px 56px; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; }
.slip-expand { border: 0; background: transparent; color: var(--blue, #1a6dff); font-size: 12px; cursor: pointer; padding: 2px; }
.slip-items { background: #fafcff; border-top: 1px dashed var(--line); padding: 6px 10px 10px 34px; }
.slip-mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.slip-mini th, .slip-mini td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.slip-mini th { color: var(--muted); font-weight: 600; }
.slip-mini td.num { text-align: right; }
.slip-pick-row:last-child { border-bottom: 0; }
.slip-pick-row:hover { background: var(--surface-2, #f6f8fb); }
.slip-pick-row .sp-count, .slip-pick-row .sp-amt { color: var(--muted); text-align: right; }

@media print {
  .slip-page { page-break-after: always; break-after: page; }
  .slip-page:last-child { page-break-after: auto; break-after: auto; }
  .slip { width: 100%; table-layout: fixed; border-collapse: collapse; font-family: "SimHei", "黑体", "Microsoft YaHei", sans-serif; font-size: 10pt; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slip td { border: 0.75pt solid #000; padding: 0.4mm 0.7mm; height: 6mm; vertical-align: middle; line-height: 1.1; text-align: center; word-break: break-all; font-weight: 400; }
  .slip .slip-title { border: none; position: relative; text-align: center; font-size: 15pt; font-weight: 700; letter-spacing: .26em; padding: 0 0 1.2mm; }
  .slip .slip-title-text { display: inline-block; }
  .slip .slip-no-inline { position: absolute; right: 0.5mm; top: 0.5mm; font-size: 9pt; font-weight: 400; letter-spacing: 0; }
  .slip .c { text-align: center; }
  .slip .r { text-align: right; }
  .slip .lbl { background: #f4f4f4; white-space: nowrap; }
  .slip .slip-sum { text-align: center; white-space: nowrap; }
  .slip .slip-no { border: none; text-align: right; font-size: 9pt; padding: 0 0 0.8mm; }
  .slip .slip-sign-left { border: none; text-align: left; padding-top: 1.6mm; font-size: 10pt; }
  .slip .slip-sign-right { border: none; text-align: right; padding-top: 1.6mm; font-size: 10pt; }
}
/* 分包领用 · 材料扣款 */
.ded-group { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; overflow: hidden; }
.ded-team { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2, #f6f8fb); cursor: pointer; }
.ded-team b { font-size: 14px; }
.ded-team .ded-count { color: var(--muted); font-size: 12px; }
.ded-arrow { color: var(--muted); font-size: 12px; width: 12px; }
.ded-tbl { width: 100%; }
.ded-tbl th, .ded-tbl td { white-space: nowrap; }
.ded-tbl tbody tr { cursor: pointer; }
.ded-tbl tbody tr:hover { background: var(--surface-2, #f6f8fb); }
.doc-link { color: var(--blue, #1a6dff); text-decoration: none; }
.doc-link:hover { text-decoration: underline; }
.drawer-fields { display: grid; gap: 8px; }
.df-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.df-row span { color: var(--muted); font-size: 13px; }
.df-row b { font-size: 13px; text-align: right; }
.drawer-docs { margin-top: 18px; }
.drawer-docs h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.doc-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.doc-line span { width: 88px; color: var(--muted); font-size: 13px; }
.doc-line a { color: var(--blue, #1a6dff); font-size: 13px; }
/* 出库页 · 悬浮查物资 */
.mat-finder { position: fixed; right: 18px; bottom: 18px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mf-toggle { height: 42px; padding: 0 16px; border: 0; border-radius: 21px; background: var(--blue, #1a6dff); color: #fff; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; box-shadow: 0 10px 24px rgba(26, 109, 255, .35); white-space: nowrap; line-height: 1; flex: 0 0 auto; width: auto; min-width: max-content; }
.mf-toggle:hover { filter: brightness(1.05); }
.mf-toggle svg { width: 18px; height: 18px; flex: 0 0 18px; }
.mf-panel[hidden] { display: none !important; }
.mf-panel { width: 340px; max-height: 62vh; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(20, 40, 80, .18); display: flex; flex-direction: column; overflow: hidden; }
.mf-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mf-head b { font-size: 14px; }
.mf-q { margin: 10px 12px 6px; width: calc(100% - 24px); height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.mf-list { overflow: auto; padding: 2px 8px 10px; }
.mf-item { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; text-align: left; cursor: pointer; }
.mf-item:hover { background: var(--surface-2, #f3f7fd); }
.mf-code { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.mf-main b { display: block; font-size: 13px; }
.mf-main i { font-style: normal; color: var(--muted); font-size: 11px; }
.mf-stock { font-size: 12px; color: var(--blue, #1a6dff); white-space: nowrap; }
.mf-empty { padding: 22px 0; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .mf-panel { width: calc(100vw - 36px); } }
@media print {
  .slip .slip-gap { border: none; height: 8mm; padding: 0; }
}
/* 出库单整单物资编辑 */
.mini-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-items th, .mini-items td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.mini-items th { color: var(--muted); font-weight: 600; font-size: 12px; }
.mini-items td.num { text-align: right; }
/* 工作台预警 */
.warn-list { display: grid; gap: 8px; }
.warn-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.warn-row:hover { background: var(--surface-2, #f6f8fb); }
.warn-row b { font-variant-numeric: tabular-nums; }
/* 柴油过磅单（A4） */
@media print {
  .weigh-page { page-break-after: always; break-after: page; }
  .weigh-page:last-child { page-break-after: auto; break-after: auto; }
  .weigh { width: 100%; border-collapse: collapse; font-family: "SimSun", "宋体", serif; font-size: 11pt; color: #000; }
  .weigh td { border: 1px solid #000; padding: 2.4mm 2mm; height: 11mm; vertical-align: middle; text-align: center; }
  .weigh .w-title { border: none; text-align: center; font-size: 16pt; font-weight: 700; letter-spacing: .08em; padding: 0 0 4mm; }
  .weigh .w-meta { border: none; height: 10mm; text-align: center; }
  .weigh .w-gap td { border: none; height: 5mm; }
  .weigh .w-sign { border: none; padding-top: 6mm; font-size: 11pt; }
  .weigh .w-sign-left { text-align: left; padding-left: 6mm; }
  .weigh .w-sign-right { text-align: right; padding-right: 52mm; }
}
/* 台账内小角标不撑高行 */
.tbl td .badge { height: 16px; line-height: 1; padding: 0 5px; font-size: 10px; vertical-align: 1px; }

/* 备案与版权 */
.auth-legal { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.auth-legal a, .sidebar-legal { color: var(--muted); text-decoration: none; }
.auth-legal a:hover, .sidebar-legal:hover { color: var(--accent-700); text-decoration: underline; }
.sidebar-legal { display: block; padding: 6px 10px 2px; font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 报表中心 KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi-grid .kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; gap: 6px; }

/* 材料核销报表 */
.mr-doc { font-family: SimSun, '宋体', serif; color: #111; }
.mr-title { text-align: center; font-size: 18px; margin: 4px 0 10px; letter-spacing: .08em; }
.mr-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: #555; margin-bottom: 6px; }
.mr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mr-table th, .mr-table td { border: 1px solid #333; padding: 4px 5px; text-align: center; }
.mr-table th { background: #f4f6f8; font-weight: 600; }
.mr-table td.n { text-align: right; }
.mr-table tr.sec td { background: #fafbfc; font-weight: 600; text-align: left; }
.mr-note { font-size: 11px; color: #666; margin-top: 10px; line-height: 1.6; }

