/* ============================================================
   旅行社ERP · 组件样式（卡片 / 按钮 / 表格 / 表单 / 分页等）
   ============================================================ */

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.card-head h2 { margin-bottom: 2px; }
.card-head p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }

.card-form { max-width: 720px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all .18s ease;
}
.btn:hover { border-color: var(--brand-purple-light); color: var(--brand-purple); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn svg { width: 15px; height: 15px; }

.btn.primary {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-magenta));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(107, 45, 179, .28);
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; box-shadow: 0 6px 18px rgba(107, 45, 179, .34); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }

.btn.danger {
  background: var(--status-danger-bg);
  border-color: rgba(220, 38, 38, .3);
  color: var(--status-danger);
}
.btn.danger:hover { background: var(--status-danger); border-color: var(--status-danger); color: #fff; }

.btn-lg { padding: 11px 22px; font-size: var(--fs-md); }
.btn-block { width: 100%; }

button.primary, button.danger { border: none; }
button.danger { background: var(--status-danger-bg); color: var(--status-danger); }
button.danger:hover { background: var(--status-danger); color: #fff; }

.row-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.row-actions .btn, .row-actions button { padding: 5px 12px; font-size: var(--fs-xs); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }

.inline-form { display: inline-flex; margin: 0; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin-bottom: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

table.table, .table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 640px;
}

.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table-wrap th { background: var(--surface-soft); color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tbody tr { transition: background .12s ease; }
.table-wrap tbody tr:hover { background: var(--brand-purple-fade-5); }
/* 冻结行（系统回款）：蓝色底纹标出"这笔钱还在深圳总部账上，没到湖北分公司" */
.table-wrap tbody tr.row-frozen { background: #eaf4fd; }
.table-wrap tbody tr.row-frozen:hover { background: #dcecfb; }
.table-wrap tbody tr.row-frozen td:first-child { box-shadow: inset 3px 0 0 var(--status-info); }
.table-wrap td input, .table-wrap td select { padding: 5px 8px; font-size: var(--fs-sm); min-width: 90px; }
/* 财务费用项：命中当前筛选月份/年份的团期行高亮 */
.table-wrap tbody tr.is-current-month { background: var(--brand-purple-fade-5); }
.table-wrap tbody tr.is-current-month:hover { background: var(--brand-purple-fade-10); }
.table-wrap tbody tr.is-current-month td:first-child { box-shadow: inset 3px 0 0 var(--brand-purple, var(--brand-teal, #441088)); }

.mini-select { width: auto; min-width: 96px; margin-top: 4px; padding: 3px 8px; font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.tag.ok { background: var(--status-ok-bg); color: var(--status-ok); }
.tag.warn { background: var(--status-warn-bg); color: var(--status-warn); }
.tag.danger { background: var(--status-danger-bg); color: var(--status-danger); }
/* 冻结标记（系统回款：钱在深圳总部账上）用蓝色，与质保金的橙色冻结区分开 */
.tag.info { background: var(--status-info-bg); color: var(--status-info); border: 1px solid rgba(2, 132, 199, .3); }

/* 冻结资金说明块（浅蓝）与流水行内的「冻结 / 已解冻」小字 */
.frozen-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--status-info-bg);
  border: 1px solid rgba(2, 132, 199, .25);
  color: var(--status-info);
  font-size: var(--fs-xs);
  line-height: 1.75;
}
.frozen-split { margin-top: 3px; font-size: var(--fs-xs); color: var(--status-info); line-height: 1.5; }
.frozen-split b { color: var(--status-info); }

/* ---------- 通知/提示 ---------- */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-4);
}
.notice.ok { background: var(--status-ok-bg); color: var(--status-ok); border: 1px solid rgba(22, 163, 74, .25); }
.notice.err, .notice.danger { background: var(--status-danger-bg); color: var(--status-danger); border: 1px solid rgba(220, 38, 38, .25); }
.notice.warn { background: var(--status-warn-bg); color: var(--status-warn); border: 1px solid rgba(217, 119, 6, .25); }

/* ---------- 游客图片（缩略图 / 悬浮放大 / 弹窗） ---------- */
.upload-form { display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-4); flex-wrap: wrap; }
.upload-label { display: flex; align-items: center; gap: var(--space-2); padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-soft); width: 100%; cursor: pointer; transition: border-color .15s ease; }
.upload-label:hover { border-color: var(--brand-teal); }
.upload-label input[type="file"] { width: auto; padding: 0; border: 0; background: transparent; cursor: pointer; }
.upload-tip { color: var(--text-secondary); font-size: var(--fs-sm); }
.upload-label input[type="file"]:disabled + .upload-tip { color: var(--text-muted); }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.photo-cell {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
  aspect-ratio: 1 / 1;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: zoom-in;
}
.photo-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.photo-cell:hover img { transform: scale(1.06); }
.photo-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, .75));
  color: #fff; padding: 16px 8px 6px; font-size: var(--fs-xs);
  display: flex; flex-direction: column; gap: 2px; pointer-events: none;
}
.photo-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-size { opacity: .85; font-variant-numeric: tabular-nums; }
.photo-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 4px; opacity: 0; transition: opacity .15s ease;
}
.photo-cell:hover .photo-actions, .photo-cell:focus-within .photo-actions { opacity: 1; }
.photo-actions .icon-btn {
  width: 28px; height: 28px; background: rgba(15, 23, 42, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
}
.photo-actions .icon-btn:hover { background: rgba(15, 23, 42, .8); }
.photo-actions .icon-btn.danger:hover { background: var(--status-danger); border-color: var(--status-danger); }
.photo-loading {
  position: absolute; inset: 0; display: flex !important; align-items: center; justify-content: center; gap: 6px;
  background: rgba(15, 23, 42, .55); color: #fff; font-size: var(--fs-sm); font-weight: 500;
}
.photo-cell.is-loading { pointer-events: none; opacity: .7; }
.spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 灯箱 / 大图查看 */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .92); display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 32px;
  animation: lb-fade .15s ease;
}
.lightbox[hidden] { display: none; }
.lightbox > img { max-width: min(96vw, 1400px); max-height: 78vh; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.6); border-radius: var(--radius); }
.lightbox-caption { margin-top: 12px; color: #cbd5e1; font-size: var(--fs-sm); text-align: center; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(15, 23, 42, .6); color: #fff; font-size: 22px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(15, 23, 42, .85); }
.lightbox-dl { margin-top: 14px; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 网格表单 ---------- */
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.grid-form label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form small { font-weight: 400; }

/* ---------- 建议下拉 ---------- */
.suggest-wrap { position: relative; }
.suggest-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1150;   /* 高于弹窗遮罩（1100），弹窗内联想列表不被遮挡 */
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.suggest-item { padding: 8px 14px; font-size: var(--fs-sm); cursor: pointer; border-bottom: 1px solid var(--border); }
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--brand-purple-fade-5); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: var(--space-2) 0; }
.pager a {
  min-width: 32px;
  padding: 5px 10px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}
