/* Visual refresh: a compact, low-code workspace language using the existing LIFEWORTH palette. */
:root {
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --canvas: #f2f5fa;
  --ink-strong: #152b50;
  --ink-soft: #687b96;
  --line-soft: #e2e9f3;
  --accent: #1e6fe6;
  --accent-deep: #1456b8;
  --signal: #c6ec1b;
  --risk: #d18b34;
}

body {
  background: var(--canvas);
  color: var(--ink-strong);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background-image: linear-gradient(rgba(39, 76, 130, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(39, 76, 130, .025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 520px);
}

.sidebar {
  background: linear-gradient(165deg, #122b58 0%, #102454 60%, #0d1d43 100%);
  box-shadow: 10px 0 30px rgba(18, 46, 91, .12);
}

.sidebar .brand span { color: #dbe7ff; }
.sidebar nav button { border: 1px solid transparent; }
.sidebar nav button:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .08); }
.sidebar nav button.active { background: #1e6fe6; border-color: #4e91f2; box-shadow: 0 8px 18px rgba(5, 32, 83, .28); color: #fff; }
.side-bottom { color: #b7c9e8; }

main { position: relative; z-index: 1; }
header { background: rgba(255, 255, 255, .9); border-bottom-color: #e4eaf2; backdrop-filter: blur(12px); }
#content { max-width: 1640px; }

.page-head {
  padding: 2px 0 3px;
}
.page-head h1 { letter-spacing: -.45px; }
.page-head .actions { gap: 8px; }
.page-head .actions > button.primary { box-shadow: 0 7px 16px rgba(30, 111, 230, .2); }

/* Compact summary strip for the project list. */
.project-insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--line-soft);
  box-shadow: 0 5px 16px rgba(18, 50, 93, .035);
}
.project-insight-strip > div {
  min-height: 92px;
  padding: 17px 20px 14px;
  background: var(--surface);
}
.project-insight-strip span,
.project-insight-strip small { display: block; color: var(--ink-soft); font-size: 12px; }
.project-insight-strip strong { display: block; margin: 4px 0 1px; color: var(--ink-strong); font: 600 26px/1.25 'Segoe UI', 'Microsoft YaHei', sans-serif; }
.project-insight-strip .is-risk strong { color: var(--risk); }

.overview-band {
  margin-top: -4px;
  border: 1px solid rgba(72, 140, 238, .25);
  box-shadow: 0 12px 26px rgba(18, 67, 139, .12);
}
.overview-band .band-action { min-height: 35px; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; padding: 7px 12px; background: rgba(255,255,255,.08); }
.overview-band .band-action:hover { background: rgba(255,255,255,.16); }
.band-chain > div { transition: transform .16s, background .16s; }
.band-chain > div:hover { transform: translateY(-2px); background: rgba(255,255,255,.15); }

.work-stats { position: relative; z-index: 1; }
.work-stats .stat-card { border-radius: 11px; }
.work-stats .stat-card::after { content: '↗'; position: absolute; right: 18px; top: 17px; color: #91a2bc; font-size: 15px; opacity: .7; }
.work-stats .stat-card { position: relative; }
.work-stats .stat-card:nth-child(2) { background: linear-gradient(145deg, #183568, #102454); }
.work-stats .stat-card:nth-child(3) { border-top: 3px solid #d19a4d; }
.work-stats .stat-card:nth-child(4) { border-top: 3px solid #569b86; }

.section-heading { align-items: flex-end; }
.filter-pills { padding: 4px; border: 1px solid var(--line-soft); border-radius: 9px; background: #f8faff; width: fit-content; max-width: 100%; }
.filter-pills button { border-radius: 6px; }
.filter-pills button.active { background: #fff; box-shadow: 0 2px 8px rgba(24, 69, 129, .1); }

.work-card, .panel, .settings-card { border-color: var(--line-soft); box-shadow: 0 5px 18px rgba(18, 50, 93, .035); }
.work-card:hover { box-shadow: 0 10px 24px rgba(18, 50, 93, .08); }
.project-work-card { border-top: 3px solid #a9bfdf; }
.project-work-card:has(.badge.ok) { border-top-color: #63a88b; }
.project-work-card:has(.badge.warn) { border-top-color: #d19a4d; }
.task-work-card { border-top: 3px solid #a9bfdf; }
.task-work-card.needs-attention { border-top-color: #d19a4d; }
.task-work-card .node-box { background: #f7f9fd; }
.project-issue { border-radius: 7px; padding: 8px 10px; background: #f8fafc; border-left: 0; }
.project-issue.text-warn { background: #fff8ec; }

.toolbar, .card-filterbar { box-shadow: 0 4px 14px rgba(18, 50, 93, .035); }
.data-table thead th { position: sticky; top: 0; z-index: 1; background: #f5f8fc; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table td { border-bottom-color: #edf1f6; }

.week-controls { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: #fff; box-shadow: 0 4px 12px rgba(18, 50, 93, .035); }
.week-controls b { color: var(--ink-strong); }
.board .lane { border-radius: 9px; background: #f7f9fc; }
.board .lane > h3 { padding-bottom: 8px; border-bottom: 1px solid #e5ebf3; }
.board .week-task { box-shadow: 0 4px 10px rgba(20, 49, 91, .055); }

dialog { border: 1px solid #dbe5f2; border-radius: 15px; }
dialog::backdrop { background: rgba(11, 31, 67, .42); backdrop-filter: blur(3px); }
#toast { border: 1px solid #d8e4f2; border-radius: 10px; }

@media (max-width: 900px) {
  .project-insight-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-insight-strip > div { min-height: 82px; }
}
@media (max-width: 760px) {
  body::before { display: none; }
  .project-insight-strip { margin-bottom: 18px; }
  .project-insight-strip > div { padding: 13px 14px 11px; min-height: 74px; }
  .project-insight-strip strong { font-size: 22px; }
  .overview-band { margin-top: 0; }
  .filter-pills { width: 100%; }
  .filter-pills button { flex: 1; }
}

/* Project node editing: keep the next action visible on every task card. */
.node-box .node-edit { align-self:flex-start; margin-top:4px; padding:6px 10px; border:1px solid #c8dbf5; border-radius:7px; background:#fff; color:#1e6fe6; font-size:12px; }
.node-box .node-edit:hover { background:#edf5ff; border-color:#9ebfe9; }
.node-edit.compact { display:inline-flex; margin-top:8px; padding:5px 9px; font-size:11px; border:1px solid #c8dbf5; border-radius:6px; background:#f5f9ff; color:#1e6fe6; }
.node-editor-heading { margin-bottom:18px; }
.node-editor-heading .quiet-note { margin-bottom:0; }
.week-task-main { display:grid; gap:5px; width:100%; min-width:0; }
.week-task-main b { overflow-wrap:anywhere; }
.week-task-actions { display:flex; gap:8px; align-items:center; padding-top:9px; margin-top:4px; border-top:1px solid #e7edf6; }
.week-task-actions .card-link { margin-right:auto; }
.week-task-actions button { font-size:12px; padding:6px 9px; }
.board .week-task-actions { margin-top:3px; }
.board .week-task-actions .subtle { color:#1e6fe6; background:#f4f8ff; border-color:#d4e3f8; }
.data-table .node-edit { white-space:nowrap; }
@media(max-width:760px){.node-box .node-edit{width:max-content}.week-task-actions{flex-wrap:wrap}.week-task-actions .card-link{margin-right:auto}}
