/* 草坪进销台账 — 若依（RuoYi）后台风格 */
:root {
  --primary: #409eff;
  --primary-light: #ecf5ff;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --info: #909399;
  --text: #303133;
  --text-2: #606266;
  --text-3: #909399;
  --border: #dcdfe6;
  --border-light: #ebeef5;
  --bg: #f0f2f5;
  --surface: #fff;
  --sidebar: #304156;
  --sidebar-deep: #2b2f3a;
  --sidebar-hover: #263445;
  --radius: 4px;
  --shadow: 0 1px 4px rgba(0, 21, 41, .08);
  --sidebar-w: 200px;
  --font: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --mono: "SF Mono", Consolas, "Roboto Mono", monospace;

  /* 兼容旧模板里用到的变量名 */
  --muted: #909399;
  --line: #ebeef5;
  --line-strong: #dcdfe6;
  --red: #f56c6c;
  --surface-2: #f5f7fa;
  --green-800: #409eff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: #66b1ff; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
.num, .mono { font-variant-numeric: tabular-nums; }

/* 布局 */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  color: #bfcbd9;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: transform .25s;
}
.brand {
  height: 50px;
  flex: 0 0 50px;
  background: var(--sidebar-deep);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  overflow: hidden;
}
.brand-mark {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 4px;
  background: rgba(64, 158, 255, .16);
  display: grid; place-items: center;
  color: #409eff;
}
.brand-mark .icon { width: 17px; height: 17px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 14px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 10px; color: #7a8ba6; letter-spacing: .08em; }

.ledger-picker { padding: 10px 12px; background: #263445; border-bottom: 1px solid #1f2d3d; }
.ledger-label { display: block; font-size: 11px; color: #7a8ba6; margin-bottom: 6px; letter-spacing: .05em; }
.ledger-form select {
  width: 100%; height: 32px; padding: 0 8px;
  background: #1f2d3d; color: #dfe7f1;
  border: 1px solid #3a4a60; border-radius: 4px; font-size: 13px;
}
.ledger-form select:focus { outline: none; border-color: var(--primary); }
.ledger-manage { display: inline-block; margin-top: 6px; font-size: 12px; color: #409eff; }

.nav { display: flex; flex-direction: column; padding: 6px 0; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 20px;
  color: #bfcbd9; font-size: 14px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.nav-item .icon { width: 18px; height: 18px; flex: 0 0 18px; color: #bfcbd9; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item:hover .icon { color: #fff; }
.nav-item.active {
  background: var(--sidebar-hover);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}
.nav-item.active .icon { color: var(--primary); }

.sidebar-foot { border-top: 1px solid #1f2d3d; padding: 12px 16px; }
.user-chip { display: flex; gap: 10px; align-items: center; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-meta strong { font-size: 13px; color: #fff; font-weight: 500; }
.user-meta small a { color: #7a8ba6; font-size: 12px; }
.user-meta small a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 50px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-title h1 { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.topbar-actions { margin-left: 24px; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.menu-btn { display: none !important; }

.content { padding: 20px; width: 100%; max-width: 1600px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; padding: 0 15px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-family: inherit; font-size: 13px; font-weight: 400;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn .icon { width: 14px; height: 14px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--primary-light); border-color: #c6e2ff; color: var(--primary); }
.btn-soft { background: var(--primary-light); border-color: #b3d8ff; color: var(--primary); }
.btn-soft:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: #fef0f0; border-color: #fbc4c4; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 3px; }
.btn-sm .icon { width: 13px; height: 13px; }
.btn-icon { width: 30px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff;
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
}
.icon-btn .icon { width: 17px; height: 17px; }

/* 卡片 */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head {
  min-height: 50px; display: flex; align-items: center; gap: 10px;
  padding: 0 20px; border-bottom: 1px solid var(--border-light);
}
.card-head h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 13px; color: var(--text-3); }
.stat-value { font-size: 24px; font-weight: 600; color: var(--text); letter-spacing: 0; }
.stat-sub { font-size: 12px; color: var(--text-3); }

/* 筛选栏 */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.filter-bar .field { min-width: 130px; }
.filter-bar .field-grow { flex: 1; min-width: 200px; }
.filter-bar .spacer { flex: 1; }
.quick-range { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 400; }
.field .hint { font-size: 12px; color: var(--text-3); }
input[type="text"], input[type="date"], input[type="number"], input[type="password"], input[type="month"], select, textarea {
  font-family: inherit; font-size: 13px; color: var(--text-2);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 32px;
  outline: none;
  transition: border-color .15s;
  min-width: 0;
}
textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input[readonly] { background: #f5f7fa; color: var(--text-3); }
select { padding-right: 26px; }
input[type="file"] { height: auto; padding: 5px 8px; font-size: 12px; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }

/* 列表表头固定：在表格区域内滚动时 日期/货源/品种 这一行保持不动 */
@media (min-width: 901px) {
  .table-wrap { max-height: calc(100vh - 210px); overflow: auto; }
  table.data thead th {
    position: sticky; top: 0; z-index: 5;
    background: #f5f7fa;
    box-shadow: inset 0 -1px 0 var(--border-light);
  }
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.data th {
  text-align: left; font-weight: 500; font-size: 13px; color: var(--text-3);
  padding: 10px 12px; background: #f5f7fa;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
table.data td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle; color: var(--text-2);
}
table.data tbody tr:hover { background: #f5f7fa; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data .c { text-align: center; }
table.data .nowrap { white-space: nowrap; }
table.data tr.total-row td { background: #f5f7fa; font-weight: 600; border-top: 1px solid var(--border); }
.cell-main { font-weight: 500; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-3); }
.amount { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.amount-neg { color: var(--danger); }
table.data td.amount-neg,
table.data td.amount-neg .cell-sub { color: var(--danger); }
.amount-pos { color: var(--success); }
table.data td.amount-pos { color: var(--success); }

/* 表格合计行（Element / 若依风格） */
table.data tfoot td {
  background: #f5f7fa;
  border-top: 1px solid var(--border-light);
  color: var(--text-2);
  font-weight: 600;
  padding: 10px 12px;
}
table.data tfoot .summary-count { font-weight: 400; color: var(--text-3); margin-left: 6px; }
table.data tfoot .amount { color: var(--text); }
table.data tfoot .cell-sub { font-weight: 400; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { display: inline; }
tr.row-selected td { background: #ecf5ff; }
tr.row-selected:hover td { background: #d9ecff; }

/* 状态标签（Element Tag 风格） */
.pill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-size: 12px; line-height: 20px; font-weight: 400;
  white-space: nowrap;
}
.pill-ok { background: #f0f9eb; border-color: #e1f3d8; color: var(--success); }
.pill-warn { background: #fdf6ec; border-color: #faecd8; color: var(--warning); }
.pill-danger { background: #fef0f0; border-color: #fde2e2; color: var(--danger); }
.pill-muted { background: #f4f4f5; border-color: #e9e9eb; color: var(--info); }
.pill-info { background: #ecf5ff; border-color: #d9ecff; color: var(--primary); }

/* 表单页 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .span-2, .form-grid .span-3 { grid-column: 1 / -1; }
.section-title { font-size: 14px; font-weight: 600; color: var(--text); padding-bottom: 8px; border-bottom: 1px solid var(--border-light); margin: 6px 0 0; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.form-actions .spacer { flex: 1; }
.total-preview {
  background: #f5f7fa; border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 0 14px; height: 32px;
  display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2);
}
.total-preview strong { font-size: 18px; color: var(--primary); font-variant-numeric: tabular-nums; }

/* 提示条 */
.banner {
  border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px;
  font-size: 13px; border: 1px solid transparent; line-height: 1.6;
}
.banner-ok { background: #f0f9eb; color: var(--success); border-color: #e1f3d8; }
.banner-warn { background: #fdf6ec; color: var(--warning); border-color: #faecd8; }
.banner-error { background: #fef0f0; color: var(--danger); border-color: #fde2e2; }

.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty p { margin-bottom: 12px; }

/* 分页 */
.pager { display: flex; gap: 6px; align-items: center; padding: 16px 20px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 28px; height: 28px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius); font-size: 13px; color: var(--text-2);
  border: 1px solid var(--border); background: #fff;
}
.pager a:hover { color: var(--primary); border-color: var(--primary); }
.pager a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-gap { border: 0 !important; color: var(--text-3); }
.pager-total { margin-right: auto; border: 0 !important; background: transparent !important; color: var(--text-3) !important; }
.pager-size { border: 0 !important; background: transparent !important; color: var(--text-3) !important; gap: 4px; margin-left: 8px; }
.pager-size select { height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text-2); font-size: 13px; }

/* 账本编辑开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; vertical-align: middle; flex: 0 0 40px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; cursor: pointer; background: #dcdfe6; border-radius: 20px; transition: background .2s; }
.switch-slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:disabled + .switch-slider { opacity: .6; cursor: not-allowed; }
.switch-form { display: flex; align-items: center; gap: 8px; }
.form-locked input:disabled,
.form-locked select:disabled,
.form-locked textarea:disabled,
.form-locked button:disabled { background: #f5f7fa; color: #a8abb2; border-color: #e4e7ed; cursor: not-allowed; }

/* 可检索下拉框 */
.ss { position: relative; }
.ss-input {
  width: 100%; height: 36px; padding: 0 30px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text); font-size: 14px; outline: none;
}
.ss-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(64, 158, 255, .12); }
.ss-arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #c0c4cc; font-size: 12px; pointer-events: none; }
.ss-panel {
  position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e4e7ed; border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  max-height: 280px; overflow: auto; padding: 4px 0;
}
.ss-list { list-style: none; margin: 0; padding: 0; }
.ss-option { padding: 8px 12px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-option.active, .ss-option:hover { background: #f5f7fa; color: var(--primary); }
.ss-option.selected { color: var(--primary); font-weight: 500; }
.ss-empty { padding: 12px; text-align: center; color: var(--text-3); font-size: 12px; }
.ss-native { position: absolute !important; width: 1px !important; height: 1px !important; left: 0; bottom: 0; opacity: 0; pointer-events: none; }

/* 工作台 */
.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: stretch; }
.dash-grid > .card { margin-top: 0; display: flex; flex-direction: column; }
.dash-grid > .card > .card-head { flex: 0 0 auto; }
.dash-grid > .card > .card-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
.dash-grid .quick-links { height: 100%; align-content: stretch; }
.dash-grid .recent-list { flex: 1 1 auto; }
.chart { display: flex; align-items: flex-end; gap: 20px; height: 190px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bars { display: flex; gap: 6px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart-bar { width: 16px; border-radius: 2px 2px 0 0; min-height: 2px; }
.chart-bar.in { background: var(--primary); }
.chart-bar.out { background: var(--warning); }
.chart-label { font-size: 12px; color: var(--text-3); }
.chart.dense { gap: 6px; }
.chart.dense .chart-col { gap: 4px; }
.chart.dense .chart-bar { width: 9px; }
.chart.dense .chart-label { font-size: 10px; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-3); }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border-light); }
.recent-list li:last-child { border-bottom: 0; }
.recent-list .meta { flex: 1; min-width: 0; }
.recent-list .meta strong { display: block; font-size: 13px; font-weight: 500; color: var(--text); }
.recent-list .meta small { color: var(--text-3); font-size: 12px; }
.recent-list .amt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }

.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border-light); border-radius: var(--radius);
  background: #fff; color: var(--text-2); font-size: 13px;
}
.quick-link:hover { border-color: #b3d8ff; color: var(--primary); background: var(--primary-light); }
.quick-link .icon { width: 17px; height: 17px; color: var(--primary); }

/* 详情页 */
.detail-head {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.detail-head .who { flex: 1; min-width: 220px; }
.detail-head h2 { font-size: 18px; margin-bottom: 6px; color: var(--text); }
.detail-head .sub { color: var(--text-3); font-size: 13px; }
.detail-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.detail-stat { display: flex; flex-direction: column; gap: 2px; }
.detail-stat span { font-size: 12px; color: var(--text-3); }
.detail-stat strong { font-size: 17px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid #e4e7ed; margin-bottom: 16px; overflow-x: auto; background: #fff; border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow); }
.tab { padding: 0 20px; height: 42px; line-height: 42px; font-size: 14px; color: var(--text); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { min-width: 120px; }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: #2d3a4b;
  background-image: radial-gradient(circle at 20% 20%, rgba(64, 158, 255, .18), transparent 42%),
                    radial-gradient(circle at 85% 80%, rgba(64, 158, 255, .12), transparent 40%);
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 6px; padding: 32px 32px 26px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-brand .brand-mark { background: var(--primary-light); color: var(--primary); width: 32px; height: 32px; }
.login-brand strong { font-size: 17px; color: var(--text); }
.login-brand small { display: block; font-size: 11px; color: var(--text-3); letter-spacing: .1em; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; height: 38px; margin-top: 6px; font-size: 14px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-3); }

/* 打印 */
@media print {
  .sidebar, .topbar-actions, .filter-bar, .row-actions, .pager, .menu-btn { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid var(--border-light); }
}

/* 批量选择 */
tr.row-selected td { background: #ecf5ff; }
.picker-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border-light);
  background: #fafafa;
  position: sticky; bottom: 0; z-index: 5;
  box-shadow: 0 -2px 8px rgba(0, 21, 41, .06);
}
.picker-total { font-size: 13px; color: var(--text-3); }
.picker-total strong { display: block; font-size: 22px; color: var(--primary); font-variant-numeric: tabular-nums; }
.picker-bar .field { min-width: 130px; }
.picker-bar .spacer { flex: 1; }
.check-cell { width: 36px; text-align: center; }
.check-cell input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* 已锁定单据 */
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.plain-fieldset[disabled] input,
.plain-fieldset[disabled] select,
.plain-fieldset[disabled] textarea { background: #f5f7fa; color: var(--text-3); cursor: not-allowed; }

/* 附件 */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin-bottom: 16px; }
.file-card { border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; background: #fff; }
.file-preview { display: block; height: 108px; background: #f5f7fa; overflow: hidden; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--primary); gap: 4px; }
.file-doc .icon { width: 30px; height: 30px; }
.file-doc em { font-style: normal; font-size: 11px; letter-spacing: .12em; }
.file-meta { padding: 6px 9px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-ops { display: flex; gap: 12px; padding: 0 9px 8px; font-size: 12px; }

/* 图片悬停放大 */
.zoom-preview {
  position: fixed; z-index: 1200; display: none;
  background: #fff; padding: 4px;
  border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
  pointer-events: none;
}
.zoom-preview.show { display: block; }
.zoom-preview img { display: block; max-width: 520px; max-height: 440px; width: auto; height: auto; border-radius: 2px; }

/* 销售单里点击对应进货进入编辑 */
.purchase-link { display: block; color: inherit; border-radius: 4px; transition: background .15s; }
.purchase-link:hover { background: #f5f7fa; }
.purchase-link:hover .detail-stat strong { color: var(--primary); }

/* 文件预览（图片 / PDF / Word） */
.doc-preview-modal { position: fixed; inset: 0; z-index: 1300; display: none; }
.doc-preview-modal.show { display: block; }
.doc-preview-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.doc-preview-box {
  position: relative; width: min(1000px, 94vw); height: 90vh; margin: 4vh auto 0;
  background: #fff; border-radius: 4px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
  display: flex; flex-direction: column;
}
.doc-preview-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: #fafafa; border-bottom: 1px solid var(--border-light);
}
.doc-preview-title { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
.doc-preview-head .spacer { flex: 1; }
.doc-preview-body { flex: 1; overflow: auto; background: #f0f2f5; padding: 16px; }
.doc-preview-status { display: none; text-align: center; color: var(--text-3); font-size: 13px; padding: 50px 20px; line-height: 1.8; }
.doc-preview-image { display: block; max-width: 100%; max-height: calc(90vh - 150px); margin: 0 auto; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.doc-preview-pdf { width: 100%; height: calc(90vh - 150px); border: 0; background: #fff; display: block; }
.doc-preview-render .docx-wrapper { background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.doc-preview-render .docx-wrapper > section.docx { box-shadow: 0 1px 4px rgba(0, 0, 0, .15); margin: 0; background: #fff; }

/* 招标进度 */
.progress { height: 6px; min-width: 90px; background: #ebeef5; border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-mask.show { display: flex; }
.modal-box { width: 440px; max-width: calc(100vw - 32px); background: #fff; border-radius: 4px; box-shadow: 0 2px 12px rgba(0, 0, 0, .18); overflow: hidden; }
.modal-head { padding: 16px 20px; font-size: 16px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border-light); }
.modal-body { padding: 20px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border-light); }

/* 轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: rgba(48, 49, 51, .92); color: #fff;
  padding: 10px 18px; border-radius: var(--radius); font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 1100;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* 详情两栏 */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.report-stack { display: grid; gap: 16px; }

/* 响应式 */
@media (max-width: 1080px) {
  .dash-grid, .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 16px rgba(0, 0, 0, .2);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; }
  .menu-btn { display: grid !important; }
  .topbar { height: auto; min-height: 50px; padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .topbar-actions { margin-left: auto; }
  .content { padding: 12px; }
  .topbar-title h1 { font-size: 15px; }
  .today { display: none; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .detail-head { padding: 16px; }
  .detail-stats { gap: 20px; }
  .stat-value { font-size: 20px; }
  table.data { font-size: 13px; width: max-content; min-width: 100%; }
  table.data th, table.data td { padding: 9px 10px; white-space: nowrap; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .picker-bar { position: static; box-shadow: none; }
}
@media (max-width: 560px) {
  .col-qty, .col-amt, .col-recv, .col-price { display: none !important; }
  .topbar-actions { margin-left: auto; gap: 6px; }
  .topbar-actions .btn.has-icon { width: 32px; padding: 0; }
  .topbar-actions .btn.has-icon .btn-label { display: none; }
  .topbar-actions .btn { font-size: 12px; padding: 0 9px; }
  .toast { left: 12px; right: 12px; bottom: 12px; }
  .picker-bar { flex-direction: column; align-items: stretch; }
  .picker-bar .field { min-width: 0; }
}

/* sidebar submenu flyout */
.nav { overflow: visible; }
.nav-group { position: relative; }
.nav-parent {
  width: 100%; background: transparent; border: 0; border-left: 3px solid transparent;
  font: inherit; font-size: 14px; text-align: left; cursor: default;
}
.nav-caret {
  margin-left: auto; color: #8fa0b3; font-size: 16px; line-height: 1;
  transform: none; transition: color .15s;
}
.nav-group:hover .nav-caret, .nav-group:focus-within .nav-caret { color: #fff; transform: none; }
.nav-sub {
  position: absolute; left: 100%; top: 0; z-index: 60;
  display: none; min-width: 160px; padding: 6px 0;
  background: var(--sidebar-deep);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  border-radius: 0 6px 6px 0;
}
.nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub { display: block; }
.nav-sub-item {
  display: block; padding: 10px 18px;
  color: #aebdcc; font-size: 13px; white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.nav-sub-item:hover { background: var(--sidebar-hover); color: #fff; }

/* ECharts monthly trend */
.echarts-chart { width: 100%; height: 280px; min-height: 220px; }
@media (max-width: 860px) {
  .echarts-chart { height: 240px; }
}
