/* ============================================================
   装修项目管家 · 清新自然全局样式
   设计语言：低饱和绿色表面 + 清晰层级 + 稳定的业务工作区
   ============================================================ */

:root {
  --sidebar-width: 228px;
  --topbar-height: 60px;

  /* 主色（低饱和清新绿） */
  --primary: #3d7a63;
  --primary-2: #6aa88c;
  --primary-grad: linear-gradient(135deg, #3d7a63 0%, #6aa88c 100%);
  --accent: #4e8f73;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* 背景与表面 */
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --border: #e0e9e3;
  --border-strong: #cbd8d0;

  /* 文字 */
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;

  /* 侧边栏（浅绿清新 · 低饱和） */
  --sidebar-bg: linear-gradient(180deg, #e9f3ee 0%, #dfece4 55%, #d4e7dc 100%);
  --sidebar-text: #3a5d52;
  --sidebar-active: linear-gradient(90deg, #3d7a63, #6aa88c);

  /* 阴影与圆角 */
  --shadow-sm: 0 1px 2px rgba(36, 57, 48, .05), 0 1px 3px rgba(36, 57, 48, .06);
  --shadow: 0 4px 18px rgba(36, 57, 48, .06);
  --shadow-lg: 0 12px 32px rgba(36, 57, 48, .12);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
  line-height: 1.55;
}

/* ============ 布局 ============ */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---- 侧边栏（深色渐变 + 玻璃） ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  box-shadow: 2px 0 16px rgba(51, 82, 68, .08);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 18px;
  font-size: 17px; font-weight: 700;
  color: #2c5246;
  letter-spacing: 0;
}
.brand-logo { height: 26px; width: auto; border-radius: 6px; }
.brand-preview { width: 64px; height: 64px; border-radius: 10px; object-fit: contain; border: 1px solid var(--border); padding: 4px; background: #fff; }
/* 项目详情 Tab 区块标题栏（浅绿背景） */
#projTabsContent .proj-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: linear-gradient(90deg, #eef5f1, #e2eee7);
  color: #2c5246; font-weight: 600; font-size: 15px;
  padding: 9px 14px; border-radius: 10px; margin-bottom: 12px;
  border: 1px solid #d9e7de;
}
#projTabsContent .card-header {
  background: linear-gradient(90deg, #eef5f1, #e2eee7);
  color: #2c5246;
  border-bottom: 1px solid #d9e7de;
}
#projTabsContent .card-header .text-muted { color: #5d8773 !important; }
.phase-card { cursor: grab; }
.phase-card:active { cursor: grabbing; }
.phase-card-inner { border: 1px solid #e3eee7; border-radius: 10px; padding: 8px 10px; background: #fff; transition: box-shadow .15s; position: relative; }
.phase-del { position: absolute; top: 3px; right: 4px; opacity: .55; }
.phase-del:hover { opacity: 1; }
.phase-card:hover .phase-card-inner { box-shadow: var(--shadow-sm); border-color: #cfe3d8; }
.phase-card.dragging { opacity: .5; cursor: grabbing; }
.phase-card.dragging .phase-card-inner { border: 1px dashed var(--primary); }
/* 施工阶段卡紧凑化 */
/* 供应商表格：容器内双向滚动，表头冻结，滚动条可见 */
.supplier-scroll {
  max-height: 72vh;
  overflow: auto;
  scrollbar-gutter: stable;
}
.supplier-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef5f1;
  box-shadow: 0 1px 0 #d9e7de;
}
.supplier-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.supplier-scroll::-webkit-scrollbar-thumb { background: #c5d8cc; border-radius: 5px; }
.supplier-scroll::-webkit-scrollbar-track { background: #f1f6f2; }
#phaseBlock .card-header { padding: 8px 14px; }
#phaseBlock .card-header .form-control-sm { height: 28px; font-size: 13px; }
#phaseBlock .card-body { padding: 10px 12px; }
#phaseBlock .phase-card-inner { padding: 6px 8px; font-size: 13px; }
#phaseBlock .phase-card-inner .form-select-sm { height: 26px; font-size: 12px; padding: 1px 6px; }
#phaseBlock .phase-card-inner .input-group-sm .btn { font-size: 12px; padding: 2px 8px; }
#phaseBlock .phase-card-inner .small { font-size: 12.5px; }
#phaseBlock .phase-card-inner .btn-link { font-size: 12px; }
.note-item {
  border: 1px solid #e3eee7; border-radius: 10px; padding: 10px 12px;
  background: #fbfdfb; transition: box-shadow .15s; height: 100%;
}
.note-item:hover { box-shadow: var(--shadow-sm); border-color: #cfe3d8; }
.note-editor {
  border: 1px solid #d5e2da; border-radius: 8px; min-height: 120px; padding: 10px 12px;
  font-size: 14.5px; background: #fff; outline: none;
}
.note-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(61, 122, 99, .12); }
.note-editor:empty:before { content: attr(data-placeholder); color: #94a3b8; }
.note-content img { max-width: 100%; border-radius: 8px; margin: 4px 0; }
.note-content audio { width: 100%; margin: 4px 0; }
.note-content ul, .note-content ol { padding-left: 1.2rem; }
.note-content { font-size: 14px; line-height: 1.65; }
/* 施工合同卡紧凑化 */
#contract .form-label { margin-bottom: 2px; font-size: 12px; color: var(--text-2); }
#contract .form-control-sm, #contract .form-select-sm {
  height: 28px; font-size: 13px; padding: 2px 8px;
}
#contract input[name^="pt_"] { height: 26px; font-size: 12px; }
#contract .table-sm { font-size: 13px; }
#contract .card-header { padding: 8px 14px; }
#contract .card-body { padding: 12px 14px; }
#contract .proj-head { padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.sidebar-brand i {
  font-size: 22px;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav { flex: 1; padding: 10px 12px; overflow-y: auto; }
.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  margin-bottom: 2px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 17px;
  border-radius: 10px;
  transition: all .18s ease;
  position: relative;
}
.sidebar-nav .nav-item i { width: 20px; text-align: center; font-size: 17px; opacity: .85; }
.sidebar-nav .nav-item:hover {
  background: rgba(61, 122, 99, .1);
  color: #2c5246;
  transform: translateX(2px);
}
.sidebar-nav .nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(61, 122, 99, .18);
}
.sidebar-nav .nav-item.active i { opacity: 1; }

.sidebar-footer {
  padding: 14px 22px;
  border-top: 1px solid rgba(61, 122, 99, .16);
}
.sidebar-footer a { color: var(--sidebar-text); text-decoration: none; font-size: 14px; transition: color .15s; }
.sidebar-footer a:hover { color: #2c5246; }

/* ---- 主区域 ---- */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* 顶部栏（毛玻璃） */
.topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(210, 223, 215, .9);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 90;
}
.topbar h5 { font-weight: 700; letter-spacing: 0; }

.content { padding: 26px 28px 34px; max-width: 100%; }

/* ============ 登录页 ============ */
.login-body {
  background: #edf4f0;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
/* 低对比度纹理帮助登录页保持层次，但不干扰表单阅读。 */
.login-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M0 48h96M48 0v96' stroke='%23c6dccd' stroke-width='1' opacity='.5'/%3E%3Ccircle cx='48' cy='48' r='2' fill='%2396c4a8' opacity='.45'/%3E%3C/svg%3E");
  opacity: .7;
}
.login-card {
  width: min(400px, calc(100vw - 32px));
  background: rgba(255, 255, 255, .96);
  border: 1px solid #dbe9df;
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(51, 82, 68, .14);
  position: relative;
  z-index: 1;
}
.login-card .card-body { color: var(--text); }
.login-card .form-label { color: var(--text-2); }
.login-card .form-control {
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
}
.login-card .form-control::placeholder { color: var(--text-3); }
.login-card .form-control:focus { background: #fff; color: var(--text); }
.login-icon { font-size: 46px; color: var(--primary); }
.login-card .alert { background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .35); color: var(--danger); }
.login-card .text-muted { color: var(--text-3) !important; }
.login-card .btn-primary {
  background: var(--primary-grad);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(61, 122, 99, .24);
}

/* ============ 卡片（圆角 + 细腻阴影） ============ */
.card {
  border: 1px solid #e0e9e3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: 0 7px 24px rgba(36, 57, 48, .09); }
.card-header {
  background: #fbfdfb;
  border-bottom: 1px solid #e1ebe4;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  font-weight: 600;
  padding: 14px 18px;
}
.card-footer { background: #f7faf8; border-top: 1px solid #e1ebe4; }

/* ---- 统计卡（渐变 + 玻璃） ---- */
.stat-card {
  border-radius: 10px;
  padding: 14px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(36, 57, 48, .12);
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-card::after {
  content: '';
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  top: -18px; right: -18px;
}
.stat-card .stat-num { font-size: 21px; font-weight: 700; letter-spacing: 0; position: relative; }
.stat-card .stat-label {
  font-size: 13px; opacity: .92; position: relative;
  display: flex; align-items: center; gap: .25rem;
  white-space: nowrap; overflow: hidden;
}
.stat-card .stat-label i { flex-shrink: 0; }
.stat-card .stat-label span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex-shrink: 1;
}
.stat-card .stat-sub { font-size: 11px; opacity: .85; margin-top: 2px; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(36, 57, 48, .17); }

/* 渐变工具类（华为蓝为主） */
.grad-indigo  { background: linear-gradient(135deg, #3d7a63, #6aa88c); }
.grad-blue    { background: linear-gradient(135deg, #2f6b57, #4e8f73); }
.grad-emerald { background: linear-gradient(135deg, #4e8f73, #7ab394); }
.grad-amber   { background: linear-gradient(135deg, #b08d57, #c9a876); }
.grad-rose    { background: linear-gradient(135deg, #a96a6a, #c58f8f); }
.grad-violet  { background: linear-gradient(135deg, #6b6f9e, #8f93bd); }
.grad-cyan    { background: linear-gradient(135deg, #4f8a70, #79b09a); }
.grad-slate   { background: linear-gradient(135deg, #334155, #64748b); }

/* ============ 表格（清新高可读） ============ */
.table {
  --bs-table-hover-bg: rgba(61, 122, 99, .06);
  font-size: 14.5px;
  color: var(--text);
}
.table > :not(caption) > * > * {
  padding: .7rem .9rem;
  vertical-align: middle;
}
.table thead th {
  background: #eef5f1;                 /* 浅绿表头，清新呼应主题 */
  color: #2c5246;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0;
  border-bottom: 1px solid #d9e7de;
  border-top: none;
  white-space: nowrap;
  padding: .72rem .9rem;
}
.table thead th:first-child { border-top-left-radius: 10px; }
.table thead th:last-child { border-top-right-radius: 10px; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:nth-child(even) { background: rgba(244, 247, 244, .6); }  /* 柔和斑马纹 */
.table tbody td {
  border-bottom: 1px solid #f0f3f1;
  border-top: none;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: rgba(61, 122, 99, .05); }
.table-hover tbody tr:nth-child(even):hover { background: rgba(61, 122, 99, .08); }
.table-responsive { border-radius: 12px; }
.card > .table-responsive > .table { margin-bottom: 0; }

/* 紧凑表格（明细/小表） */
.table-sm > :not(caption) > * > * { padding: .52rem .65rem; }
.table-sm thead th { font-size: 12.5px; }
.table-sm tbody { font-size: 13.5px; }

/* 数字列 */
.text-money { font-variant-numeric: tabular-nums; }

/* ============ 按钮（层级清晰） ============ */
.btn { border-radius: var(--radius-sm); font-weight: 500; transition: all .18s ease; }
.btn-primary {
  background: var(--primary-grad);
  border: none;
  box-shadow: 0 4px 12px rgba(61, 122, 99, .24);
}
.btn-primary:hover { background: linear-gradient(135deg, #356b57, #5a9d82); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(61, 122, 99, .32); }
.btn-primary:focus-visible, .btn-outline-primary:focus-visible,
.btn-outline-secondary:focus-visible, .btn-outline-danger:focus-visible,
.btn-outline-success:focus-visible { box-shadow: 0 0 0 3px rgba(61, 122, 99, .18); }
.btn-outline-primary { border-color: #9cc4b2; color: #3d7a63; }
.btn-outline-primary:hover { background: #3d7a63; border-color: #3d7a63; }
.btn-outline-secondary { border-color: #cbd8d0; color: var(--text-2); }
.btn-outline-secondary:hover { background: #f1f6f3; border-color: #afc4b7; color: var(--text); }
.btn-filter-active { border-color: var(--primary) !important; background: rgba(61,122,99,.08) !important; color: var(--primary) !important; }
.btn-filter-active:hover { background: rgba(61,122,99,.15) !important; color: var(--primary) !important; }
.btn-filter-active .flt-badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px; margin-left:4px; border-radius:999px; background:var(--primary); color:#fff; font-size:11px; line-height:1; vertical-align:1px; }
/* 供应商页表格：横向+竖向滚动，吸顶表头 */
.sup-scroll { overflow: auto; max-height: calc(100vh - 330px); border-radius: 8px; }
.sup-scroll thead th { position: sticky; top: 0; background: #fff; z-index: 2; box-shadow: 0 1px 0 #e5ece8; }
.sup-scroll tbody tr:hover td { background: rgba(61,122,99,.06); }
/* 收款节点拖拽排序 */
.pay-row { cursor: grab; }
.pay-row:active { cursor: grabbing; }
.pay-row.dragging { opacity: .45; }
.so-row { cursor: grab; }
.so-row:active { cursor: grabbing; }
.so-row.dragging { opacity: .45; }
.pay-tip { color: var(--text-2); font-size: 12px; }
/* 可搜索供应商下拉 */
.sup-picker { position: absolute; z-index: 1060; border-radius: 10px; box-shadow: 0 8px 24px rgba(30,50,40,.14); padding: 8px; }
.sup-picker .dropdown-item { border-radius: 6px; cursor: pointer; white-space: normal; }
.sup-picker .dropdown-item:hover { background: rgba(61,122,99,.08); color: var(--primary); }
.btn-outline-danger:hover { background: var(--danger); }
.btn-outline-success:hover { background: var(--success); }
.btn-sm { border-radius: 7px; }

/* ============ 表单控件 ============ */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  background-color: #fff;
  padding: .5rem .8rem;
  font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.form-control:focus, .form-select:focus {
  border-color: #6aa88c;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(61, 122, 99, .14);
}
.form-control:disabled, .form-select:disabled { background-color: #f3f7f4; }
.form-label { font-weight: 500; color: var(--text-2); }
.form-text { color: var(--text-3); }

/* ============ 徽章（胶囊） ============ */
.badge { border-radius: 6px; font-weight: 500; padding: .35em .65em; }
.badge-status { font-weight: 500; }
.text-bg-light { background: #edf3ef !important; color: var(--text-2) !important; }
.text-bg-info { background: #4e8f73 !important; }

/* ============ 进度条（渐变） ============ */
.progress { background: #edf3ef; border-radius: 999px; overflow: hidden; }
.progress-xs { height: 6px; }
.progress-bar { background: var(--primary-grad); border-radius: 999px; transition: width .4s ease; }
.progress-bar.bg-success { background: linear-gradient(135deg, #10b981, #34d399); }
.progress-bar.bg-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

/* ============ 页头与搜索 ============ */
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-head h5 { margin: 0; font-weight: 700; }
.search-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-row .form-control, .search-row .form-select { min-height: 38px; }
.text-money { font-variant-numeric: tabular-nums; }

/* ============ Alert 与空状态 ============ */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; }
.table tbody td.text-center.text-muted { color: var(--text-3) !important; background: #fbfdfb; }
.card > .card-body.text-center.text-muted { color: var(--text-3) !important; background: #fbfdfb; }
.list-group-item.text-muted { color: var(--text-3) !important; background: #fbfdfb; }

/* ============ Tabs ============ */
.tab-card .nav-tabs { border-bottom: 1px solid var(--border); }
.tab-card .nav-link { color: var(--text-2); border: none; padding: 9px 18px; margin: 5px 3px; font-weight: 500; transition: all .18s; border-radius: 10px !important; }
.tab-card .nav-link:hover { color: #5f5848; background: #efede6; border-radius: 10px !important; }
.tab-card .nav-link.active {
  color: #4c4638;
  background: linear-gradient(135deg, #d6d0c2, #c7bfac);
  font-weight: 700;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(160, 150, 130, .3);
}
.tab-card .nav-link.active i { color: #8a7f63; }
.nav-tabs .nav-link { border-radius: 0; }

/* ============ 甘特图（清新绿） ============ */
.gantt-scroll { max-height: 62vh; overflow: auto; }
.gantt-chart { min-width: 720px; }
.gantt-row { display: flex; align-items: stretch; border-bottom: 1px solid #eef2f6; min-height: 42px; }
.gantt-label { width: 210px; min-width: 210px; padding: 6px 12px; font-size: 13px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis;
  position: sticky; left: 0; z-index: 5; background: #fff; display: flex; align-items: center;
  border-right: 1px solid #e6ebf0; box-shadow: 2px 0 4px rgba(15,23,42,.04); }
.gantt-track { position: relative; flex: 1; height: 42px;
  background-image: repeating-linear-gradient(90deg, #eef3f0 0 1px, transparent 1px 90px); }
.gantt-node { position: absolute; top: 0; bottom: 0; transform: translateX(-50%); color: #6b7280; z-index: 3; }
.gantt-node::before { content: ''; position: absolute; left: 50%; top: 7px; bottom: 7px; width: 1px; transform: translateX(-50%); background: currentColor; opacity: .45; }
.gantt-node::after { content: ''; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%); background: currentColor; border: 2px solid #fff; box-shadow: 0 0 0 1px currentColor; }
.gantt-node .node-label { position: absolute; left: 50%; top: -17px; transform: translateX(-50%); font-size: 11px; white-space: nowrap; color: #334155; background: rgba(255,255,255,.92); padding: 0 4px; border-radius: 3px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.gantt-bar { position: absolute; top: 9px; height: 24px; border-radius: 6px; background: linear-gradient(180deg, #5b8def, #3b6fd8); color: #fff; font-size: 12px; line-height: 24px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; box-shadow: 0 1px 3px rgba(59,111,216,.4); min-width: 20px; border: 1px solid rgba(0,0,0,.1); z-index: 3; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; opacity: .75; z-index: 4; box-shadow: 0 0 6px rgba(239,68,68,.5); }
.gantt-axis-label { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 11px; color: #7c8a84; white-space: nowrap; }
.gantt-header { border-bottom: 2px solid #dde6e1; position: sticky; top: 0; z-index: 10; background: #f7faf9; }
.gantt-header .gantt-label { background: #f7faf9; z-index: 11; font-weight: 600; color: #4a5a52; }
.gantt-section { background: #f2f7f4; font-size: 13px; font-weight: 600; color: #2c5246; border-bottom: 1px solid #dde6e1; display: flex; align-items: stretch; cursor: pointer; user-select: none; }
.gantt-section:hover { background: #e9f2ed; }
.gantt-section .gantt-label { background: inherit; }
.group-caret { margin-right: 5px; font-size: 12px; transition: transform .15s; }
.gantt-section.collapsed .group-caret { transform: rotate(-90deg); }
.sup-pay-scroll { max-height: 62vh; overflow-y: auto; }
.sup-pay-scroll .table thead th { position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 0 #d9e7de; }
.gantt-tooltip {
  display: none; position: absolute; top: 0; z-index: 50;
  background: rgba(30, 55, 46, .92); color: #fff; font-size: 12px;
  padding: 3px 9px; border-radius: 8px; pointer-events: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .25); white-space: nowrap;
}

/* ============ 时间线（清新绿） ============ */
.timeline { position: relative; padding-left: 34px; max-width: 780px; }
.timeline::before { content: ''; position: absolute; left: 12px; top: 4px; bottom: 4px; width: 2px; background: linear-gradient(180deg, #9fd0b5, #d8ecdf); }
.timeline-item { position: relative; margin-bottom: 14px; }
.timeline-dot { position: absolute; left: -29px; top: 8px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #6aa88c; }
.timeline-date { font-size: 13px; color: #4e8f73; margin-bottom: 4px; font-weight: 600; }
.timeline-card { border: 1px solid #d9e7de; border-radius: 12px; box-shadow: var(--shadow-sm); }
.timeline-today .timeline-dot { box-shadow: 0 0 0 2px #ef4444; }
.timeline-today { border-top: 1px dashed #ef4444; padding-top: 10px; }
.timeline-card .badge { color: #2f3a36; font-weight: 600; }

/* ============ 移动端顶栏 ============ */
.mobile-topbar {
  background: #e9f3ee;
  padding: 8px 12px;
  position: sticky; top: 0; z-index: 90;
  gap: 10px;
  box-shadow: 0 2px 12px rgba(51, 82, 68, .12);
}
.mobile-topbar .alerts-root .btn { color: #2c5246; }

/* ============ 响应式 ============ */
@media (max-width: 991.98px) {
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .stat-card .stat-num { font-size: 18px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 575.98px) {
  .page-head .btn { font-size: 14px; }
  .dropdown-menu.alert-list { position: fixed !important; left: 8px !important; right: 8px !important; width: auto !important; max-height: 60vh; }
}

/* ============ 通用微效 ============ */
a { transition: color .15s ease; color: #52677a; }
a:hover { text-decoration: none; color: #37495c; }
.table a { color: #52677a; font-weight: 500; }
.table a:hover { color: #37495c; }
/* 项目名称链接标签样式（琥珀底小圆角）——全站表格内项目详情链接统一生效 */
.project-link,
.table a[href^="/projects/"]:not([href*="/edit"]):not([href*="/new"]):not([href*="#"]) {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #efe3cb; color: #6b5226 !important;
  font-weight: 600; font-size: 14px; line-height: 1.5; text-decoration: none;
  border: 1px solid #e0cfab; transition: all .15s;
}
.project-link:hover,
.table a[href^="/projects/"]:not([href*="/edit"]):not([href*="/new"]):not([href*="#"]):hover {
  background: #e6d5b4; color: #4f3c1c !important;
}
/* 材料名称链接标签样式（蓝底小圆角）——材料管理/库存管理材料列统一 */
.table a[href^="/materials/"]:not(.btn):not([href*="/edit"]):not([href*="/new"]):not([href*="/import"]):not([href*="#"]) {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #d3e3f5; color: #1c4d7a !important;
  font-weight: 600; font-size: 14px; line-height: 1.5; text-decoration: none;
  border: 1px solid #b8cee6; transition: all .15s;
}
.table a[href^="/materials/"]:not(.btn):not([href*="/edit"]):not([href*="/new"]):not([href*="/import"]):not([href*="#"]):hover {
  background: #c2d8ef; color: #143a5e !important;
}
/* 客户名链接标签（藕紫底小圆角） */
.table a[href^="/customers/"]:not(.btn):not([href*="/edit"]):not([href*="/new"]):not([href*="#"]) {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #e3d9ee; color: #4a3a68 !important;
  font-weight: 600; font-size: 14px; line-height: 1.5; text-decoration: none;
  border: 1px solid #d0c0e4; transition: all .15s;
}
.table a[href^="/customers/"]:not(.btn):not([href*="/edit"]):not([href*="/new"]):not([href*="#"]):hover {
  background: #d6c9e6; color: #3a2c54 !important;
}
/* 供应商名链接标签（青灰蓝底小圆角） */
.table a[href^="/suppliers/"]:not(.btn):not([href*="/edit"]):not([href*="/new"]):not([href*="#"]) {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #dce5ec; color: #2f4a5e !important;
  font-weight: 600; font-size: 14px; line-height: 1.5; text-decoration: none;
  border: 1px solid #c2d2de; transition: all .15s;
}
.table a[href^="/suppliers/"]:not(.btn):not([href*="/edit"]):not([href*="/new"]):not([href*="#"]):hover {
  background: #cfdbe4; color: #223b4d !important;
}
.supplier-tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #dce5ec; color: #2f4a5e;
  font-weight: 600; font-size: 14px; line-height: 1.5;
  border: 1px solid #c2d2de;
}
.dropdown-menu { border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.list-group-item { border-color: var(--border); }
.offcanvas, .sidebar-offcanvas { background: #e9f3ee; }

/* ============ 页内标题（移动端显示；桌面端由 topbar 承担） ============ */
.page-title {
  font-size: 18px; font-weight: 700; color: #2c5246;
  margin: 0 0 14px; letter-spacing: 0;
}

/* ============ 空状态组件 ============ */
.empty-state {
  text-align: center;
  color: var(--text-3) !important;
  background: #fbfdfb;
  padding: 2.4rem 1rem;
  font-size: 14px;
}
.empty-state i { display: block; font-size: 26px; margin-bottom: 6px; color: #b9ccc0; }
.empty-state a { color: #52677a; font-weight: 500; }
.empty-state-sm {
  text-align: center;
  color: var(--text-3) !important;
  background: #fbfdfb;
  padding: .9rem .6rem;
  font-size: 13px;
}
.empty-state-sm i { color: #b9ccc0; margin-right: 4px; }
/* 表格空行（colspan 居中灰字即空状态）统一留白与字号 */
.table tbody td[colspan].text-center.text-muted {
  color: var(--text-3) !important;
  background: #fbfdfb;
  padding: 2rem 1rem !important;
  font-size: 14px;
}

/* ============ 语义化小工具类（替代内联样式） ============ */
.text-pine { color: #2c5246 !important; }
.text-pine-2 { color: #3a5d52 !important; }
.proj-hero { background: linear-gradient(135deg, #e9f3ee 0%, #d4e7dc 60%, #c9dfd2 100%); }
.badge-category { background: #e3d9ee; color: #4a3a68; border: 1px solid #d0c0e4; }
.badge-task { background: #6f8fb0; color: #fff; }

/* ============ 小屏工作区 ============ */
@media (max-width: 575.98px) {
  .content { padding: 14px 12px 24px; }
  .page-head { align-items: stretch; margin-bottom: 16px; }
  .page-head > *, .page-head .search-row { width: 100% !important; }
  .page-head .search-row > .form-control,
  .page-head .search-row > .form-select { width: 100% !important; }
  .page-head > .d-flex { justify-content: stretch; }
  .page-head > .d-flex .btn { flex: 1; }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .stat-card { min-height: 70px; padding: 11px 13px; }
  .stat-card .stat-num { font-size: 18px; }
  .table > :not(caption) > * > * { padding: .58rem .65rem; }
  .login-card .card-body { padding: 22px !important; }
}

/* ============ 移动端：宽表卡片化 ============
   用法：给 <table> 加 class="table-card"，每个需要显示字段名的单元格加 data-label="字段名"。
   窄屏下每行变成一张卡片，字段名在左、值在右，避免多列挤压看不清。
   复选框列加 class="td-pick"、操作列放最后且不带 data-label，窄屏下自动右对齐。 */
@media (max-width: 767.98px) {
  .table-card { display: block; width: 100%; }
  .table-card thead { display: none; }
  .table-card tbody { display: block; }
  .table-card tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    padding: 2px 0 6px;
  }
  .table-card tbody tr.text-muted { opacity: .6; }
  .table-card tbody tr:has(td[colspan]) {
    border: 0; box-shadow: none; background: transparent; margin-bottom: 0; padding: 0;
  }
  .table-card tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: auto;
    max-width: none !important;
    border: 0 !important;
    padding: 5px 12px !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word;
  }
  .table-card tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    min-width: 62px;
    max-width: 45%;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-3);
    font-weight: 600;
  }
  .table-card tbody td:not([data-label])::before { content: none; }
  .table-card tbody td.td-pick { justify-content: flex-end; padding: 6px 12px 0 !important; }
  .table-card tbody td:last-child { justify-content: flex-end; padding-top: 9px !important; }
  .table-card tbody td .text-truncate,
  .table-card tbody td > div {
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .table-card tbody td .badge { max-width: none !important; }
  .table-card tbody td[colspan] { justify-content: center !important; text-align: center !important; }
  .table-card tbody td[colspan]::before { content: none; }
}
