/* =========================================================================
   ONEYE IoT project cockpit — single stylesheet, no build step.
   Light Feishu-like surface, blue accent, dense but airy data views.
   ========================================================================= */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f0f3f9;
  --text: #1c2230;
  --text-2: #4a5163;
  --muted: #7a8194;
  --muted-2: #a3a9b8;
  --border: #e8eaf0;
  --border-strong: #d9dde7;
  --primary: #3370ff;
  --primary-600: #2b5fe0;
  --primary-weak: #eaf1ff;
  --primary-soft: #f3f7ff;
  --green: #16a34a;
  --green-weak: #e8f7ee;
  --orange: #f5a623;
  --orange-weak: #fff6e6;
  --red: #e5484d;
  --red-weak: #feecec;
  --purple: #8b5cf6;
  --purple-weak: #f3ecff;
  --cyan: #0ea5b7;
  --cyan-weak: #e6f8fa;
  --shadow-sm: 0 1px 2px rgba(22, 29, 45, 0.05);
  --shadow: 0 10px 30px rgba(22, 29, 45, 0.08);
  --shadow-lg: 0 28px 70px rgba(17, 24, 39, 0.22);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 236px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button {
  font-family: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.muted {
  color: var(--muted);
}

/* ------------------------------------------------------------- boot screen */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at 30% 20%, #eaf1ff, transparent 55%),
    radial-gradient(circle at 70% 80%, #eef7f6, transparent 50%), var(--bg);
  color: var(--muted);
}

.boot-logo,
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3370ff, #1b3b7a);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -1px;
  box-shadow: 0 10px 24px rgba(51, 112, 255, 0.3);
}

.boot-logo {
  width: 56px;
  height: 56px;
  font-size: 28px;
  animation: bootPulse 1.4s ease-in-out infinite;
}

@keyframes bootPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 24px rgba(51, 112, 255, 0.3);
  }
  50% {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 38px rgba(51, 112, 255, 0.36);
  }
}

/* ------------------------------------------------------------ login screen */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 64px clamp(36px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background: linear-gradient(140deg, #0c1734 0%, #122a5c 52%, #1d4a9e 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -180px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 140, 255, 0.45), transparent 65%);
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 30% 40%, rgba(0, 0, 0, 0.8), transparent 75%);
}

.login-brand > * {
  position: relative;
  z-index: 1;
}

.login-brand .brand-mark.large {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 27px;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.login-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 18px;
}

.login-brand h1 {
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.login-lead {
  max-width: 460px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 34px;
}

.login-points {
  list-style: none;
  margin: 0 0 44px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.login-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.82);
}

.point-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6ea0ff;
  box-shadow: 0 0 0 4px rgba(110, 160, 255, 0.16);
}

.login-foot {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.42);
  flex-wrap: wrap;
}

.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 32px;
  background: linear-gradient(180deg, #fbfcff, #f4f6fa);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 34px 32px 28px;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 16px;
}

.login-card-head h2 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.login-card-head p {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 26px;
}

.login-field span {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

.password-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 0 8px 0 13px;
  color: var(--muted);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.password-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12);
}

.password-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  height: 100%;
}

.login-error {
  min-height: 20px;
  margin: 10px 0 4px;
  color: var(--red);
  font-size: 12.5px;
}

.login-hint {
  margin-top: 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 11.5px;
}

.login-secure {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 11.5px;
  max-width: 380px;
  text-align: center;
}

/* ------------------------------------------------------------------ shell */
.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 16px;
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 14.5px;
  font-weight: 650;
}

.brand-text span {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.14s, color 0.14s;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-weak);
  color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  display: inline-flex;
  color: currentColor;
  opacity: 0.82;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.nav-item.active .nav-badge {
  background: #fff;
  color: var(--primary);
}

.sidebar-source {
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.sidebar-source strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
}

.sidebar-source span:not(.source-pulse) {
  font-size: 10.5px;
  color: var(--muted);
}

