/* 通用样式：苏州欧陆风 · 项目管理平台 */
:root {
  --navy: #16324a;
  --navy2: #1f4468;
  --blue: #2e75b6;
  --blue-l: #4a90d9;
  --green: #2e9e5b;
  --amber: #f0a928;
  --red: #e04b4b;
  --gray: #8b96a6;
  --line: #e3e8ef;
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #1c2b3a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }
/* 数字输入框不显示上下调节箭头（全站弹框统一） */
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; }

/* 顶栏 */
.topbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 55%, var(--blue) 100%);
  color: #fff;
  padding: 12px 22px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(22, 50, 74, .18);
  position: sticky;
  top: 0;
  z-index: 30;
  flex-wrap: wrap;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; min-width: 0; padding-bottom: 12px; }
.topbar .brand-text { min-width: 0; }
.topbar .logo { height: 44px; display: flex; align-items: center; flex: 0 0 auto; }
.topbar .logo img { height: 100%; width: auto; object-fit: contain; display: block; }
/* 主标题始终单行，窄屏自动缩字号 */
.topbar .brand-text h1 { font-size: clamp(11px, 1.55vw, 17px); font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.topbar .brand-text p { font-size: 12px; opacity: .8; margin-top: 2px; letter-spacing: 1px; }
.topbar .spacer { flex: 1; }
.topbar .userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; padding-bottom: 12px; }
.topbar .userbox .userinfo { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.topbar .userbox .user-line { display: flex; align-items: center; gap: 10px; }
.topbar .userbox .user-sub { display: flex; align-items: center; }
.topbar .userbox .sys-link {
  font-size: 11.5px; line-height: 1.5; color: rgba(255,255,255,.88); text-decoration: none;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.28); transition: .18s;
}
.topbar .userbox .sys-link:hover { background: rgba(255,255,255,.24); color: #fff; }
.topbar .userbox .badge-role {
  padding: 3px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
}
.topbar .userbox .badge-role.admin { background: rgba(240,169,40,.25); border-color: rgba(240,169,40,.6); }
/* 金额预警标签 */
.warn-badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 1px 8px; border-radius: 999px; background: #e2483c; color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap;
  cursor: help; box-shadow: 0 1px 3px rgba(226,72,60,.35);
}
.warn-badge::before { content: ""; }
.warn-tip {
  display: none; position: fixed; z-index: 9999; max-width: 320px;
  background: #2b3a4d; color: #fff; font-size: 12px; line-height: 1.6;
  padding: 7px 11px; border-radius: 7px; box-shadow: 0 8px 20px rgba(10,25,45,.28);
  pointer-events: none; white-space: normal;
}

