:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --sidebar: #0b1220;
  --sidebar-2: #111827;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #eef1f5;
  --line-2: #dbe1ea;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}
.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: rgba(255,255,255,0.68);
  display: flex;
  flex-direction: column;
}
.brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  letter-spacing: 0.01em;
}
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}
.menu { padding: 12px 10px; flex: 1; overflow: auto; }
.menu .group {
  padding: 14px 12px 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
}
.menu a {
  display: block;
  padding: 9px 12px;
  margin-bottom: 2px;
  color: rgba(255,255,255,0.68);
  border-radius: 6px;
  border-left: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.menu a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.menu a.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.92);
}

[data-nav],
[data-sel],
[data-goto],
[data-act] {
  cursor: pointer;
}

.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.topbar {
  height: 60px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 18px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.content > .page-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn {
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  height: 32px;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn:hover { border-color: #93c5fd; color: var(--primary); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.soft { background: var(--primary-soft); border-color: #bfdbfe; color: var(--primary); }
.btn.soft:hover { background: #dbeafe; }
.btn.warn { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--primary); background: var(--primary-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* —— 总览 —— */
.home-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.home-strip {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.home-eyebrow {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.home-strip h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.home-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 460px;
}
.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
}
.home-metric {
  min-width: 76px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  text-align: center;
}
.home-metric .n {
  font-size: 22px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.home-metric .l {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.home-metric.risk .n { color: var(--danger); }

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex-shrink: 0;
}
.module-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
  color: inherit;
}
.module-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}
.module-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.module-name {
  font-size: 14px;
  font-weight: 600;
}
.module-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.module-go {
  font-size: 12px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}
.module-pending {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.module-pending-n {
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}
.module-pending-l {
  font-size: 12px;
  color: var(--muted);
}
.module-bar {
  height: 4px;
  border-radius: 99px;
  background: #eef2f7;
  overflow: hidden;
}
.module-bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
}
.module-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.module-foot .risk-t { color: var(--danger); }
.module-focus {
  font-size: 12px;
  color: var(--ink);
  padding-top: 10px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-lower { flex: 1; min-height: 0; }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.todo-list.modern li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.todo-list.modern li:hover { background: #f8fafc; }
.todo-list .title { font-weight: 500; font-size: 13px; }
.todo-list .sub { color: var(--muted); font-size: 12px; margin-top: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.todo-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.todo-side { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.sys-badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  margin-top: 2px;
}

.status-list { display: flex; flex-direction: column; gap: 8px; }
.status-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.status-row:hover {
  border-color: #bfdbfe;
  background: var(--primary-soft);
}
.status-name { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.status-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}
.status-stats b {
  color: var(--ink);
  font-weight: 600;
  margin-right: 3px;
  font-variant-numeric: tabular-nums;
}
.status-focus {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-chip {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.panel-hd {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  box-sizing: border-box;
}
.panel-hd h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}
.panel-bd {
  padding: 16px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.panel-bd.flush { padding: 0; }

.layout-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
.layout-2 > .panel {
  height: 100%;
  min-height: 0;
}

.layout-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.layout-stack > .panel.ledger {
  flex: 0 0 auto;
  max-height: min(240px, 28vh);
}
.layout-stack > .panel.detail {
  flex: 1 1 auto;
  min-height: 0;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.field label {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.field label .conf { color: var(--primary); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 5px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
  height: 32px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { height: auto; min-height: 64px; padding: 8px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field input.ai-filled, .field textarea.ai-filled {
  background: var(--primary-soft);
  border-color: #91caff;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: 1 / -1; }

.section-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 4px;
  margin-bottom: 12px;
  background: #fff;
}
.section-block h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tr:hover td { background: #f8fafc; }
table.data tr.active td { background: var(--primary-soft); }
table.data tr { cursor: pointer; }
table.data .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #475569; }

.tag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.tag.info { background: var(--info-soft); color: var(--info); border-color: #bfdbfe; }
.tag.gray { background: #f8fafc; color: var(--muted); border-color: var(--line-2); }
.tag.ai { background: var(--primary-soft); color: var(--primary); border-color: #bfdbfe; }

.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.err {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #ffccc7;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
}
.notice {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #91caff;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius);
}
.kb-intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  cursor: pointer;
}
.kb-card.active, .kb-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.kb-card input { margin-top: 4px; }
.kb-card-body { flex: 1; min-width: 0; }
.kb-title { font-weight: 600; font-size: 14px; }
.kb-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.kb-desc { margin-top: 6px; font-size: 13px; color: var(--ink); }
.kb-tpl { margin-top: 6px; font-size: 12px; color: var(--primary); }


.detail-block { margin-bottom: 16px; }
.detail-block:last-child { margin-bottom: 0; }
.detail-block h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.detail-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.kv {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px 20px;
  font-size: 13px;
  flex: 1;
  min-width: 280px;
}
.kv .item { display: flex; flex-direction: column; gap: 2px; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { color: var(--ink); }
.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.file-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}
.file-item .n { font-weight: 500; font-size: 13px; }
.file-item .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

.steps {
  display: flex;
  gap: 0;
  overflow: auto;
  flex-shrink: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step {
  flex: 1;
  min-width: 96px;
  text-align: center;
  position: relative;
  padding: 14px 8px 12px;
}
.step::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 55%;
  width: 90%;
  height: 1px;
  background: var(--line-2);
  z-index: 0;
}
.step:last-child::after { display: none; }
.step .n {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: #f5f5f5;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 1px solid var(--line-2);
}
.step.done .n { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.current .n { background: #fff; border-color: var(--primary); color: var(--primary); }
.step .t { font-size: 12px; color: var(--muted); }
.step.done .t, .step.current .t { color: var(--ink); }

.board {
  display: grid;
  grid-template-columns: 140px 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.board .eq, .board .lane {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 64px;
}
.board .eq { background: #fafafa; font-weight: 500; font-size: 13px; }
.board .eq small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; font-size: 12px; }
.slot {
  display: inline-block;
  background: var(--primary-soft);
  border: 1px solid #91caff;
  color: var(--primary);
  border-radius: var(--radius);
  padding: 6px 10px;
  margin: 2px 6px 2px 0;
  min-width: 150px;
  font-size: 12px;
}
.slot strong { display: block; }
.slot span { opacity: 0.8; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 24px;
}
.modal {
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}
.modal-hd {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.modal-hd h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-bd { padding: 16px; }
.modal-ft {
  padding: 10px 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
}

.toolstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.toolstrip .sep {
  width: 1px;
  height: 20px;
  background: var(--line-2);
  margin: 0 2px;
}
.upload-mini { display: inline-flex; align-items: center; }
.upload-mini input { display: none; }
.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  color: var(--primary);
  font-size: 13px;
}
.ai-loading .spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #91caff;
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gantt-panel { flex: 0 0 auto; }
.gantt { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.gantt-hd {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.gantt-title { font-weight: 600; font-size: 13px; }
.gantt-period { color: var(--muted); font-size: 12px; }
.gantt-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 2px;
}
.gantt-scale, .gantt-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 56px;
}
.gantt-scale { border-bottom: 1px solid var(--line); background: #fcfcfd; min-height: 36px; }
.gantt-ticks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
}
.gantt-ticks span {
  text-align: center;
  border-left: 1px solid var(--line);
  padding: 8px 4px;
  white-space: nowrap;
}
.gantt-label {
  padding: 8px 12px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  font-size: 12px;
  position: sticky;
  left: 0;
  z-index: 2;
}
.gantt-label strong { display: block; font-size: 13px; }
.gantt-label small { color: var(--muted); }
.gantt-track {
  position: relative;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
.gantt-grid {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none;
}
.gantt-grid i {
  border-left: 1px solid var(--line);
  display: block;
}
.gantt-item {
  position: absolute;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
  max-width: none;
}
.gantt-bar {
  height: 28px;
  min-width: 14px;
  border-radius: 4px;
  background: #93c5fd;
  border: 1px solid #60a5fa;
  flex-shrink: 0;
  box-sizing: border-box;
}
.gantt-caption {
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.gantt-caption strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.gantt-caption span {
  font-size: 11px;
  color: var(--muted);
}
.gantt-bar.run { background: var(--primary); border-color: var(--primary-hover); }
.gantt-bar.wait { background: #fbbf24; border-color: #d97706; }
.gantt-bar.done { background: #86efac; border-color: #16a34a; }
.gantt-bar.risk { background: #fca5a5; border-color: #dc2626; }
.gantt-empty-lane {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  font-size: 12px;
  pointer-events: none;
}

.think-panel {
  border: 1px solid #bfdbfe;
  background: #f8fbff;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}
.think-panel.busy { border-color: #93c5fd; }
.think-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid #dbeafe;
  background: #eff6ff;
}
.think-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.think-bd {
  max-height: 160px;
  overflow: auto;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}
.think-line { color: #1e40af; }
.think-line.muted { color: var(--muted); }

.schedule-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(248, 250, 252, 0.78);
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--primary);
  font-weight: 600;
}
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #bfdbfe;
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
.schedule-lower { flex: 1; min-height: 0; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.mini-list .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.eq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.eq-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fafc;
}
.eq-card.free { background: #f0fdf4; border-color: #bbf7d0; }
.eq-card.busy { background: #fffbeb; border-color: #fde68a; }
.eq-card .sub { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.hint-line { margin-top: 8px; color: var(--muted); font-size: 12px; }
.kb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cfg-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #f8fafc;
}
.cfg-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cfg-card-hd h3 { margin: 0; font-size: 14px; }
.modal.modal-sm { width: min(480px, 100%); }
.notice.warn {
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .sidebar { display: none; }
  .workspace, .content { height: auto; overflow: visible; }
  .content > .page-stack, .layout-2, .layout-stack, .home-page { flex: none; min-height: auto; }
  .layout-2 > .panel, .layout-stack > .panel.ledger, .layout-stack > .panel.detail { height: auto; max-height: none; }
  .panel-bd { overflow: visible; }
  .module-grid, .layout-2, .form-grid, .form-grid.three, .kv, .kb-grid, .home-metrics { grid-template-columns: 1fr 1fr; }
  .home-strip { flex-direction: column; align-items: stretch; }
  .gantt-scale, .gantt-row { grid-template-columns: 140px minmax(0, 1fr); }
  .form-grid .span2, .form-grid .span3 { grid-column: auto; }
}
@media (max-width: 720px) {
  .module-grid, .home-metrics, .layout-2, .kb-grid { grid-template-columns: 1fr; }
}