.source-pulse {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.user-avatar {
  background: linear-gradient(135deg, #3370ff, #6f9bff);
  color: #fff !important;
  font-size: 13px !important;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.user-info strong {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: 10.5px;
  color: var(--muted-2);
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-heading h1 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.page-heading p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.today-label {
  font-size: 11.5px;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.menu-toggle {
  display: none !important;
}

.refresh-btn.spinning .icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------- filterbar */
.filterbar {
  position: sticky;
  top: 72px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 11px 26px;
  background: rgba(244, 246, 250, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 286px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.1);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--text);
}

.filterbar select {
  height: 34px;
  padding: 0 28px 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a8194' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  appearance: none;
  font-size: 12.5px;
  color: var(--text-2);
  outline: 0;
  cursor: pointer;
}

.filterbar select:focus {
  border-color: var(--primary);
}

.filterbar .btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.filter-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted-2);
}

/* -------------------------------------------------------------- primitives */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s, color 0.14s, box-shadow 0.14s;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(51, 112, 255, 0.22);
}

.btn-primary:hover {
  background: var(--primary-600);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-ghost {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-2);
}

.btn-ghost:hover {
  border-color: #c5cbd8;
  color: var(--text);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #d33a3f;
}

.btn-danger-text {
  color: var(--red) !important;
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.btn-lg {
  height: 46px;
  font-size: 14px;
  border-radius: 11px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: var(--red-weak);
  color: var(--red);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--av-bg, #eef1f7);
  color: var(--av-fg, #4a5163);
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  border: 1.5px solid #fff;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
}

.avatar-stack .avatar + .avatar {
  margin-left: -7px;
}

.avatar-more {
  background: #eef1f7 !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}

.avatar-empty {
  color: var(--muted-2);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.status-todo {
  background: var(--orange-weak);
  color: #b97400;
}

.status-doing {
  background: var(--primary-weak);
  color: var(--primary-600);
}

.status-research {
  background: var(--purple-weak);
  color: #6d3fd4;
}

.status-done {
  background: var(--green-weak);
  color: #127a38;
}

.status-none {
  background: var(--surface-3);
  color: var(--muted);
}

.prio-p0 {
  background: var(--red-weak);
  color: #c02a30;
}

.prio-p1 {
  background: var(--orange-weak);
  color: #b97400;
}

.prio-p2 {
  background: var(--primary-weak);
  color: var(--primary-600);
}

.prio-p3 {
  background: var(--purple-weak);
  color: #6d3fd4;
}

.prio-none {
  background: var(--surface-3);
  color: var(--muted-2);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: 1px;
  white-space: nowrap;
}

.source-imported {
  background: #eef2f7;
  color: #5a6479;
}

.source-derived {
  background: var(--purple-weak);
  color: #6d3fd4;
}

.source-manual {
  background: var(--cyan-weak);
  color: #0b7f8e;
}

/* ------------------------------------------------------------------- views */
.view {
  padding: 20px 26px 60px;
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: viewIn 0.24s ease;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.1px;
}

.card-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  font-weight: 400;
}

.card-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.grid-2 .card.span-2 {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h3 {
  font-size: 15px;
  font-weight: 650;
}

.section-head span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------- hero */
.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(125deg, #0e1b3d 0%, #16356f 55%, #2457b8 100%);
  box-shadow: 0 18px 44px rgba(20, 45, 100, 0.24);
}

.hero-card::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -120px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 160, 255, 0.5), transparent 62%);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.35;
  mask-image: linear-gradient(90deg, #000 20%, transparent 75%);
}

.hero-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 12px;
}

.hero-card h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.hero-desc {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12.5px;
  max-width: 640px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(4px);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-live {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(134, 239, 172, 0.25);
  color: #c9f7d8;
}

.filtered-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffd88a;
  margin-left: 6px;
}

.hero-side {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.hero-ring {
  position: relative;
  width: 138px;
  height: 138px;
}

.hero-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 9;
}

.ring-value {
  fill: none;
  stroke: #8fb6ff;
  stroke-width: 9;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(143, 182, 255, 0.5));
}

.hero-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.hero-ring-label strong {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.hero-ring-label span {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.6);
}

/* -------------------------------------------------------------------- kpi */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-blue .kpi-icon {
  background: var(--primary-weak);
  color: var(--primary);
}

.kpi-cyan .kpi-icon {
  background: var(--cyan-weak);
  color: var(--cyan);
}

.kpi-green .kpi-icon {
  background: var(--green-weak);
  color: var(--green);
}

.kpi-orange .kpi-icon {
  background: var(--orange-weak);
  color: #b97400;
}

.kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--muted);
}

.kpi-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.25;
}

.kpi-sub {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----------------------------------------------------------------- charts */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 170px;
}

.donut {
  width: 170px;
  height: 170px;
  flex-shrink: 0;
}