/* 站内通知 */
.topbar .userbox .notify-btn {
  position: relative; background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.3); padding: 7px 12px; border-radius: 8px;
  font-size: 13px; cursor: pointer; transition: .18s;
}
.topbar .userbox .notify-btn:hover { background: rgba(255,255,255,.24); }
.notify-dot {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 4px; border-radius: 9px; background: #e2483c; color: #fff;
  font-size: 11px; text-align: center; font-style: normal;
}
.notify-panel {
  display: none; position: fixed; z-index: 9000; top: 74px; right: 16px; width: 340px;
  max-height: 60vh; overflow: auto; background: #fff; color: #22384f;
  border: 1px solid #dbe4ee; border-radius: 10px; box-shadow: 0 14px 34px rgba(10,30,60,.2);
}
.notify-panel .np-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid #eef2f7; font-size: 13px; color: #22384f;
  position: sticky; top: 0; background: #fff;
}
.notify-panel .np-readall { font-size: 12px; color: #2f6fd0; text-decoration: none; }
.notify-panel .np-body { padding: 4px 0; }
.notify-panel .np-empty { padding: 22px 14px; text-align: center; color: #8d9db0; font-size: 13px; }
.notify-panel .np-item {
  padding: 10px 14px; border-bottom: 1px solid #f2f5f9; cursor: pointer; transition: .15s;
}
.notify-panel .np-item:last-child { border-bottom: 0; }
.notify-panel .np-item:hover { background: #f6f9fe; }
.notify-panel .np-item.unread { background: #f2f7ff; }
.notify-panel .np-title { font-size: 13px; font-weight: 600; color: #17314e; display: flex; align-items: center; gap: 6px; }
.notify-panel .np-dot { width: 7px; height: 7px; border-radius: 50%; background: #e2483c; display: inline-block; }
.notify-panel .np-text { font-size: 12px; color: #52697f; margin-top: 4px; line-height: 1.55; }
.notify-panel .np-time { font-size: 11px; color: #93a3b5; margin-top: 4px; }
.ghost-btn {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; transition: .18s;
}
.ghost-btn:hover { background: rgba(255,255,255,.22); }

/* 主导航（二级菜单，深蓝header下方整行） */
.mainnav {
  flex: 1 1 100%;
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: rgba(0,0,0,.12);
  margin: 0 -22px;
  padding: 0 22px;
}
.mainnav a {
  padding: 10px 14px;
  color: rgba(255,255,255,.82);
  font-size: 13.5px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: .15s;
  text-decoration: none;
}
.mainnav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.mainnav a.active {
  color: #fff;
  border-bottom-color: #ffd866;
  background: rgba(255,255,255,.08);
  font-weight: 600;
}

/* 容器 */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 18px 60px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--gray); margin-bottom: 18px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 14px; transition: .18s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--blue-l); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #2563a0; color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #25824b; color: #fff; }
.btn.danger { background: #fff; border-color: #f0b3b3; color: var(--red); }
.btn.danger:hover { background: #fdeaea; }
/* 同意不开票：红底白字 */
.btn.invwaive { background: #c62828; border-color: #c62828; color: #fff; }
.btn.invwaive:hover { background: #a61f1f; border-color: #a61f1f; color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 卡片 */
.card {
  background: var(--card); border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(22,50,74,.06);
}
.card-hd {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card-hd h2 { font-size: 15px; font-weight: 700; color: var(--navy); }
.card-hd .tag { font-size: 12px; color: var(--gray); }
.card-bd { padding: 18px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #45556a; margin-bottom: 7px; font-weight: 600; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbfcfe; outline: none; transition: .18s; font-size: 14px; color: var(--text);
}
.field input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(46,117,182,.1); }
.field .hint { font-size: 12px; color: var(--gray); margin-top: 6px; }

/* 提示 */
.alert { padding: 11px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert.err { background: #fdeaea; color: #b33636; border: 1px solid #f5c2c2; }
.alert.ok { background: #eaf7ef; color: #1f7a45; border: 1px solid #bfe6ce; }
.alert.info { background: #eef4fb; color: #245c94; border: 1px solid #cfe0f2; }

/* toast */
#toastBox { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 9px; font-size: 13px; color: #fff;
  background: rgba(22,50,74,.92); box-shadow: 0 6px 18px rgba(0,0,0,.18);
  animation: toastIn .2s ease;
}
.toast.ok { background: rgba(46,158,91,.95); }
.toast.err { background: rgba(224,75,75,.95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 空状态 */
.empty { text-align: center; padding: 46px 20px; color: var(--gray); font-size: 14px; }

/* 模态框 */
.mask {
  position: fixed; inset: 0; background: rgba(16,30,45,.5); display: none;
  align-items: center; justify-content: center; z-index: 1000; padding: 18px;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 480px;
  max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-hd { padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-bd { padding: 18px 20px; overflow: auto; }
.modal-ft { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 项目状态标签：每种状态一种配色 ---------- */
.st-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 1.6; }
.st-pill.bid      { background: #eaf1fb; color: #1f5da8; border-color: #c9dcf5; }  /* 中标 */
.st-pill.notstart { background: #f4f6f9; color: #5b6b7f; border-color: #dde4ec; }  /* 未开始 */
.st-pill.building { background: #eaf7ef; color: #1f7a4d; border-color: #bfe6ce; }  /* 在建 */
.st-pill.paused   { background: #fdf0e3; color: #b4600c; border-color: #f3d3ac; }  /* 停工 */
.st-pill.done     { background: #e6f4f7; color: #0e6c7d; border-color: #bedfe6; }  /* 竣工 */
.st-pill.audit    { background: #f1ecfd; color: #6b34c9; border-color: #d9cbf8; }  /* 审计 */
.st-pill.warranty { background: #eef4e4; color: #55791b; border-color: #d4e2b9; }  /* 维保 */
.st-pill.closed   { background: #f0f2f5; color: #64748b; border-color: #dbe2ea; }  /* 结束 */

/* ---------- 顶栏窄屏适配：主标题始终单行 ---------- */
@media (max-width: 900px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar .logo { height: 34px; }
  .topbar .brand-text p { display: none; }
  .topbar .userbox { gap: 6px; }
  .topbar .userbox .uname { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 620px) {
  .topbar .logo { display: none; }
  .topbar .brand-text h1 { letter-spacing: 0; }
  .topbar .userbox .badge-role { display: none; }
}/* ================= 超级管理员弹窗提醒（全站共用） ================= */
.np-tag {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 600;
  line-height: 16px; background: #eaf1fb; color: #2e75b6; border: 1px solid #c9dcf2;
}
body.notice-locked { overflow: hidden; }
.notice-mask {
  position: fixed; inset: 0; z-index: 99999; padding: 24px;
  background: rgba(9,22,38,.62); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.notice-dlg {
  width: 100%; max-width: 560px; max-height: calc(100vh - 48px);
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(6,18,34,.45);
  animation: noticeIn .28s cubic-bezier(.16,.84,.32,1);
}
@keyframes noticeIn {
  from { opacity: 0; transform: translateY(16px) scale(.972); }
  to   { opacity: 1; transform: none; }
}
.notice-hd {
  display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 18px; color: #fff;
  background: linear-gradient(135deg, #16324a 0%, #1f4468 58%, #2e75b6 100%);
}
.notice-dlg.lv-important .notice-hd { background: linear-gradient(135deg, #7a4d06 0%, #b3760f 55%, #f0a928 100%); }
.notice-dlg.lv-urgent .notice-hd    { background: linear-gradient(135deg, #7c1f1f 0%, #a82b2b 55%, #e04b4b 100%); }
.notice-dlg.mode-until .notice-hd  { background: linear-gradient(135deg, #6f1a1a 0%, #9c2323 50%, #d93b3b 100%); }
.notice-ico {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.notice-hd-tx { min-width: 0; flex: 1; padding-top: 2px; }
.notice-kicker { font-size: 11.5px; letter-spacing: 1px; opacity: .82; margin-bottom: 6px; }
.notice-hd h3 { font-size: 19px; line-height: 1.45; font-weight: 700; word-break: break-word; }
.notice-bd { padding: 22px 26px; overflow: auto; flex: 1; }
.notice-text { font-size: 14.5px; line-height: 1.95; color: #26384d; white-space: pre-wrap; word-break: break-word; }
.notice-ft {
  display: flex; align-items: center; gap: 12px; padding: 16px 24px;
  border-top: 1px solid #eef2f7; background: #fafcff; flex-wrap: wrap;
}
.notice-meta { flex: 1; min-width: 140px; font-size: 11.5px; color: #93a3b5; }
.notice-ok {
  flex: 0 0 auto; margin-left: auto; padding: 11px 24px; border-radius: 9px; border: none;
  background: linear-gradient(135deg, #2e75b6, #16324a); color: #fff;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 16px rgba(46,117,182,.32); transition: .18s;
}
.notice-ok:hover { filter: brightness(1.06); transform: translateY(-1px); }
.notice-ok:disabled { opacity: .7; cursor: default; transform: none; }
.notice-lock {
  flex: 1 1 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: 9px; background: #fdeaea; border: 1px solid #f5c2c2;
  color: #a12c2c; font-size: 12.5px; font-weight: 600;
}
.notice-quit {
  flex: 0 0 auto; margin-left: auto; padding: 9px 18px; border-radius: 9px; border: 1px solid #d7e0ea;
  background: #fff; color: #45556a; font-size: 13px; cursor: pointer;
}
.notice-quit:hover { border-color: #b9c7d6; color: #16324a; }

/* 系统通知 · 自动提醒条 */
.sys-msg-bar {
  position: fixed; top: 96px; right: 16px; z-index: 8990;
  display: flex; align-items: center; gap: 10px; max-width: 430px; padding: 10px 12px;
  background: #fff; border: 1px solid #cfe0f2; border-left: 4px solid #2e75b6;
  border-radius: 10px; box-shadow: 0 10px 26px rgba(12,30,55,.16);
  animation: noticeIn .22s ease;
}
.sys-msg-bar.lv-important { border-color: #f0e0b0; border-left-color: #f0a928; }
.sys-msg-bar.lv-urgent    { border-color: #f5c2c2; border-left-color: #e04b4b; }
.smb-ico { font-size: 16px; flex: 0 0 auto; }
.smb-tx { min-width: 0; flex: 1; }
.smb-tx b { display: block; font-size: 12.5px; color: #16324a; }
.smb-tx span { display: block; font-size: 12px; color: #52697f; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smb-go { border: none; background: #2e75b6; color: #fff; padding: 6px 12px; border-radius: 7px; font-size: 12.5px; white-space: nowrap; }
.smb-go:hover { background: #2563a0; }
.smb-x { border: none; background: transparent; color: #a8b4c2; font-size: 18px; line-height: 1; padding: 0 2px; }
@media (max-width: 620px) {
  .sys-msg-bar { top: 88px; left: 12px; right: 12px; max-width: none; }
  .smb-tx span { max-width: none; }
  .notice-mask { padding: 14px; }
  .notice-hd { padding: 18px 18px 15px; }
  .notice-bd { padding: 18px; }
  .notice-ft { padding: 14px 18px; }
  .notice-ok { width: 100%; }
}

/* ---------- 进度管理 · 四板块页签（plan.html / projects.html / 03.html 共用） ---------- */
.ptabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.ptab {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: #45556a; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: .16s; white-space: nowrap;
}
.ptab:hover { border-color: #96bde5; color: var(--blue); }
.ptab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ptab .pnum { font-size: 11px; padding: 0 6px; border-radius: 5px; background: rgba(46,117,182,.12); color: #2e75b6; font-weight: 700; }
.ptab.on .pnum { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- 长表格表头固定（公共脚本动态创建） ---------- */
.tbl-sticky-head {
  position: fixed;
  display: none;
  overflow: hidden;
  background: #fff;
  z-index: 45;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(20, 40, 70, .10);
}
.tbl-sticky-head-inner { position: relative; will-change: transform; }
.tbl-sticky-head table { margin: 0 !important; table-layout: fixed; border-collapse: collapse; }
.tbl-sticky-head col { box-sizing: border-box; }
.tbl-sticky-head thead th { border-bottom: 1px solid var(--line); background-clip: padding-box; }
@media print { .tbl-sticky-head { display: none !important; } }