.pager a:hover { border-color: var(--brand-teal); color: var(--brand-teal); text-decoration: none; }
.pager a.active { background: var(--brand-teal); border-color: var(--brand-teal); color: #fff; font-weight: 600; }

/* ---------- 统计卡片 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  flex: none;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.teal { background: var(--brand-purple-fade-10); color: var(--brand-purple); }
.stat-icon.blue { background: var(--brand-magenta-fade-10); color: var(--brand-magenta); }
.stat-icon.sky { background: var(--brand-gold-fade-10); color: #b48806; }
.stat-icon.amber { background: var(--brand-gold-fade-10); color: #b48806; }
.stat-icon.info { background: var(--status-info-bg); color: var(--status-info); }

.stat-body { min-width: 0; }
.stat-value { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-muted); font-size: var(--fs-sm); }

/* 可点击统计卡（数据总览跳转对应列表） */
a.stat-card { color: inherit; text-decoration: none; }
a.stat-card .stat-label { transition: color .15s ease; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-purple-light); }
a.stat-card:hover .stat-label { color: var(--brand-purple); }

/* ---------- 折叠成本明细 ---------- */
details.cost-details { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); background: var(--surface-soft); }
details.cost-details summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--text-secondary); }
details.cost-details summary:hover { color: var(--brand-teal); }
details.cost-details[open] { background: var(--surface); }
details.cost-details .cost-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-2); align-items: end; margin-bottom: var(--space-2); }
details.cost-details .cost-row label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 2px; }
details.cost-details .cost-row input { padding: 5px 8px; font-size: var(--fs-sm); }

/* ---------- 权限网格 ---------- */
.perm-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }
.perm-cell { text-align: center; }