.donut-total {
  font-size: 24px;
  font-weight: 700;
  fill: var(--text);
}

.donut-label {
  font-size: 10px;
  fill: var(--muted);
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-label {
  color: var(--text-2);
  flex: 1;
}

.legend-value {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-top: 4px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.bar-label {
  width: 46px;
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 600;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.prio-fill-p0 {
  background: linear-gradient(90deg, #f06a6f, #e5484d);
}

.prio-fill-p1 {
  background: linear-gradient(90deg, #ffc46b, #f5a623);
}

.prio-fill-p2 {
  background: linear-gradient(90deg, #6f9bff, #3370ff);
}

.prio-fill-p3 {
  background: linear-gradient(90deg, #b18cff, #8b5cf6);
}

.prio-fill-未设置 {
  background: #c9cdd4;
}

.bar-value {
  width: 22px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

/* ----------------------------------------------------------------- module */
.module-list {
  display: grid;
  gap: 4px;
}

@media (min-width: 1081px) {
  .module-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }

  .module-more {
    grid-column: 1 / -1;
  }
}

.module-row {
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.14s;
}

.module-row:hover {
  background: var(--surface-2);
}

.module-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.module-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.module-name {
  font-size: 12.5px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.module-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.module-bar > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f9bff, #3370ff);
  transition: width 0.4s ease;
}

.module-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.module-more {
  padding: 8px 10px 2px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}

.derived-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b5cf6;
  flex-shrink: 0;
  opacity: 0.8;
}

.mini-status {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 500;
}

/* -------------------------------------------------------------- activity */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-row {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 9px;
}

.activity-row:hover {
  background: var(--surface-2);
}

.activity-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-main {
  min-width: 0;
}

.activity-main p {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.activity-main strong {
  color: var(--text);
  font-weight: 600;
}

.activity-target {
  color: var(--primary);
  margin-left: 4px;
}

.activity-time {
  font-size: 10.5px;
  color: var(--muted-2);
}

/* ------------------------------------------------------------ dependency */
.dep-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dep-block h4 {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.dep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  margin-bottom: 6px;
  font-size: 11.5px;
  flex-wrap: wrap;
}

.dep-source {
  color: var(--text-2);
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dep-arrow {
  color: var(--muted-2);
  display: inline-flex;
}

.dep-target {
  color: var(--text);
  font-weight: 600;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dep-label {
  margin-left: auto;
  font-size: 10px;
  color: var(--purple);
  background: var(--purple-weak);
  padding: 1px 6px;
  border-radius: 5px;
}

.risk-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fffaf3;
  border: 1px solid #fcebc8;
  margin-bottom: 7px;
}

.risk-icon {
  color: #b97400;
  display: inline-flex;
  margin-top: 1px;
}

.risk-row strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.risk-row span:not(.risk-icon) {
  font-size: 11px;
  color: var(--muted);
}

/* ----------------------------------------------------------------- notice */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}

.notice-derive {
  background: linear-gradient(120deg, #f4f8ff, #f8f5ff);
  border-color: #dfe8ff;
}

.notice-info {
  background: var(--primary-soft);
  border-color: #dfe8ff;
}

.notice-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.notice-main {
  flex: 1;
  min-width: 0;
}

.notice-main strong {
  font-size: 13px;
  font-weight: 650;
}

.notice-main p {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.7;
}

.notice-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------- view toolbar */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toolbar-count {
  font-size: 12.5px;
  color: var(--text-2);
}

.toolbar-count strong {
  color: var(--text);
  font-weight: 700;
}

.toolbar-sub {
  font-size: 11px;
  color: var(--muted-2);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-3);
  gap: 2px;
}

.seg-btn {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
}

.seg-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
  padding: 0 6px;
  white-space: nowrap;
}

.switch-inline input {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
}

/* ----------------------------------------------------------------- kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(255px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-column {
  background: #edf0f7;
  border-radius: 14px;
  padding: 9px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  background: transparent;
}

.column-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: currentColor;
}

.kanban-column-head.status-doing {
  color: var(--primary);
  background: rgba(51, 112, 255, 0.08);
}

.kanban-column-head.status-todo {
  color: #b97400;
  background: rgba(245, 166, 35, 0.1);
}

.kanban-column-head.status-research {
  color: #6d3fd4;
  background: rgba(139, 92, 246, 0.09);
}

.kanban-column-head.status-done {
  color: var(--green);
  background: rgba(22, 163, 74, 0.09);
}

.kanban-column-head.status-none {
  color: var(--muted);
  background: rgba(122, 129, 148, 0.09);
}

.column-title {
  font-size: 12.5px;
  font-weight: 650;
}

.column-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.kanban-column-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 90px;
  max-height: calc(100vh - 336px);
  overflow-y: auto;
  border-radius: 10px;
  padding: 2px;
  transition: background 0.14s, box-shadow 0.14s;
  scrollbar-width: thin;
}

.kanban-column-body.drag-over {
  background: rgba(51, 112, 255, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(51, 112, 255, 0.4);
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}

.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(22, 29, 45, 0.09);
  border-color: #d5dbe8;
}

.kanban-card.dragging {
  opacity: 0.45;
  transform: rotate(1.5deg);
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.module-tag {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 9px;
  word-break: break-word;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.kanban-date {
  font-size: 10.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.kanban-note {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 5px 7px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-progress {
  display: flex;
  align-items: center;
  gap: 7px;
}

.kanban-progress-track {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.kanban-progress-track > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fb6ff, #3370ff);
}

.kanban-progress span {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.kanban-empty {
  text-align: center;
  padding: 26px 10px;
  color: var(--muted-2);
  font-size: 11.5px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
}

/* ------------------------------------------------------------------ gantt */
.gantt-view {
  gap: 14px;
}

.gantt-scroll {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: auto;
  max-height: calc(100vh - 252px);
}

.gantt-inner {
  display: flex;
  align-items: flex-start;
  width: max-content;
  min-width: 100%;
}

.gantt-left {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: 6px 0 14px -10px rgba(22, 29, 45, 0.18);
}

.gantt-left-head {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gantt-left-rows {
  display: flex;
  flex-direction: column;
}

.gantt-left-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 8px;
  border-bottom: 1px solid #f1f3f7;
  background: #fff;
}

.gantt-left-row:hover {
  background: var(--surface-2);
}

.gantt-left-row.is-group {
  background: #fafbfe;
}

.gantt-left-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-left-row.is-group .gantt-left-name {
  font-weight: 600;
  color: var(--text);
}

.gantt-left-owner {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.gantt-left-progress {
  width: 38px;
  text-align: right;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.tree-toggle {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.tree-toggle:hover {
  background: var(--surface-3);
  color: var(--text);
}

.tree-toggle.is-hidden {
  visibility: hidden;
}

.gantt-right {
  position: relative;
  flex: none;
}

.gantt-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fbfcfe;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.gantt-months,
.gantt-ticks {
  position: relative;
  height: 30px;
}

.gantt-month {
  position: absolute;
  top: 0;
  height: 30px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}

.gantt-tick {
  position: absolute;
  top: 0;
  height: 30px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--muted);
  overflow: hidden;
}

.gantt-tick.is-weekend {
  background: #f7f8fb;
}

.gantt-tick em {
  font-style: normal;
  font-size: 8.5px;
  color: var(--muted-2);
}

.gantt-tick.is-week span {
  font-size: 10px;
}

.gantt-tick.is-month span {
  font-size: 9.5px;
}

.gantt-body {
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--row-h) - 1px),
      #f1f3f7 calc(var(--row-h) - 1px),
      #f1f3f7 var(--row-h)
    );
}

.gantt-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gantt-grid-day {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(232, 234, 240, 0.7);
}

.gantt-grid-weekend {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(240, 242, 248, 0.65);
}

.gantt-grid-week {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(232, 234, 240, 0.9);
}

.gantt-grid-month {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1.5px dashed #e5484d;
  z-index: 4;
  pointer-events: none;
}

.gantt-today span {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9.5px;
  color: #e5484d;
  background: #fff0f0;
  border: 1px solid #ffd3d3;
  padding: 0 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.gantt-row {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--row-h);
  border-bottom: 1px solid transparent;
}

.gantt-row:hover {
  background: rgba(51, 112, 255, 0.025);
}

.gantt-bar {
  position: absolute;
  top: 9px;
  height: 21px;
  border-radius: 6px;
  background: #c8d3e8;
  display: flex;
  align-items: center;
  cursor: grab;
  z-index: 3;
  transition: box-shadow 0.14s;
  min-width: 6px;
  overflow: hidden;
}

.gantt-bar:hover {
  box-shadow: 0 2px 8px rgba(22, 29, 45, 0.18);
}

.gantt-bar.is-dragging {
  cursor: grabbing;
  z-index: 8;
  box-shadow: 0 8px 18px rgba(22, 29, 45, 0.24);
}

.gantt-bar.status-doing {
  background: #cfe0ff;
}

.gantt-bar.status-todo {
  background: #ffe7c2;
}

.gantt-bar.status-research {
  background: #e2d5ff;
}

.gantt-bar.status-done {
  background: #c9efd7;
}

.gantt-bar.status-none {
  background: #e1e5ec;
}

.gantt-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: #3370ff;
  opacity: 0.85;
  border-radius: 6px 0 0 6px;
}

.gantt-bar.status-doing .gantt-bar-fill {
  background: #3370ff;
}

.gantt-bar.status-todo .gantt-bar-fill {
  background: #f5a623;
}

.gantt-bar.status-research .gantt-bar-fill {
  background: #8b5cf6;
}

.gantt-bar.status-done .gantt-bar-fill {
  background: #16a34a;
}

.gantt-bar.status-none .gantt-bar-fill {
  background: #98a1b3;
}

.gantt-bar.is-derived {
  border: 1px dashed rgba(109, 63, 212, 0.5);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(139, 92, 246, 0.14) 0,
    rgba(139, 92, 246, 0.14) 4px,
    transparent 4px,
    transparent 9px
  );
}

.gantt-bar-label {
  position: relative;
  z-index: 2;
  margin-left: 7px;
  font-size: 10px;
  font-weight: 650;
  color: #14223d;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
}

.gantt-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  z-index: 3;
  cursor: ew-resize;
  opacity: 0;
  background: rgba(20, 34, 61, 0.22);
}

.gantt-bar:hover .gantt-handle {
  opacity: 1;
}

.gantt-handle-left {
  left: 0;
  border-radius: 6px 0 0 6px;
}

.gantt-handle-right {
  right: 0;
  border-radius: 0 6px 6px 0;
}

.gantt-summary {
  position: absolute;
  top: 13px;
  height: 13px;
  border-radius: 4px;
  background: #dfe5ef;
  z-index: 3;
  overflow: hidden;
}

.gantt-summary-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: #8fa8d8;
  opacity: 0.7;
}

.gantt-summary-label {
  position: relative;
  z-index: 2;
  font-size: 9.5px;
  padding-left: 6px;
  color: #2c3a57;
  font-weight: 600;
  white-space: nowrap;
  line-height: 13px;
}

.gantt-actual {
  position: absolute;
  top: 16px;
  width: 7px;
  height: 7px;
  background: #16a34a;
  border: 1.5px solid #fff;
  transform: rotate(45deg);
  border-radius: 1.5px;
  z-index: 4;
  box-shadow: 0 1px 4px rgba(22, 29, 45, 0.25);
}

.gantt-no-bar {
  position: absolute;
  top: 11px;
  font-size: 10px;
  color: var(--muted-2);
  white-space: nowrap;
  z-index: 2;
}

.gantt-links {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.gantt-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 6px;
  font-size: 11px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-bar {
  width: 18px;
  height: 8px;
  border-radius: 3px;
  background: #cfe0ff;
  display: inline-block;
}

.legend-bar.status-todo {
  background: #ffe7c2;
}

.legend-bar.status-research {
  background: #e2d5ff;
}

.legend-bar.is-derived {
  background: repeating-linear-gradient(
    -45deg,
    rgba(139, 92, 246, 0.35) 0,
    rgba(139, 92, 246, 0.35) 3px,
    transparent 3px,
    transparent 6px
  );
  border: 1px dashed rgba(109, 63, 212, 0.5);
}

.legend-diamond {
  width: 8px;
  height: 8px;
  background: #16a34a;
  transform: rotate(45deg);
  border-radius: 1.5px;
}

.legend-line {
  width: 0;
  height: 14px;
  border-left: 1.5px dashed #e5484d;
}

.legend-link {
  color: var(--muted);
}

/* ------------------------------------------------------------------ table */
.table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 268px);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1180px;
  font-size: 12px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f7;
  vertical-align: middle;
  color: var(--text-2);
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.data-table tbody tr.is-group {
  background: #fafbfe;
}

.data-table tr.is-group .task-name {
  font-weight: 600;
  color: var(--text);
}

.col-task {
  min-width: 280px;
}

.col-note {
  min-width: 220px;
  max-width: 300px;
}

.col-actions {
  width: 116px;
}

.tree-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.task-type-icon {
  color: var(--muted-2);
  display: inline-flex;
  flex-shrink: 0;
}

.task-type-icon.is-group {
  color: var(--primary);
}

.task-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.risk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e5484d;
  margin-left: 4px;
  flex-shrink: 0;
}

