:root {
  --brand: #1f3864;
  --brand-2: #2f5597;
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #1f2937;
  --muted: #6b7280;
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef2f9 0%, #f7f9fc 60%, #e9eef7 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(31, 56, 100, .12);
  padding: 32px 30px 26px;
}
.login-card h1 { font-size: 19px; margin: 0 0 4px; color: var(--brand); }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: linear-gradient(180deg, #1f4a3e 0%, #17392f 100%);
  color: #d7e8e0;
  padding: 14px 0 40px;
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(0,0,0,.18);
}
.sidebar .brand {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 8px;
}
.sidebar .brand small { display: block; color: #a6c6b9; font-weight: 400; font-size: 11px; margin-top: 2px; }
.sidebar .group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 14.5px;
  font-weight: 400;
  color: #cfe3da;
  padding: 12px 18px 5px;
  letter-spacing: .02em;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.sidebar .group-title:hover { color: #ffffff; }
.sidebar .group-title .grp-ico {
  flex: 0 0 auto;
  width: 18px;
  font-size: 14.5px;
  line-height: 1;
  text-align: center;
  opacity: .82;
  transition: opacity .16s ease;
}
.sidebar .group-title:hover .grp-ico { opacity: 1; }
.sidebar .group-title .grp-label { flex: 1 1 auto; }
.sidebar .group-title .chev { flex: 0 0 auto; transition: transform .16s ease; opacity: .75; }
.sidebar .nav-group.is-collapsed .group-title .chev { transform: rotate(-90deg); }
.sidebar .nav-group.is-collapsed .nav-items { display: none; }
.sidebar .nav-group.is-current .group-title { color: #ffffff; }
.sidebar .nav-group.is-current .group-title .grp-ico { opacity: 1; }
.sidebar .nav-group + .nav-group { margin-top: 8px; }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d7e8e0;
  padding: 9px 18px 9px 24px;
  font-size: 14px;
  line-height: 1.5;
  border-left: 3px solid transparent;
}
.sidebar a .nav-ico {
  flex: 0 0 auto;
  width: 18px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  opacity: .8;
  transition: opacity .16s ease;
}
.sidebar a .nav-text { flex: 1 1 auto; }
.sidebar a:hover .nav-ico, .sidebar a.active .nav-ico { opacity: 1; }
.sidebar a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.sidebar a.active {
  background: #2f6fe0;
  color: #fff;
  border-left-color: #9dc0ff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}
.sidebar a.active:hover { background: #3b7ae8; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 54px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .unit { font-weight: 600; color: var(--brand); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; }
.content { padding: 18px; flex: 1; }

.banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 9px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
}

/* ---------------- 组件 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card > header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card > header h2 { font-size: 15px; margin: 0; color: var(--brand); }
.card > header .spacer { flex: 1; }
.card > .body { padding: 14px 16px; }
.card > .body.tight { padding: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: var(--brand); }
.btn.danger { color: var(--err); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
.btn.warn { color: #b45309; border-color: #fcd34d; }
.btn.warn:hover { background: #fffbeb; border-color: #fbbf24; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* 查询条要求一行显示：不换行，空间不够时横向滚动而不是折行 */
.row.nowrap-form { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.row.nowrap-form > * { flex: 0 0 auto; }
/* 输入框默认 width:100%（见下方通用规则），在一行式查询条里要收回自动宽度 */
.row.nowrap-form > input:not([style*="width"]),
.row.nowrap-form > select:not([style*="width"]) { width: auto; min-width: 130px; }
.row.nowrap-form > input[type=month] { min-width: 150px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #374151; margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=month], input[type=file], select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(47,85,151,.25);
  border-color: var(--brand-2);
}
.inline-form { display: inline; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: middle;
}
table.grid thead th {
  background: #f1f5fb;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.grid tbody tr:hover { background: #f8fafc; }
/* 隔行底色：只在明细类长表用，默认白色保留一行白 */
table.grid.zebra tbody tr:nth-child(even) td { background: #eef3fb; }
table.grid.zebra tbody tr:nth-child(even):hover td { background: #e6edf9; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 数字列里的输入框也跟着右对齐，表头与内容才对得上 */
table.grid td.num input, table.grid td.num select { text-align: right; }
table.grid td.num input[type="text"] { text-align: right; }
table.grid tfoot td { font-weight: 600; background: #f8fafc; }
.table-scroll { overflow: auto; max-height: 66vh; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.badge.blue { background: #e0e7ff; color: #3730a3; }
.badge.green { background: #dcfce7; color: var(--ok); }
.badge.amber { background: #fef3c7; color: var(--warn); }
.badge.red { background: #fee2e2; color: var(--err); }
.badge.gray { background: #e5e7eb; color: #475569; }

.flash { padding: 9px 12px; border-radius: var(--radius); margin-bottom: 12px; font-size: 13px; }
.flash.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.flash.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.flash.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 22px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.pager-sum { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pager-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager a, .pager span:not(.pager-sum) {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  color: var(--text);
  background: #fff;
}
.pager a:hover { border-color: var(--brand-2); color: var(--brand-2); }
.pager .cur { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }

/* 打印：表册一律 A4 横向（10.3） */
@media print {
  .sidebar, .topbar, .no-print, .pager { display: none !important; }
  .content { padding: 0; }
  .card { border: none; box-shadow: none; }
  @page { size: A4 landscape; margin: 12mm; }
  table.grid th, table.grid td { border: 1px solid #333; }
}

/* ------------------------------------------------------------------ 表册纸张 */
.sheet {
  background: #fff;
  border: 1px solid #dfe3ea;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  padding: 18px 22px 22px;
  margin: 0 auto 22px;
  max-width: 1120px;
  position: relative;
}
.sheet-seal {
  position: absolute;
  left: 26px;
  top: 12px;
  width: 40mm;
  height: 40mm;
  opacity: .82;
  mix-blend-mode: multiply;
  transform: rotate(-9deg);
  pointer-events: none;
  z-index: 30;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.sheet-head { text-align: center; border-bottom: 2px solid #1f3864; padding-bottom: 6px; margin-bottom: 6px; }
.sheet-head h1 { font-size: 15px; margin: 0 0 1px; font-weight: 700; letter-spacing: .5px; }
.sheet-head h2 { font-size: 19px; margin: 0 0 2px; color: #1f3864; letter-spacing: 2px; }
.sheet-meta { display: flex; justify-content: space-between; font-size: 11px; color: #667085; }
.sheet-sub { font-size: 11px; color: #667085; margin-top: 4px; }
.sheet-grid { width: 100%; font-size: 12px; }
.sheet-grid th { background: #eef1f7; font-weight: 600; }
.sheet-grid td, .sheet-grid th { padding: 4px 7px; }
.sheet-grid tfoot td { font-weight: 700; background: #f7f9fc; }
.sheet-note { font-size: 11px; color: #667085; margin: 8px 0 0; line-height: 1.6; white-space: pre-line; }
/* 22 列的表册（学生就餐结算表）要更紧凑 */
.sheet-grid.sheet-tight { font-size: 8.2px; }
.sheet-grid.sheet-tight th,
.sheet-grid.sheet-tight td { padding: 3px 3px; line-height: 1.35; border-right: 1px solid #e3e8f0; }
.sheet-grid.sheet-tight th,
  .sheet-grid.sheet-tight th.num { text-align: center; vertical-align: middle; white-space: nowrap; }
  .sheet-grid.sheet-tight td { vertical-align: middle; }
  .sheet-grid.sheet-tight td.ctr { text-align: center; white-space: nowrap; }
  .sheet-grid.sheet-tight td:nth-child(2) { white-space: nowrap; line-height: 1.2; padding-left: 2px; padding-right: 2px; }
.sheet-grid.sheet-tight th:last-child,
.sheet-grid.sheet-tight td:last-child { border-right: 0; }
.sheet-grid.sheet-tight td.num { white-space: nowrap; }
/* RPT-08：内外框一律实线（原按需只有竖线） */
.sheet-grid.sheet-solid { border-collapse: collapse; border: 1px solid #333; }
.sheet-grid.sheet-solid th,
.sheet-grid.sheet-solid td { border: 1px solid #333; }
.sheet-grid.sheet-solid th { white-space: normal; }
/* 每行留出签字高度（班主任签字列是手签行） */
.sheet-grid.sheet-solid tbody td { height: 30px; }
.sheet-grid.sheet-solid thead th { height: 26px; }
.sheet-grid.sheet-solid thead tr:first-child th { height: 34px; }
.sign-row { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 12px; margin-top: 26px; font-size: 12px; }
.sign-item { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; gap: 4px; white-space: nowrap; }
/* 签字栏只留白，不画下划线（2026-11-20 按用户要求取消横线） */
.sign-line { display: inline-block; flex: 1 1 auto; min-width: 24px; width: auto; border-bottom: 0; height: 16px; }
table.grid.compact td, table.grid.compact th { padding: 3px 5px; font-size: 11px; }
.print-body { background: #fff; padding: 0 10px 30px; }
/* ---------------------------------------------------------------- 模态框 */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.modal-box { position: relative; width: min(560px, 94vw); max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(15, 23, 42, .28);
  animation: modal-in .16s ease-out; }
@keyframes modal-in { from { transform: translateY(8px); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #e6eaf2; }
.modal-head h3 { margin: 0; font-size: 15px; color: #1f3864; }
.modal-x { border: 0; background: none; font-size: 22px; line-height: 1; color: #8a94a6; cursor: pointer; padding: 0 4px; }
.modal-x:hover { color: #374151; }
.modal-body { padding: 16px 18px 2px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px;
  background: #f7f9fc; border-top: 1px solid #e6eaf2; }
.modal-error { margin: 0 0 12px; padding: 8px 10px; border-radius: 6px;
  background: #fdecec; color: #a52121; font-size: 13px; border-left: 3px solid #e05252; }
@media print { .modal { display: none !important; } }

/* 明细页「返回一览」：比普通次按钮更醒目 */
.btn.back-link { padding: 9px 18px; font-size: 14px; font-weight: 600; letter-spacing: .3px; box-shadow: 0 1px 3px rgba(15,23,42,.18); }
.btn.back-link:hover { box-shadow: 0 2px 6px rgba(15,23,42,.22); }

/* ---------- 往来单位一览：排序表头 / 名称提示 / 停用行 ---------- */
a.sort-head { color: inherit; text-decoration: none; white-space: nowrap; }
a.sort-head:hover { color: #1f3864; }
.sort-idle { color: #c3ccda; font-size: 11px; margin-left: 2px; }
.sort-on { color: #1f3864; font-size: 11px; margin-left: 2px; font-weight: 700; }

/* 单位名称：悬停显示联系人与电话（原生提示按 \n 分两行） */
.cp-name { cursor: help; border-bottom: 1px dotted #c7d0de; }

/* 已停用：留在表里，但视觉上退后一层 */
tr.row-stopped td { color: #7b8698; background: #f7f8fb; }
tr.row-stopped strong { font-weight: 500; }

.btn.success { background: #12795b; border-color: #12795b; color: #fff; }
.btn.success:hover { background: #0f664b; border-color: #0f664b; }

/* ---- 食材出入库：入库/出库标签页 + 紧凑网格 ---- */
.tabs{display:flex;gap:8px;margin:14px 0 12px;flex-wrap:wrap}
.tab{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 18px;border:1px solid #d5dbe6;border-radius:10px;background:#f7f9fc;color:#334155;cursor:pointer;font-size:14px;font-weight:600;line-height:1.25}
.tab .tab-sub{font-size:11.5px;font-weight:400;color:#7b8794}
.tab:hover{background:#eef2f8}
.tab.active{color:#fff;border-color:transparent}
.tab.tab-in.active{background:#1f3864;box-shadow:0 2px 6px rgba(31,56,100,.28)}
.tab.tab-in.active .tab-sub{color:#c9d6ef}
.tab.tab-out.active{background:#b45309;box-shadow:0 2px 6px rgba(180,83,9,.28)}
.tab.tab-out.active .tab-sub{color:#fbe3c4}
.tab.tab-out{border-color:#f0d3ae;background:#fffaf3}
.kind-panel{display:none}
.kind-panel.is-active{display:block}

.tip-line{margin:0 0 12px;padding:9px 12px;border-left:4px solid #1f3864;background:#eef3fb;border-radius:0 8px 8px 0;font-size:13px;color:#243b63}
.tip-line kbd{display:inline-block;padding:1px 6px;border:1px solid #b9c4d8;border-bottom-width:2px;border-radius:4px;background:#fff;font-family:inherit;font-size:12px}

table.grid.grid-input{table-layout:fixed;width:auto;min-width:620px;max-width:100%}
table.grid.grid-input th,table.grid.grid-input td{padding:5px 8px}
table.grid.grid-input td.cat{white-space:nowrap}
table.grid.grid-input input.money{width:100%;text-align:right;padding:5px 8px;border:1px solid #d5dbe6;border-radius:6px;background:#fff;font-variant-numeric:tabular-nums}
table.grid.grid-input input.money:focus{outline:none;border-color:#1f3864;box-shadow:0 0 0 3px rgba(31,56,100,.12)}
table.grid.grid-input input.money[readonly]{background:#f4f6fa;color:#475569}
table.grid.grid-input tfoot th{background:#e8eef8}

details.inline-details{margin-top:4px}
details.inline-details>summary{cursor:pointer;color:#1f3864;font-size:13.5px;font-weight:600;padding:4px 0}
details.inline-details>summary:hover{text-decoration:underline}
/* ---- 物品分类页 ---- */
table.grid.cat-table{table-layout:fixed}
table.grid.cat-table td.actions{white-space:nowrap}
table.grid.cat-table td.actions .inline-form{display:inline-block;margin-left:6px}
.cat-name{font-weight:600}
.cat-code{font-size:12px;color:#64748b}
table.grid.cat-table .badge{margin-left:6px}

/* ===== 右上角身份菜单（头像下拉） ===== */
.user-menu{position:relative}
.um-trigger{display:flex;align-items:center;gap:9px;padding:3px 10px 3px 4px;border:1px solid #dbe2ee;border-radius:999px;background:#fff;cursor:pointer;transition:box-shadow .15s,border-color .15s}
.um-trigger:hover{border-color:#b9c6de;box-shadow:0 2px 8px rgba(15,23,42,.08)}
.um-trigger:focus-visible{outline:2px solid #93b4ea;outline-offset:2px}
.avatar{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:#1f3864;color:#fff;font-weight:600;font-size:13px;line-height:1;flex:0 0 auto}
.avatar.lg{width:44px;height:44px;font-size:18px}
.avatar.xl{width:64px;height:64px;font-size:26px}
.av-accountant{background:#2563eb}
.av-cashier{background:#b45309}
.av-canteen_admin{background:#0f766e}
.av-unit_admin{background:#4f46e5}
.av-bureau_leader{background:#7c3aed}
.av-super_admin{background:#111827}
.av-default{background:#64748b}
.um-id{display:flex;flex-direction:column;align-items:flex-start;line-height:1.2}
.um-name{font-size:13px;font-weight:600;color:#1f2937}
.um-role{font-size:11px;color:#7b8794}
.um-caret{font-size:10px;color:#94a3b8}
.um-drop{position:absolute;right:0;top:calc(100% + 8px);width:272px;padding:6px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 16px 40px rgba(15,23,42,.18);z-index:80}
.um-drop[hidden]{display:none}
.um-head{display:flex;gap:10px;padding:10px 10px 12px}
.um-head-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.um-head-text strong{font-size:14px;color:#0f172a}
.um-unit{font-size:11.5px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.um-label{font-size:11px;color:#94a3b8;padding:2px 10px 4px}
.um-sep{height:1px;background:#eef2f7;margin:6px 4px}
.um-item{display:block;width:100%;padding:8px 10px;border:0;border-radius:8px;background:transparent;text-align:left;font-size:13px;color:#334155;cursor:pointer;text-decoration:none}
.um-item:hover{background:#f1f5f9;text-decoration:none}
.um-item.on{color:#1f3864;font-weight:600}
.um-item.danger{color:#dc2626}
.um-item.danger:hover{background:#fef2f2}
.um-posts{margin:0}
.um-exit{margin:0}

/* ===== 个人中心 ===== */
.page-head{margin-bottom:14px}
.page-head h1{font-size:19px;margin:0 0 6px;color:#0f172a}
.page-head p{margin:0;font-size:13px}
.split-2{display:grid;grid-template-columns:minmax(320px,430px) 1fr;gap:16px;align-items:start}
@media (max-width:980px){.split-2{grid-template-columns:1fr}}
.profile-card{display:flex;align-items:center;gap:12px;padding:4px 0 14px;margin-bottom:10px;border-bottom:1px dashed #e5eaf2}
.profile-main{display:flex;flex-direction:column;gap:2px}
.profile-main strong{font-size:16px;color:#0f172a}
table.kv{width:100%;border-collapse:collapse;font-size:13px}
table.kv th{width:82px;padding:6px 0;text-align:left;font-weight:400;color:#64748b;vertical-align:top}
table.kv td{padding:6px 0;color:#1f2937}
.tabs-inline{margin:0}
.tabs-inline .tab{padding:6px 14px;font-size:13px;border-radius:8px}
.tabs-inline .tab.active{background:#1f3864}
.form{max-width:540px}
.form-actions{display:flex;gap:8px;margin-top:16px}
/* 学生餐次录入：紧凑靠左，输入框不出上下箭头（避免滚轮误改成小数） */
table.grid.mealstu{table-layout:fixed;width:100%;max-width:1120px}
table.grid.mealstu th,table.grid.mealstu td{padding:6px 8px;text-align:center;vertical-align:middle;line-height:1.35}
table.grid.mealstu thead th{height:34px;font-weight:600;white-space:normal}
table.grid.mealstu thead tr:first-child th{height:38px}
table.grid.mealstu td input{text-align:center}
table.grid.mealstu tfoot td{font-weight:600}
table.grid.sheet-center th,table.grid.sheet-center td{text-align:center;vertical-align:middle}
/* 陪餐/搭伙：窄表靠左，不要拉满整屏；表头与数据居中 */
table.grid.other-grid{table-layout:fixed;width:auto;min-width:560px}
table.grid.other-grid th,table.grid.other-grid td{
  padding:5px 10px;text-align:center;vertical-align:middle;white-space:nowrap;
}
table.grid.other-grid td:first-child,table.grid.other-grid th:first-child{text-align:left}
table.grid.other-grid td input{width:76px;text-align:center;font-variant-numeric:tabular-nums}
table.grid.other-grid tfoot td{font-weight:600}
table.grid.charge-grid{table-layout:fixed;width:100%;max-width:1080px;min-width:760px}
table.grid.charge-grid th,table.grid.charge-grid td{padding:4px 8px}
table.grid.charge-grid td.num input{width:100%;padding:4px 6px;border:1px solid #d5dbe6;border-radius:6px;text-align:right;font-variant-numeric:tabular-nums}
table.grid.charge-grid td.num input:focus{outline:none;border-color:#1f3864;box-shadow:0 0 0 3px rgba(31,56,100,.12)}
table.grid.charge-grid td.num input:disabled{background:#f4f6fa;color:#475569}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
input[type=number]{-moz-appearance:textfield;appearance:textfield}

/* 批量填天数：班级多选清单 */
.days-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:6px 12px;max-height:260px;overflow:auto;border:1px solid var(--line,#e5e7eb);border-radius:8px;padding:10px 12px;background:#fbfcfe}
.days-pick-item{display:flex;align-items:center;gap:6px;font-size:13px;line-height:1.5}
.days-pick-item input[type=checkbox]{margin:0}
.days-pick-item .small{color:#6b7280}

/* 人工与加工成本 · 分摊测算 */
.labor-panel{padding:12px 16px 14px}
.labor-params{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px 16px}
.labor-params .lf{display:flex;flex-direction:column;gap:4px;min-width:0}
.labor-params .lf>span{font-size:12px;color:#475569;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.labor-params .lf>span b{color:#1f3864;font-weight:700}
.labor-params .lf input{width:100%;text-align:right;font-variant-numeric:tabular-nums}
.labor-flags{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;margin-top:12px;padding-top:10px;border-top:1px dashed #e2e8f0}
.labor-flags .flags-label{font-size:12px;color:#64748b}
.lf-check{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#0f172a}
.lf-check b{color:#1f3864}
.lf-check input[type=checkbox]{margin:0}
.labor-duo{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.06fr);gap:14px;align-items:start}
.labor-duo>.card{margin:0}
.labor-duo>.card>header h2{font-size:14px}
.labor-duo>.card>.body{padding:10px 14px 12px}
.labor-duo table.grid{font-size:12.5px}
.labor-duo table.grid th,.labor-duo table.grid td{padding:5px 8px}
.labor-duo table.grid tbody tr:nth-child(even){background:#fafbfd}
.labor-duo table.grid tfoot td{background:#f1f5f9}
@media (max-width:1180px){.labor-duo{grid-template-columns:1fr}}

/* ---------------- 年月选择器（app.js 自动增强 <input type="month">） ---------------- */
/*
 * 原生月份框不挪出屏幕，而是透明地盖在「日历」按钮上：
 * 点按钮其实是点到了原生 input，浏览器自己弹出年月面板（showPicker 对隐藏元素会抛错）。
 */
.ym-native {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  left: auto !important;
  width: 30px !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.ym-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  height: 32px;
  padding: 0 6px 0 8px;
  border: 1px solid var(--line, #d8dee8);
  border-radius: 8px;
  background: #fff;
  vertical-align: middle;
}
.ym-pick:focus-within {
  border-color: #2f6fe0;
  box-shadow: 0 0 0 3px rgba(47, 111, 224, .12);
}
.ym-pick input[type="text"] {
  width: 42px;
  height: 28px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text, #1f2937);
}
.ym-pick input.ym-m { width: 26px; }
.ym-pick .ym-t { font-size: 12px; color: #6b7280; }
.ym-pick .ym-cal {
  margin-left: 2px;
  padding: 2px 3px;
  border: 0;
  background: none;
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
  pointer-events: none; /* 实际点击由覆盖在上面的原生月份框接收 */
}
.ym-pick .ym-cal:hover { color: #2f6fe0; }

/* ---------- 全局水印（系统设置 → 全局水印；表册打印模板不套主布局，故打印不带印） ---------- */
.wm-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
}
.wm-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: var(--wm-size, 14px);
  color: var(--wm-color, #0f172a);
  opacity: var(--wm-op, .08);
  transform: rotate(var(--wm-rot, -20deg));
  pointer-events: none;
  letter-spacing: .02em;
}

/* ---------- 左侧菜单最后一行：退出登录 ---------- */
.sidebar .nav-exit {
  margin-top: 10px;
  padding: 10px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar .nav-exit-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: #ffd9d9;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.sidebar .nav-exit-btn:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.sidebar .nav-exit-btn .nav-ico { width: 18px; text-align: center; }
