/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font: 12px/1.6 "Microsoft YaHei", "SimSun", sans-serif;
  color: #333; background: #f2f4f4;
  min-width: 1280px;
}
a { color: #1874cd; text-decoration: none; }
a:hover { text-decoration: underline; }
input, button, select { font: 12px "Microsoft YaHei", sans-serif; outline: none; }
input { border: 1px solid #8ea8d2; padding: 2px 4px; background: #fff; }
input:focus { border-color: #1874cd; }

/* ============ 顶部 Logo 区 ============ */
.top-strip {
  background: #fff; height: 46px; display: flex;
  align-items: center; justify-content: space-between; padding: 0 18px 0 14px;
}
.logo {
  font: italic 900 30px/1 "Arial Black", Arial, sans-serif;
  color: #17529b; letter-spacing: 1px; user-select: none;
}
.logo-green { color: #6cbf3a; }
.logo-r { font-size: 10px; vertical-align: top; color: #888; font-style: normal; }
.top-links a { color: #1874cd; margin-left: 14px; }
.top-arrow { color: #1874cd; margin-left: 8px; }

/* ============ 主菜单 ============ */
.main-menu {
  background: linear-gradient(#2e8bd0, #1a72bc);
  height: 38px; display: flex; padding-left: 20px;
}
.menu-item {
  position: relative; color: #fff; font-weight: bold;
  padding: 0 26px; display: flex; align-items: center; cursor: pointer;
}
.menu-item:hover { background: #0f5fa0; }
.menu-caret { font-size: 10px; margin-left: 6px; opacity: .85; }
.dropdown {
  display: none; position: absolute; top: 38px; left: 0; min-width: 180px;
  background: #fff; border: 1px solid #1a72bc; box-shadow: 0 3px 8px rgba(0,0,0,.25);
  z-index: 60; padding: 2px 0;
}
.menu-item:hover .dropdown { display: block; }
.dropdown a { display: block; padding: 6px 16px; color: #14467e; white-space: nowrap; }
.dropdown a:hover { background: #dcecfa; text-decoration: none; }

/* ============ 面包屑 ============ */
.crumb-bar {
  background: #f7f9fb; border-bottom: 1px solid #ddd;
  display: flex; align-items: center; padding: 7px 14px;
}
.crumb { flex: 1; }
.crumb b { color: #333; }
.tool-icons { display: flex; gap: 5px; }
.icon-btn {
  width: 26px; height: 24px; border: 1px solid #999; border-radius: 3px;
  cursor: pointer; font-size: 13px; padding: 0; background: #fdfdfd; line-height: 1;
}
.icon-btn:hover { border-color: #1874cd; box-shadow: 0 0 3px #9cc7ee; }
.t-new { background: #fbf3c6; color: #c00; }
.t-find { background: #e8f1fb; }
.t-import { background: #eaf6e4; color: #4a7d2b; }
.t-export { background: #fdf1e2; color: #b06000; }

/* ============ 视图页签 ============ */
.view-tabs {
  background: #fff; border-bottom: 1px solid #d5e0ec;
  padding: 4px 14px 2px; font-size: 12px;
}
.vt-label { color: #333; font-weight: bold; }
.view-tab { color: #1874cd; font-style: italic; margin: 0 4px 0 2px; }
.view-tab.active { color: #000; font-style: normal; font-weight: bold; }
.view-tabs i { color: #aaa; margin: 0 2px; font-style: normal; }
.view-tab .vt-n { color: #c00; font-style: normal; }

/* ============ 搜索面板 ============ */
.search-panel {
  background: #fff; border: 1px solid #b7cbe8; margin: 8px 14px 0; position: relative;
}
.sp-head {
  background: linear-gradient(#f6faff, #e4eefb); border-bottom: 1px solid #b7cbe8;
  padding: 3px 10px; color: #14467e; font-weight: bold;
}
.sp-adv { position: absolute; right: 30px; font-weight: normal; cursor: pointer; color: #1874cd; }
.sp-close { position: absolute; right: 10px; cursor: pointer; color: #666; font-weight: normal; }
.sp-grid {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  padding: 10px 10px 4px; align-items: center;
}
.sp-field { display: flex; align-items: center; flex: 1 1 25%; min-width: 290px; max-width: 25%; }
.sp-field label {
  flex: 0 0 88px; text-align: right; color: #14467e; padding-right: 4px; white-space: nowrap;
}
.sp-field input { flex: 1 1 auto; width: 100%; min-width: 40px; }
.sp-ops { padding: 4px 10px 10px; }
.btn-green {
  background: linear-gradient(#7abe4a, #4e9a25); color: #fff; border: 1px solid #3e7d1e;
  border-radius: 3px; padding: 3px 18px; cursor: pointer; font-weight: bold;
}
.btn-green:hover { filter: brightness(1.06); }
.btn-plain {
  background: linear-gradient(#fdfdfd, #e8e8e8); border: 1px solid #aaa;
  border-radius: 3px; padding: 3px 12px; cursor: pointer; margin-left: 8px;
}
.sp-hint { color: #888; margin-left: 10px; }

/* ============ 操作按钮行 ============ */
.action-row { display: flex; align-items: center; padding: 8px 14px; gap: 6px; flex-wrap: wrap; }
.act-btn {
  background: linear-gradient(#5da4e0, #2e7ec3); color: #fff;
  border: 1px solid #2467a8; border-radius: 3px; padding: 4px 12px; cursor: pointer;
}
.act-btn:hover { filter: brightness(1.08); }
.act-btn.warm { background: linear-gradient(#f5b056, #dd8a1f); border-color: #c07a14; }
.row-count { margin-left: 10px; color: #333; }
.pager { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.pager a { border: 1px solid #b7cbe8; background: #f6faff; padding: 1px 6px; border-radius: 2px; }
.pager input { width: 36px; text-align: center; }

/* ============ 表格 ============ */
.grid-wrap { margin: 0 14px 20px; background: #fff; border: 1px solid #cdd8e6; overflow-x: auto; }
.grid { border-collapse: collapse; width: 100%; min-width: 1420px; }
.grid th {
  background: #fcfdff; color: #14467e; font-weight: bold;
  border-bottom: 2px solid #8fb4dc; border-right: 1px solid #e3ebf5;
  padding: 5px 6px; white-space: nowrap; cursor: pointer; user-select: none;
}
.grid th:hover { background: #eaf2fc; }
.grid th .dir { font-size: 10px; color: #d33; }
.grid td {
  border-bottom: 1px solid #e6ecf3; border-right: 1px solid #f0f4f9;
  padding: 3px 6px; white-space: nowrap; height: 26px;
}
.grid .chk { width: 30px; text-align: center; cursor: pointer; }
.grid td.num { text-align: right; }
.grid td.dt { color: #666; }
.grid td.op a { color: #1874cd; margin-right: 4px; }
/* 待收款高亮行 */
tr.wait-pay { background: #fffcc3; }
tr.wait-pay:hover { background: #fdf6a8; }
tr:hover { background: #eef5fd; }
tr.wait-pay:hover { background: #fdf3ad; }
.no-data { padding: 30px; text-align: center; color: #888; margin: 0 14px; background: #fff; border: 1px solid #cdd8e6; }

/* ============ 客户页 ============ */
.cust-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; }

/* ============ 流程提醒弹窗 ============ */
.flow-remind {
  position: fixed; right: 8px; bottom: 8px; width: 270px; z-index: 90;
  background: #fff; border: 1px solid #c3c9cf; box-shadow: 0 2px 10px rgba(0,0,0,.3);
  font-size: 12px;
}
.fr-title {
  background: linear-gradient(#ff8a80, #e53935); color: #fff; font-weight: bold;
  padding: 3px 8px; position: relative; font-size: 13px;
}
.fr-title span#frDate { font-weight: normal; font-size: 11px; opacity: .9; margin-left: 8px; }
.fr-close { position: absolute; right: 8px; cursor: pointer; font-weight: bold; }
.fr-body { padding: 10px 10px 14px; }
.fr-body a { color: #d32f2f; }
#frCountTxt { color: #d32f2f; font-weight: bold; }

/* ============ 对话框 ============ */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(30,60,90,.35); z-index: 100;
}
.overlay.show { display: flex; align-items: flex-start; justify-content: center; }
.dialog {
  margin-top: 60px; width: 640px; max-height: 78vh; background: #fff;
  border: 1px solid #7c9dc4; box-shadow: 0 6px 22px rgba(0,0,0,.35); display: flex; flex-direction: column;
}
.dialog.wide { width: 860px; }
.dlg-title {
  background: linear-gradient(#2e8bd0, #1a72bc); color: #fff; font-weight: bold;
  padding: 6px 12px; position: relative; font-size: 13px;
}
.dlg-close { position: absolute; right: 10px; cursor: pointer; font-weight: bold; }
.dlg-body { padding: 12px 16px; overflow-y: auto; flex: 1; }
.dlg-foot { border-top: 1px solid #dde5ee; padding: 8px 16px; text-align: right; }
.dlg-foot button { margin-left: 8px; }

.fgrid { display: grid; grid-template-columns: 110px 1fr; gap: 7px 8px; align-items: center; }
.fgrid label { text-align: right; color: #14467e; }
.fgrid .full { grid-column: span 2; }
.dlg-table { border-collapse: collapse; width: 100%; }
.dlg-table th {
  background: #eef4fb; border: 1px solid #cdd8e6; padding: 4px 8px; color: #14467e;
  white-space: nowrap;
}
.dlg-table td { border: 1px solid #e3ebf5; padding: 3px 8px; }
.dlg-note { color: #b06000; margin-top: 6px; }
.dlg-sum { margin-top: 8px; text-align: right; color: #14467e; font-weight: bold; }
.flow-item { padding: 6px 4px; border-bottom: 1px dashed #e3ebf5; display: flex; align-items: center; }
.flow-item .ft-title { flex: 1; }
.flow-item .ft-date { color: #999; margin: 0 10px; }
.flow-item button { padding: 1px 8px; margin-left: 4px; cursor: pointer; }

/* ============ Toast 提示 ============ */
.toast {
  display: none; position: fixed; top: 30%; left: 50%; transform: translateX(-50%);
  background: rgba(30,70,120,.92); color: #fff; padding: 10px 26px;
  border-radius: 4px; z-index: 200; font-size: 13px; box-shadow: 0 3px 12px rgba(0,0,0,.3);
}
.toast.warn { background: rgba(160,50,20,.92); }