.team-chip {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 5px;
  background: #eef2ff;
  color: #3b5bdb;
  font-size: 11px;
  font-weight: 500;
}

.cell-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--muted);
}

.cell-progress {
  min-width: 130px;
}

.table-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-progress-track {
  width: 76px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.table-progress-track > div {
  height: 100%;
  border-radius: 999px;
}

.table-progress-track > .status-doing {
  background: var(--primary);
}

.table-progress-track > .status-todo {
  background: var(--orange);
}

.table-progress-track > .status-research {
  background: var(--purple);
}

.table-progress-track > .status-done {
  background: var(--green);
}

.table-progress-track > .status-none {
  background: #b9c0cd;
}

.table-progress span {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cell-note span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.cell-actions {
  white-space: nowrap;
}

.cell-actions .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
  font-size: 10.5px;
  color: var(--muted-2);
}

/* ----------------------------------------------------------------- blocks */
.block-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.block-summary-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.block-summary-item span {
  font-size: 11.5px;
  color: var(--muted);
}

.block-summary-item strong {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.block-summary-item small {
  font-size: 10.5px;
  color: var(--muted-2);
}

.matrix-card {
  overflow: hidden;
}

.matrix-scroll {
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 940px;
}

.matrix-table th {
  padding: 9px 10px;
  text-align: left;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.matrix-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f3f7;
  vertical-align: middle;
}

.matrix-table tbody tr:hover {
  background: var(--surface-2);
}

.matrix-module {
  min-width: 190px;
}

.matrix-module-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.matrix-module-cell strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.matrix-module-cell span:not(.block-icon):not(.pill) {
  font-size: 10.5px;
  color: var(--muted-2);
}

.block-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-weak);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.block-icon.small {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.matrix-cell {
  min-width: 132px;
}

.matrix-cell.empty {
  color: var(--muted-2);
}

.matrix-task {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 9px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.matrix-task:hover {
  border-color: #c5d4ff;
  box-shadow: 0 4px 12px rgba(51, 112, 255, 0.1);
}

.matrix-task-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  position: absolute;
  opacity: 0;
}

.matrix-task-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.matrix-task-info strong {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-task-info span {
  font-size: 9.5px;
  color: var(--muted-2);
  white-space: nowrap;
}

.matrix-task-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.matrix-task-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.matrix-task-bar i.status-doing {
  background: var(--primary);
}

.matrix-task-bar i.status-todo {
  background: var(--orange);
}

.matrix-task-bar i.status-research {
  background: var(--purple);
}

.matrix-task-bar i.status-done {
  background: var(--green);
}

.matrix-task-bar i.status-none {
  background: #b9c0cd;
}

.matrix-progress {
  display: flex;
  justify-content: flex-end;
}

.ring-sm {
  position: relative;
  flex-shrink: 0;
}

.ring-sm svg {
  display: block;
}

.ring-sm > span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text);
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.block-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.block-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(22, 29, 45, 0.1);
  border-color: #d7e0f5;
}

.block-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.block-title {
  flex: 1;
  min-width: 0;
}

.block-title h3 {
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 2px;
}

.block-title p {
  font-size: 10.5px;
  color: var(--muted-2);
}

.block-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.block-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.block-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.block-meta-row > span {
  color: var(--muted-2);
  width: 36px;
  flex-shrink: 0;
}

.block-meta-row strong {
  font-weight: 600;
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-segments {
  display: flex;
  gap: 2px;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}

.status-segment {
  height: 100%;
}

.status-segment.status-doing {
  background: var(--primary);
}

.status-segment.status-todo {
  background: var(--orange);
}

.status-segment.status-research {
  background: var(--purple);
}

.status-segment.status-done {
  background: var(--green);
}

.status-segment.status-none {
  background: #b9c0cd;
}

.block-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px dashed var(--border);
  font-size: 10.5px;
  color: var(--muted);
}

.dep-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--purple);
  background: var(--purple-weak);
  padding: 2px 7px;
  border-radius: 5px;
  max-width: 75%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-open {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--primary);
  font-weight: 550;
  opacity: 0;
  transition: opacity 0.14s;
  white-space: nowrap;
}