/* ---------- 团期/订单块 ---------- */
.tour-block, .order-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
}
.tour-title, .order-title { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.tour-title h3, .order-title h3 { margin: 0; font-size: var(--fs-md); }
.tour-title .muted, .order-title .muted { font-size: var(--fs-sm); }

.tour-table { margin-top: var(--space-3); }

/* ---------- 账单 Excel 表：合计区 ---------- */
.bill-sheet-subtotal td { background: var(--surface-soft); font-size: var(--fs-sm); }
.bill-sheet-total td { background: var(--brand-purple-fade-5); font-size: var(--fs-base); }
/* 计调成本表尾合计行（金额/已付/未付，随编辑实时重算） */
.cost-sheet-total td { background: var(--brand-purple-fade-5); font-size: var(--fs-base); }
/* 资金流水：三个账的独立明细按钮（点按钮只看该账流水，互不混在一起）
   2026-10-13 一轮：放大字号/内边距 + 每个账一个专属色（不再全是白、分不清），并加 emoji 前缀
   2026-10-13 二轮：再放大一轮——18px 标签 / 21px 金额 / 26px emoji / 2px 描边 / 大圆角，
     选中态实色填充 + 重阴影，视觉权重拉到页面最强，一眼能看到三个账各多少钱 */
.cf-tabs { display: flex; gap: 12px; flex-wrap: wrap; margin: var(--space-2) 0 var(--space-4); }
.cf-tab {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 30px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.cf-tab .cf-emoji { font-size: 26px; line-height: 1; }
.cf-tab b { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 800; font-size: 21px; }
.cf-tab:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
/* 默认态：每个账一个浅色调（紫 / 蓝 / 琥珀），避免"全是白、看不出区别" */
.cf-tab[data-acc="hq"]  { border-color: var(--brand-purple-light); background: var(--brand-purple-fade-10); color: var(--brand-purple); }
.cf-tab[data-acc="xm"]  { border-color: rgba(2,132,199,.42);       background: rgba(2,132,199,.08);        color: #0c6da3; }
.cf-tab[data-acc="bzj"] { border-color: rgba(217,119,6,.45);       background: rgba(217,119,6,.10);        color: #b45309; }
.cf-tab[data-acc="hq"]  b { color: var(--brand-purple); }
.cf-tab[data-acc="xm"]  b { color: #0c6da3; }
.cf-tab[data-acc="bzj"] b { color: #b45309; }
/* 选中态：实色填充，最醒目（更高优先级，hover 不覆盖） */
.cf-tab.active[data-acc="hq"]  { background: var(--brand-purple); border-color: var(--brand-purple); color: #fff; box-shadow: 0 8px 24px rgba(68,16,136,.32); }
.cf-tab.active[data-acc="xm"]  { background: var(--status-info);  border-color: var(--status-info);  color: #fff; box-shadow: 0 8px 24px rgba(2,132,199,.34); }
.cf-tab.active[data-acc="bzj"] { background: var(--status-warn);  border-color: var(--status-warn);  color: #fff; box-shadow: 0 8px 24px rgba(217,119,6,.34); }
.cf-tab.active, .cf-tab.active b, .cf-tab.active .cf-emoji { color: #fff; }
#bill_sheet td input { min-width: 0; width: 100%; }
/* 高亮型按钮（添加费用行）：淡紫底 + 紫描边，视觉强于普通按钮 */
.btn-accent {
  background: var(--brand-purple-fade-10);
  border-color: var(--brand-purple-light);
  color: var(--brand-purple);
  font-weight: 600;
  padding: 8px 18px;
}
.btn-accent:hover { background: var(--brand-purple-fade-15); border-color: var(--brand-purple); box-shadow: var(--shadow-sm); }

/* ---------- 团期工作台（小强式）：工具栏/密表/右侧抽屉 ---------- */
/* 侧边栏折叠为小图标条（桌面端） */
@media (min-width: 1024px) {
  body.sidebar-collapsed .app-shell { grid-template-columns: 64px 1fr; }
  body.sidebar-collapsed .sidebar { width: 64px; }
  body.sidebar-collapsed .sidebar-brand { padding: var(--space-3) 6px; justify-content: center; }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .sidebar-user,
  body.sidebar-collapsed .logout-btn,
  body.sidebar-collapsed .nav-label { display: none; }
  body.sidebar-collapsed .sidebar-nav { padding: var(--space-2) 6px; }
  body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; }
}
/* 抽屉常驻时内容区左移让位（宽屏）；窄屏抽屉覆盖显示 */
@media (min-width: 1200px) {
  .tg-page { padding-right: 360px; }
}
/* 团期页卡片放大（抽屉占位后尽量利用宽度） */
.content:has(.tg-page) { max-width: none; }
.tg-page .card { max-width: none; }
/* 团期工作台工具栏 */
.tg-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-3); }
.tg-toolbar-gap { flex: 1 1 12px; }
.tg-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tg-filter-input { width: 110px; }
.tg-filter .dp-text { width: 120px; }
.tg-menu-wrap { position: relative; }
.tg-menu { position: absolute; top: 100%; left: 0; z-index: 1150; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 130px; padding: 4px 0; }
.tg-menu a { display: block; padding: 8px 14px; font-size: var(--fs-sm); color: var(--text-secondary); text-decoration: none; }
.tg-menu a:hover { background: var(--brand-purple-fade-5); color: var(--brand-purple); }
.tg-row { cursor: pointer; }
.tg-row.is-selected { background: var(--brand-purple-fade-5); }
.team-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 372px; background: var(--surface); box-shadow: -8px 0 30px rgba(68, 16, 136, .12); z-index: 1050; padding: var(--space-4); overflow-y: auto; }
.team-drawer[hidden] { display: none !important; }
.td-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.td-head b { font-size: 18px; }
/* 图标菜单：一行 5 个，紧凑排布，避免抽屉过长（2026-10-12 放大：小屏笔记本可读） */
.td-icons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: var(--space-4); }
.td-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text-secondary); text-decoration: none; cursor: pointer; font-family: inherit; font-size: 12px; transition: all .15s ease; }
.td-icon:hover { border-color: var(--brand-purple-light); color: var(--brand-purple); box-shadow: var(--shadow-sm); }
/* 抽屉主操作（下单）：品牌渐变高亮，一眼可见 */
.td-icon-primary {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-magenta));
  color: #fff; border-color: transparent; font-weight: 600;
  box-shadow: 0 2px 8px rgba(68, 16, 136, .35);
}
.td-icon-primary:hover { color: #fff; filter: brightness(1.1); border-color: transparent; }
.td-icon svg { width: 22px; height: 22px; }
.td-icon span { line-height: 1.2; white-space: nowrap; }
.td-info div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.td-info span { color: var(--text-muted); flex: none; }
.td-info b { font-weight: 600; text-align: right; }
.td-foot { margin-top: var(--space-4); font-size: 14px; }
.td-icon-dev { opacity: .45; }
.td-icon-dev:hover { border-style: dashed; }

/* ---------- 顶部横向导航（小强式工作区切换） ---------- */
.topnav { display: flex; gap: 6px; margin-left: var(--space-3); overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
/* 顶部工作区导航：放大 + 每个 tab 加 emoji（2026-10-13），未选中为浅紫药丸、选中为实色渐变 */
.topnav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap; text-decoration: none;
  font-size: 16px; line-height: 1.1;
  background: rgba(68, 16, 136, .06);
  border: 1.5px solid rgba(68, 16, 136, .14);
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.topnav .nav-emoji { font-size: 19px; line-height: 1; }
.topnav a:hover { background: rgba(68, 16, 136, .12); color: var(--brand-purple); border-color: var(--brand-purple-light); transform: translateY(-1px); }
.topnav a.is-active { background: linear-gradient(135deg, var(--brand-purple), var(--brand-magenta)); color: #fff; border-color: transparent; box-shadow: 0 3px 12px rgba(68, 16, 136, .4); }

/* ---------- 产品线路：卡片墙 ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-4); }
.prod-card { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); background: var(--surface); }
.prod-card.prod-selectable { cursor: pointer; transition: all .15s ease; }
.prod-card.prod-selectable:hover { border-color: var(--brand-purple-light); box-shadow: var(--shadow-sm); }
.prod-card.is-selected { border-color: var(--brand-purple); background: var(--brand-purple-fade-5); box-shadow: var(--shadow-sm); }
.prod-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prod-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-meta { color: var(--text-muted); font-size: var(--fs-xs); margin: 6px 0; }
.prod-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.prod-actions .btn { padding: 6px 14px; font-size: var(--fs-sm); }
.prod-edit { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
.prod-edit label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.prod-edit input, .prod-edit textarea { margin-top: 2px; }

/* ---------- 模板库：Tab 分类 + 卡片墙 ---------- */
.tpl-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.tpl-tab { padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); cursor: pointer; font-size: var(--fs-sm); color: var(--text-secondary); transition: all .15s ease; }
.tpl-tab:hover { border-color: var(--brand-purple-light); color: var(--brand-purple); }
.tpl-tab.is-active { background: var(--brand-purple); color: #fff; border-color: var(--brand-purple); font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-4); }
.tpl-card { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.tpl-preview { height: 110px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f1eef6 0 25%, #fff 0 50%) 0 0/16px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.tpl-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tpl-name { font-weight: 600; font-size: var(--fs-sm); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* ---------- 小强式快捷图标栏（订单管理顶部） ---------- */
.quick-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-secondary); text-decoration: none; cursor: pointer;
  font-family: inherit; font-size: var(--fs-sm); transition: all .15s ease;
}
.quick-item:hover { border-color: var(--brand-purple-light); color: var(--brand-purple); box-shadow: var(--shadow-sm); text-decoration: none; }
.quick-item svg { width: 22px; height: 22px; }
.quick-item b { font-weight: 600; }
.quick-item.is-active { border-color: var(--brand-purple); background: var(--brand-purple-fade-5); color: var(--brand-purple); font-weight: 600; }

/* ---------- 弹窗（小强式：列表常驻，录入用弹窗） ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(36, 29, 51, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 26px 16px;
  overflow-y: auto;
}
/* hidden 属性必须压过上面的 display:flex，否则弹窗会常驻显示 */
.modal-mask[hidden] { display: none !important; }

/* 弹窗尺寸档位：统一在这里控制宽度，各页不再写 inline max-width
   （inline max-width 会盖掉这里的档位，改尺寸时容易漏改某一页） */
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  /* ⚠️ 这个 width:100% 不能删：下面开了 container-type，会带来 inline-size
     尺寸包含，元素不能再靠 stretch 撑开；没有定宽就会塌成 padding 宽 */
  width: 100%;
  max-width: min(820px, 94vw);
  padding: var(--space-6);
  /* 容器上下文：让弹窗内的表单控件能按"弹窗自身宽度"自适应放大 */
  container-type: inline-size;
}
.modal.modal-sm { max-width: min(560px, 94vw); }
.modal.modal-lg { max-width: min(1060px, 94vw); }
.modal.modal-xl { max-width: min(1400px, 94vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.modal-head h3 { margin: 0; font-size: var(--fs-md); }
.modal-close { border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 2px 6px; }
.modal-close:hover { color: var(--status-danger); }

/* ---------- 弹窗 / 弹窗内嵌页：表单控件随容器宽度自适应放大 ----------
   弹窗变大后如果控件还是原来的小尺寸，就会出现"大框里塞一堆小控件 + 大片留白"。
   这里用容器查询单位 cqi（= 容器宽度的 1%）让内边距、字号、行列间距、多行框高度
   跟着容器一起长：窄弹窗≈原尺寸，宽弹窗明显更舒展。
   不支持容器查询的浏览器走上面那组固定回退值，不会出问题。 */
.modal, .modal-page {
  --ctl-pad-y:  8px;
  --ctl-pad-x:  12px;
  --ctl-font:   var(--fs-base);
  --ctl-label:  var(--fs-sm);
  --ctl-gap-y:  var(--space-3);
  --ctl-gap-x:  var(--space-4);
  --ctl-area-h: 72px;
}
@supports (container-type: inline-size) {
  .modal {
    --ctl-pad-y:  clamp(9px,  1.1cqi, 15px);
    --ctl-pad-x:  clamp(12px, 1.5cqi, 20px);
    --ctl-font:   clamp(14px, 1.25cqi, 16px);
    --ctl-label:  clamp(13px, 1.1cqi, 15px);
    --ctl-gap-y:  clamp(12px, 1.5cqi, 20px);
    --ctl-gap-x:  clamp(16px, 2cqi,   28px);
    --ctl-area-h: clamp(72px, 9cqi,  140px);
  }
}
/* 弹窗内嵌页（iframe 里的独立页）改用 vw：iframe 里 1vw 就是弹窗宽度的 1%，
   效果与容器查询等价。
   ⚠️ 千万别在这里写 container-type —— .modal-page 加在 main.content 上，而它是
   .app-shell 网格的 grid item（width:auto）。container-type 带来的 inline-size
   尺寸包含会让它不再 stretch，整块塌成"只剩 padding 宽"（实测 30px），
   里面的表单被挤成一条竖线（2026-09-17 踩过，截图可见）。 */
.modal-page {
  --ctl-pad-y:  clamp(9px,  1.1vw, 15px);
  --ctl-pad-x:  clamp(12px, 1.5vw, 20px);
  --ctl-font:   clamp(14px, 1.25vw, 16px);
  --ctl-label:  clamp(13px, 1.1vw, 15px);
  --ctl-gap-y:  clamp(12px, 1.5vw, 20px);
  --ctl-gap-x:  clamp(16px, 2vw,   28px);
  --ctl-area-h: clamp(72px, 9vw,  140px);
}

/* 注意：.pr-in 是「付款申请单」一比一复刻纸质单的格子输入框，
   必须排除，否则会撑大格子、破坏与纸质原件的对应关系 */
.modal input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.pr-in),
.modal select:not(.pr-in),
.modal textarea:not(.pr-in),
.modal-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.pr-in),
.modal-page select:not(.pr-in),
.modal-page textarea:not(.pr-in) {
  padding: var(--ctl-pad-y) var(--ctl-pad-x);
  font-size: var(--ctl-font);
}
.modal textarea:not(.pr-in),
.modal-page textarea:not(.pr-in) { min-height: var(--ctl-area-h); }
.modal .grid-form,
.modal-page .grid-form { gap: var(--ctl-gap-y) var(--ctl-gap-x); }
.modal .grid-form label,
.modal-page .grid-form label { font-size: var(--ctl-label); }
/* 表单区的提交按钮跟着一起长；表格行内的 .row-actions 小按钮不在此列，保持紧凑 */
.modal .grid-form .btn,
.modal-page .grid-form .btn {
  padding: var(--ctl-pad-y) var(--ctl-pad-x);
  font-size: var(--ctl-font);
}

/* ---------- 权限网格局（账号权限页：按模块分组） ---------- */
.perm-line { display: block; font-weight: 500; }
.perm-group { margin-bottom: 6px; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group b { display: inline-block; min-width: 34px; margin-right: 6px; color: var(--text-secondary); }
.perm-group label { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; font-weight: 400; white-space: nowrap; }

/* ---------- 账单模块 ---------- */
.bill-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
}
.bill-meta > div { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.bill-meta .muted { font-size: var(--fs-xs); }

.card-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-4) 0 var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.card-sub h3 { margin: 0; font-size: var(--fs-md); }
.card-sub p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.card-sub.card-sub-tight { margin-top: var(--space-3); margin-bottom: var(--space-2); }
.card-sub.card-sub-tight p { color: var(--text-muted); font-size: var(--fs-xs); }
.bill-subtotal { font-size: var(--fs-sm); color: var(--text-secondary); }
.bill-subtotal b { color: var(--text-primary); }

.bill-rows { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.bill-row {
  display: grid;
  /* 列序：行号 / 费用名称 / 数量 / 单价 / 金额 / 说明 / 操作 */
  grid-template-columns: 36px minmax(140px, 1.4fr) 86px 108px 108px minmax(140px, 1fr) auto auto;
  gap: var(--space-2);
  align-items: center;
}
.bill-row input { padding: 6px 8px; font-size: var(--fs-sm); }
.bill-row .btn { white-space: nowrap; }
.bill-row-add { margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
/* 新增行内的提示文字单独占满整行（横跨所有列），靠右灰色小字，不再挤在最后格 */
.bill-row .row-hint {
  grid-column: 1 / -1;
  text-align: right;
  font-size: var(--fs-xs);
  margin-top: 4px;
}

.bill-total-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.bill-sum { font-size: var(--fs-sm); color: var(--text-secondary); }
.bill-sum b { font-size: var(--fs-md); color: var(--text-primary); }

.bill-total-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--primary-soft, rgba(37, 99, 235, .06));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.bill-total-bar b { font-size: var(--fs-md); color: var(--text-primary); }
.bill-total-bar .total b { font-size: var(--fs-lg); color: var(--primary, #2563eb); }
/* 利润汇总里的「毛利」使用中等强调色，避免与最终利润抢戏 */
.bill-total-bar .gross b { font-size: var(--fs-md); }
/* 财务费用汇总条目的数字颜色 */
.bill-total-bar .gross b.profit-positive,
.bill-total-bar .total b.profit-positive { color: var(--trend-up) !important; }
.bill-total-bar .gross b.profit-negative,
.bill-total-bar .total b.profit-negative { color: var(--trend-down) !important; }
@media (max-width: 900px) {
  .bill-row { grid-template-columns: repeat(2, 1fr); }
  .bill-row .btn { grid-column: span 1; }
}

/* ---------- 账单明细：列头 / 行序号 / Toast ---------- */
.bill-row.bill-row-head {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  background: var(--surface-2, rgba(0,0,0,.02));
  border-radius: var(--radius);
  padding: 8px 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.bill-row.bill-row-head > span { padding: 0 4px; }
.bill-row.bill-row-head .hd-no { color: var(--text-muted, #94a3b8); text-align: center; }
.bill-row.bill-row-head .hd-act { grid-column: 7 / 9; text-align: center; }
.bill-row-head .hd-qty,
.bill-row-head .hd-price,
.bill-row-head .hd-amount { text-align: right; }

.bill-rows .bill-row { padding: 6px 0; border-top: 1px dashed var(--border); }
.bill-rows .bill-row:first-child { border-top: none; }
.bill-row-add { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px dashed var(--border); }

.bill-row .row-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-2, #f1f5f9);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* 新增行的行号：从高亮蓝改为淡灰虚线圆，弱化视觉权重，仅作占位标识 */
.bill-row .row-no-new {
  background: transparent;
  color: var(--text-muted, #94a3b8);
  border: 1px dashed var(--border-strong, #cbd5e1);
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
}

.bill-row .row-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bill-row .row-name-wrap .it-type { flex: 1; min-width: 0; }
.bill-row .row-tag {
  font-size: var(--fs-xs);
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.bill-row .it-qty,
.bill-row .it-price,
.bill-row .it-amount { text-align: right; font-variant-numeric: tabular-nums; }

.bill-row .row-hint { font-size: var(--fs-xs); color: var(--text-muted, #94a3b8); }

/* 现有明细行的删除按钮：避免单元格被挤换行 */
.bill-row .btn { padding: 4px 10px; font-size: var(--fs-sm); }

/* ---------- Toast（轻提示，不阻塞后续操作） ---------- */
.notice-toast {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 1200;
  min-width: 240px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.12));
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.notice-toast.show { opacity: 1; transform: translateX(0); pointer-events: auto; }
.notice-toast.hide { opacity: 0; transform: translateX(24px); }
.notice-toast.ok {
  background: var(--status-ok-bg, #ecfdf5);
  color: var(--status-ok, #15803d);
  border: 1px solid rgba(22,163,74,.3);
}
.notice-toast.error {
  background: var(--status-danger-bg, #fef2f2);
  color: var(--status-danger, #b91c1c);
  border: 1px solid rgba(220,38,38,.3);
}
.notice-toast .toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex: 0 0 22px;
}
.notice-toast.ok .toast-icon { background: rgba(22,163,74,.18); color: var(--status-ok, #15803d); }
.notice-toast.error .toast-icon { background: rgba(220,38,38,.18); color: var(--status-danger, #b91c1c); }
/* ---------- 日期快捷选择（原生日历覆盖层） ---------- */
/* 文本输入保留 YYYY-MM / YYYY-MM-DD 手输能力；右侧日历图标下垫一层透明
   input[type=date]，点击即调用浏览器原生月份+日期选择器，选完回填文本框。 */
.dp-wrap { position: relative; display: block; }
.dp-wrap .dp-text { width: 100%; padding-right: 38px; }
.dp-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.dp-btn:hover { color: var(--brand-ocean); background: var(--surface-soft); }
.dp-btn svg { pointer-events: none; }
.dp-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.dp-native::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}
.dp-native::-webkit-inner-spin-button,
.dp-native::-webkit-clear-button { display: none; }

/* 快捷查询行 */
.dp-quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: 2px;
}
.dp-quick-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.dp-quick .btn { padding: 5px 12px; font-size: var(--fs-xs); }
.dp-quick .dp-quick-gap { flex: 1 1 12px; }

/* ---------- 最近订单区块（订单查询页） ---------- */
.recent-box {
  margin: 0 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  overflow: hidden;
}
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.recent-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--brand-ocean);
}
.recent-head .muted { font-size: var(--fs-xs); }
.recent-box .table-wrap { border: 0; border-radius: 0; }
.recent-table td, .recent-table th { font-size: var(--fs-sm); }
.recent-table tbody tr:hover { background: var(--surface); }

/* ---------- 日期输入（点击弹出年月面板；无日历图标） ---------- */
.dp-wrap { position: relative; display: block; }
.dp-wrap .dp-text {
  cursor: pointer;
  background: var(--surface);
  caret-color: transparent;          /* 禁止文本光标闪烁 */
  user-select: none;
}
.dp-wrap .dp-text.is-dp-filled { color: var(--text); }
.dp-wrap .dp-text::placeholder { color: var(--text-muted); }

/* 弹层面板 */
.dp-panel {
  position: absolute;
  z-index: 1150;   /* 高于弹窗遮罩（1100），保证弹窗内选日期时面板在最上层 */
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  font-size: var(--fs-sm);
  color: var(--text);
  animation: dp-pop .12s ease;
}
.dp-panel[hidden] { display: none; }
@keyframes dp-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dp-panel-head {
  display: flex; align-items: center; gap: 4px; margin-bottom: 8px;
}
.dp-nav {
  width: 28px; height: 28px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; line-height: 1; color: var(--text-secondary);
}
.dp-nav:hover { border-color: var(--brand-teal); color: var(--brand-teal); }
.dp-cur { flex: 1; text-align: center; font-weight: 600; color: var(--text); cursor: pointer; padding: 4px 0; border-radius: var(--radius-sm); }
.dp-cur:hover { background: var(--surface-soft); }
.dp-close { width: 28px; height: 28px; }
.dp-panel-foot {
  display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.dp-panel-foot .btn { padding: 4px 12px; font-size: var(--fs-xs); }

/* 月份网格（12 格） */
.dp-month-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.dp-month-cell {
  height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font-weight: 500; transition: all .15s ease;
}
.dp-month-cell:hover { border-color: var(--brand-teal); color: var(--brand-teal); background: var(--brand-purple-fade-5); }
.dp-month-cell.is-cur-month { background: var(--brand-purple-fade-10); color: var(--brand-teal); border-color: var(--brand-teal); }
.dp-month-cell .dp-month-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* 日期网格（7×6） */
.dp-week-row, .dp-day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-week-cell { text-align: center; font-size: var(--fs-xs); color: var(--text-muted); padding: 4px 0; font-weight: 500; }
.dp-day-cell {
  height: 32px; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
  border: 1px solid transparent; background: transparent; color: var(--text);
}
.dp-day-cell:hover:not(.is-disabled) { background: var(--brand-purple-fade-10); color: var(--brand-teal); }
.dp-day-cell.is-disabled { color: var(--text-muted); cursor: not-allowed; opacity: .35; }
.dp-day-cell.is-other { color: var(--text-muted); }
.dp-day-cell.is-today { border-color: var(--brand-ocean); }
.dp-day-cell.is-selected {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-ocean)); color: #fff; border-color: transparent;
  font-weight: 600;
}
.dp-day-cell.is-weekend { color: var(--status-danger); }
.dp-day-cell.is-weekend.is-selected { color: #fff; }

/* 快捷查询按钮的 active 态（被点击 / 当前筛选命中） */
.dp-range.is-active {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-ocean));
  color: #fff; border-color: transparent; font-weight: 600;
}

/* 提交表单时的整表单弱化反馈（让用户感知到「查询中」） */
form.is-loading { opacity: .7; pointer-events: none; }

/* 订单凭证（水单/确认件）网格 */
.voucher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.voucher-card { background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.voucher-thumb { display: block; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.voucher-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.voucher-meta { display: flex; flex-direction: column; gap: 2px; }
.voucher-type { font-weight: 600; color: var(--brand-purple); font-size: var(--fs-sm); }
.voucher-meta .muted { font-size: var(--fs-xs); }

/* ---------- 收客进度条（团期管理人数列） ---------- */
.pax-progress { height: 5px; border-radius: var(--radius-full); background: var(--bg-soft); margin-top: 4px; overflow: hidden; }
.pax-progress span { display: block; height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--brand-purple-light), var(--brand-magenta)); }

/* 水单/凭证悬浮预览（app.js 在 body 末尾创建，悬停缩略图时跟随光标显示大图） */
.voucher-hover-preview {
  position: fixed;
  z-index: 999;
  max-width: min(460px, 44vw);
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.voucher-hover-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(72vh - 16px);
  border-radius: var(--radius-sm);
}

/* ===== 对标同天下（阶段1）新增 ===== */

/* 订单五态中的弱化态（已清位 / 已撤销）与占位单标签 */
.tag.muted {
  background: var(--surface-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

/* 批量建团：星期多选 */
.wd-picker { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 6px; }
.wd-item {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
}
.wd-item:hover { border-color: var(--brand-purple); color: var(--brand-purple); }
.wd-item input { margin: 0; }
#bt_dates { min-height: 150px; }

/* 团期预警：距出团 X 天且收客率低于阈值时团号标红 */
.group-no-warn { color: var(--status-danger, #dc2626); font-weight: 600; }

/* 回收站列表 */
.trash-box { border-top: 1px dashed var(--border); margin-top: var(--space-4); padding-top: var(--space-3); }
.trash-box .muted { font-size: var(--fs-xs); }

/* 侧栏分组标题 */
.sidebar .nav-group { list-style: none; padding: 14px 18px 4px; color: var(--text-muted, #999); font-size: 11px; letter-spacing: 1.5px; pointer-events: none; }
.sidebar .nav-group span { border-top: 1px dashed var(--border, #eee); padding-top: 8px; display: block; }

/* 顶部下拉菜单 */
.topnav-item { position: relative; }
.topnav-item .topnav-dd-menu { position: absolute; top: 100%; right: 0; min-width: 140px; background: #fff; border: 1px solid var(--border, #eee); border-radius: var(--radius, 8px); box-shadow: 0 6px 20px rgba(0,0,0,.08); padding: 6px 0; z-index: 100; }
.topnav-item .topnav-dd-menu a { display: block; padding: 8px 16px; color: var(--text, #333); font-size: var(--fs-sm, 14px); }
.topnav-item .topnav-dd-menu a:hover { background: var(--surface-soft, #f5f5f5); }
.topnav-item .topnav-dd-menu a.is-active { color: var(--brand-purple, #441088); font-weight: 600; }
.topnav-item .is-dd > a { display: inline-flex; gap: 4px; }

/* 顶部下拉菜单 */
.topnav-item { position: relative; }
.topnav-item .topnav-dd-menu { position: absolute; top: 100%; right: 0; min-width: 140px; background: #fff; border: 1px solid var(--border, #eee); border-radius: var(--radius, 8px); box-shadow: 0 6px 20px rgba(0,0,0,.08); padding: 6px 0; z-index: 100; }
.topnav-item .topnav-dd-menu a { display: block; padding: 8px 16px; color: var(--text, #333); font-size: var(--fs-sm, 14px); }
.topnav-item .topnav-dd-menu a:hover { background: var(--surface-soft, #f5f5f5); }
.topnav-item .topnav-dd-menu a.is-active { color: var(--brand-purple, #441088); font-weight: 600; }
.topnav-item .is-dd > a { display: inline-flex; gap: 4px; }

/* 顶部下拉：常驻平铺（不再隐藏）—— 让"系统"tab 下的三个按钮直接显示 */
.topnav-item.is-dd { display: inline-flex; align-items: center; gap: 4px; }
.topnav-item.is-dd .topnav-dd-menu {
  display: inline-flex !important;
  position: static !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 2px;
}
.topnav-item.is-dd .topnav-dd-menu a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius, 6px);
  font-size: var(--fs-sm, 13px);
  color: var(--text-secondary, #555);
  transition: all .15s ease;
}
.topnav-item.is-dd .topnav-dd-menu a:hover { background: var(--surface-soft, rgba(68,16,136,.06)); color: var(--brand-purple, #441088); }
.topnav-item.is-dd .topnav-dd-menu a.is-active { background: var(--brand-purple, #441088); color: #fff; font-weight: 600; }

/* 系统设置三页共用小按钮条（常驻） */
.system-tabs { display: inline-flex; gap: 8px; margin-bottom: var(--space-3, 12px); }
.system-tabs .system-tab {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--border, #eee); background: var(--surface, #fff);
  color: var(--text-secondary, #555); font-size: var(--fs-sm, 13px);
  text-decoration: none; transition: all .15s ease;
}
.system-tabs .system-tab:hover { border-color: var(--brand-purple, #441088); color: var(--brand-purple, #441088); }
.system-tabs .system-tab.is-active {
  background: var(--brand-purple, #441088); color: #fff;
  border-color: var(--brand-purple, #441088); font-weight: 600;
}

/* 侧栏 brand 收起按钮（logo 右侧） */
.sidebar-brand { position: relative; padding-right: 40px; }
.brand-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; border-radius: 6px; color: rgba(255,255,255,.85); cursor: pointer; padding: 5px; display: inline-flex; align-items: center; }
.brand-toggle:hover { background: rgba(255,255,255,.25); color: #fff; }
body.sidebar-collapsed .sidebar-brand { padding-right: var(--space-3, 12px); }
body.sidebar-collapsed .brand-toggle { position: static; transform: none; }
body.sidebar-collapsed .brand-toggle svg { transform: rotate(180deg); }
.brand-toggle svg { transition: transform .2s ease; }
/* 宽屏：顶栏三条杠不显示（展开/收起入口 = 侧栏 logo 旁的三角按钮） */
@media (min-width: 1024px) { .menu-toggle { display: none !important; } }