.block-card:hover .block-open {
  opacity: 1;
}

.flow-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.flow-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 11.5px;
}

.flow-node strong {
  font-weight: 600;
  color: var(--text);
}

.flow-node-label {
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.flow-node.source {
  border-left: 3px solid #98a1b3;
}

.flow-node.target {
  border-left: 3px solid var(--primary);
}

.flow-arrow {
  color: var(--muted-2);
  display: inline-flex;
}

.flow-label {
  margin-left: auto;
  font-size: 10px;
  color: var(--purple);
  background: var(--purple-weak);
  border-radius: 5px;
  padding: 2px 7px;
}

.module-detail-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.module-detail-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.module-detail-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-detail-progress > div {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.module-detail-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fb6ff, #3370ff);
}

.module-detail-progress span {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.module-task-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.module-task-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 11.5px;
  transition: border-color 0.14s, background 0.14s;
}

.module-task-row:hover {
  border-color: #c5d4ff;
  background: var(--primary-soft);
}

.task-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-dot.status-doing {
  background: var(--primary);
}

.task-dot.status-todo {
  background: var(--orange);
}

.task-dot.status-research {
  background: var(--purple);
}

.task-dot.status-done {
  background: var(--green);
}

.task-dot.status-none {
  background: #b9c0cd;
}

.module-task-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-task-date {
  color: var(--muted-2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.module-task-progress {
  width: 36px;
  text-align: right;
  font-weight: 650;
  color: var(--text-2);
}

/* --------------------------------------------------------------- settings */
.settings-stack {
  max-width: 980px;
}

.settings-card {
  padding: 20px 22px;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  max-width: 760px;
}

.settings-form .field {
  gap: 5px;
}

.form-actions {
  grid-column: 1 / -1;
}

.settings-rows {
  display: flex;
  flex-direction: column;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 2px;
  border-bottom: 1px solid #f1f3f7;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 2px;
}

.settings-row p {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 560px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.danger-row strong {
  color: var(--red);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.info-grid > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
}

.info-grid span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-bottom: 3px;
}

.info-grid strong {
  font-size: 12px;
  font-weight: 600;
}

.source-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.source-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.source-stat strong {
  font-size: 13px;
  color: var(--text);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 3px;
}

.dot.source-imported {
  background: #98a1b3;
}

.dot.source-derived {
  background: var(--purple);
}

.dot.source-manual {
  background: var(--cyan);
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.8;
}

.about-text strong {
  color: var(--text);
}

.about-text .muted {
  font-size: 11.5px;
  line-height: 1.7;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

/* --------------------------------------------------------------- feishu */
.sync-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  margin-right: 8px;
}

.sync-on {
  background: var(--green-weak);
  color: #127a38;
}

.sync-off {
  background: var(--surface-3);
  color: var(--muted);
}

.feishu-offline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feishu-help {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  font-size: 12px;
}

.feishu-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.feishu-help[open] summary {
  margin-bottom: 8px;
}

.feishu-steps {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--text-2);
  line-height: 1.9;
}

.feishu-steps code,
.feishu-help code,
.config-row code,
.feishu-offline code {
  font-family: var(--mono);
  font-size: 10.5px;
  background: #eef2f9;
  color: #2f4a86;
  padding: 1px 5px;
  border-radius: 4px;
}

.config-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.config-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}

.config-row:last-child {
  border-bottom: 0;
}

.config-row:nth-child(odd) {
  background: var(--surface-2);
}

.config-row span {
  color: var(--muted);
}

.feishu-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.feishu-meta-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  min-width: 0;
}

.feishu-meta-item span {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  margin-bottom: 2px;
}

.feishu-meta-item strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feishu-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.feishu-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
}

.feishu-mode select {
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 11.5px;
  background: #fff;
  color: var(--text-2);
}

.feishu-hint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted-2);
}

.feishu-result {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  background: #fbfcff;
}

.feishu-result.is-error {
  background: #fff7f7;
  border-color: #ffd9d9;
}

.feishu-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 12px;
}

.feishu-loading .icon {
  animation: spin 0.8s linear infinite;
}

.feishu-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
}

.diag-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--green);
  margin-bottom: 10px;
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.diag-grid > div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
}

.diag-grid span {
  display: block;
  font-size: 9.5px;
  color: var(--muted-2);
}

.diag-grid strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diag-details {
  margin-top: 8px;
  font-size: 11.5px;
}

.diag-details summary {
  cursor: pointer;
  color: var(--primary);
}

.field-chips,
.mapping-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.field-chip,
.mapping-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #eef2f9;
  color: #3a4f7d;
  font-size: 10.5px;
}

.field-chip em {
  font-style: normal;
  font-size: 9px;
  color: var(--muted-2);
}

.feishu-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--orange-weak);
  color: #a96a00;
  font-size: 11px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 11px;
  font-size: 11px;
}

.preview-table th {
  text-align: left;
  padding: 6px 8px;
  background: #f4f6fa;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.preview-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f3f7;
  color: var(--text-2);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 960px) {
  .feishu-meta-grid,
  .diag-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ---------------------------------------------------------------- forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.field > span {
  font-weight: 500;
}

.field em {
  color: var(--red);
  font-style: normal;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: 0;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.1);
}

.field textarea {
  resize: vertical;
  min-height: 58px;
}

.task-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.task-form .span-2 {
  grid-column: span 2;
}

.progress-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-field > span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-field b {
  color: var(--primary);
  font-size: 12px;
}

.progress-inputs {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-inputs input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  height: 4px;
}

.progress-inputs input[type="number"] {
  width: 78px;
}

/* ------------------------------------------------------------------- modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.16s;
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.99);
  transition: transform 0.18s;
  overflow: hidden;
}

.modal-overlay.show .modal {
  transform: none;
}

.modal-sm {
  max-width: 420px;
}

.modal-lg {
  max-width: 780px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.modal-head p {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
}

.modal-foot-left {
  margin-right: auto;
  display: flex;
  gap: 6px;
}

.modal-foot-right {
  display: flex;
  gap: 8px;
}

.confirm-text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.8;
}

.import-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-dialog .notice {
  padding: 12px 14px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.import-dialog .notice strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.import-mode {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--text-2);
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.radio input {
  accent-color: var(--primary);
}

/* ------------------------------------------------------------------ toast */
#toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 220px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: 11px;
  background: #182033;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-success .icon {
  color: #6ee7a0;
}

.toast-error .icon {
  color: #ff9a9d;
}

.toast-info .icon {
  color: #93b8ff;
}

/* ------------------------------------------------------------- empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-weak);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.empty-state p {
  font-size: 12px;
  color: var(--muted);
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .block-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kanban-board {
    grid-template-columns: repeat(5, minmax(240px, 1fr));
  }
}

@media (max-width: 1080px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    padding: 24px;
  }

  .hero-card h2 {
    font-size: 24px;
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    width: 236px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 20px 0 50px rgba(15, 23, 42, 0.18);
  }

  .sidebar.open {
    transform: none;
  }

  .main {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-flex !important;
  }

  .topbar {
    padding: 0 16px;
  }

  .filterbar {
    top: 72px;
    padding: 10px 16px;
  }

  .view {
    padding: 16px 16px 50px;
  }

  .today-label {
    display: none;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 44px 26px 36px;
  }

  .login-brand h1 {
    font-size: 28px;
  }

  .login-points,
  .login-foot {
    display: none;
  }

  .login-panel {
    padding: 28px 22px 48px;
    justify-content: flex-start;
  }

  .settings-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .block-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .kpi-grid,
  .block-summary,
  .block-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-side {
    align-self: center;
  }

  .donut-wrap {
    flex-direction: column;
    gap: 12px;
  }

  .donut {
    width: 150px;
    height: 150px;
  }

  .donut-legend {
    width: 100%;
  }

  .view-toolbar {
    align-items: flex-start;
  }

  .toolbar-actions {
    width: 100%;
  }

  .filterbar {
    gap: 7px;
  }

  .search-box {
    width: 100%;
  }

  .filter-count {
    display: none;
  }

  .modal {
    max-height: 94vh;
  }

  .task-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-form .span-2 {
    grid-column: auto;
  }

  .notice {
    flex-wrap: wrap;
  }

  .notice-actions {
    width: 100%;
  }

  .matrix-table {
    min-width: 820px;
  }

  .data-table {
    min-width: 1040px;
  }

  .settings-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .settings-row .row-actions {
    justify-content: flex-start;
  }

  .feishu-result {
    overflow-x: auto;
  }
}
