:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #162033;
  --muted: #667085;
  --line: #e2e8f0;
  --line-soft: #edf1f6;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --green: #16835b;
  --red: #d64545;
  --amber: #b7791f;
  --purple: #7c3aed;
  --blue: #2563eb;
  --gray: #667085;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 24px -20px rgba(16, 24, 40, 0.22);
  --font-sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--font-sans); }
h1 { font-size: 28px; font-weight: 650; margin: 0 0 5px; letter-spacing: -0.025em; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 650; margin: 0 0 12px; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
ul { margin: 0; padding-left: 18px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 8px 11px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}
textarea { resize: vertical; }
select[multiple] { padding: 6px; }
button { cursor: pointer; }
svg { display: block; }

/* app shell */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.sidebar {
  width: 236px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}
.sidebar-head {
  height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar-close { display: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav-label {
  display: block;
  padding: 14px 10px 6px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.nav-label:first-child { padding-top: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  margin: 2px 0;
}
.nav-item:hover { background: #f4f7fb; color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 650; }
.nav-item svg, .icon-btn svg, .btn-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.nav-item svg { width: 17px; height: 17px; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
}
.user-card:hover { background: #f4f7fb; text-decoration: none; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 11px; color: var(--muted); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: #f4f7fb; color: var(--text); }
.logout-btn { flex: none; }
.sidebar-head .sidebar-close { display: none; }
.menu-toggle { display: none; }

.app-header {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.app-header-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.app-header-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: #94a3b8; }
.app-header-title strong {
  font-size: 14px;
  font-weight: 650;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.container { flex: 1 0 auto; width: 100%; max-width: 1260px; margin: 0 auto; padding: 26px 30px 54px; }
.footer {
  margin-top: auto;
  padding: 18px 30px 28px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: #98a2b3;
  font-size: 12px;
}
.sidebar-scrim { display: none; }

/* auth */
.auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  border-top: 4px solid var(--primary);
  box-shadow: 0 24px 60px -38px rgba(16, 24, 40, 0.55);
}
.login-card h1 { margin-bottom: 0; font-size: 27px; }
.login-card .field { margin: 0; }
.login-card .btn { margin-top: 4px; }

/* utilities */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.text-red { color: var(--red) !important; }
.text-amber { color: var(--amber) !important; }
.inline { display: inline-block; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 13px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:hover { background: #f8fafc; text-decoration: none; border-color: #cbd5e1; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: #fff; }
.btn-danger-ghost { background: #fff; border-color: #fecaca; color: #b42318; }
.btn-danger-ghost:hover { background: #fef3f2; border-color: #fca5a5; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 5px; }
.btn-block { width: 100%; }
.btn-icon { width: 16px; height: 16px; stroke-width: 1.7; }
.btn-xs .btn-icon { width: 14px; height: 14px; }

/* page structure */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head > div:first-child { min-width: 0; }
.page-head h1 { font-size: 27px; }
.page-head .muted { color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { margin: 0; }
.card > h2 { padding-bottom: 11px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid-2 > .card { margin-bottom: 0; }

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.stat-label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.stat strong {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat strong .muted { font-size: 14px; font-weight: 500; }
.stat .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; margin: 0; min-width: 0; }
.field > span { font-size: 11.5px; color: #475569; font-weight: 600; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.col-span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.popover-form {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: 0 14px 30px -26px rgba(16, 24, 40, 0.5);
}
.popover-form.wide { max-width: 920px; }
.link-btn { color: var(--primary); cursor: pointer; font-size: 13px; display: inline-block; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.check input { width: auto; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 7px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.subhead-title { margin: 14px 0 2px; font-size: 13px; color: #475569; }
.collaboration-table .sticky-col { position: sticky; left: 0; background: #fff; z-index: 2; }
.collaboration-table th.sticky-col { background: #f8fafc; z-index: 3; }
.collaboration-table td { vertical-align: top; }

/* flash */
.flash {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 390px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 16px 36px -20px rgba(16, 24, 40, 0.45);
  animation: flash-in 0.2s ease-out;
  transition: opacity 0.2s, transform 0.2s;
}
.flash-ok { background: #ecfdf3; border: 1px solid #abefc6; color: #067647; }
.flash-err { background: #fef3f2; border: 1px solid #fecdca; color: #b42318; }
.flash-close {
  border: 0;
  background: transparent;
  color: currentColor;
  opacity: 0.55;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  margin-left: auto;
}
.flash-close:hover { opacity: 1; }
.flash-out { opacity: 0; transform: translateY(-6px); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* badges */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.55;
  white-space: nowrap;
}
.badge-gray { background: #f2f4f7; color: #475467; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: #ecfdf3; color: #067647; }
.badge-red { background: #fef3f2; color: #b42318; }
.badge-amber { background: #fffaeb; color: #b54708; }
.badge-purple { background: #f5f3ff; color: #6d28d9; }

/* tables */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.table th {
  font-size: 11px;
  color: #667085;
  font-weight: 650;
  letter-spacing: 0.04em;
  background: #f8fafc;
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fbff; }
.table.compact th, .table.compact td { padding: 8px 10px; }
.row-muted { opacity: 0.55; }
.strong-link { font-weight: 600; color: var(--text); }
.strong-link:hover { color: var(--primary); }
.actions-cell { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; }
.task-actions { min-width: 150px; }
.task-actions .popover-form { min-width: 220px; }
.child-toggle { border: 0; cursor: pointer; font-family: inherit; }
.select-sm { padding: 3px 6px; font-size: 12px; border-radius: 6px; width: auto; }

/* progress */
.progress { position: relative; height: 7px; background: #e9eef5; border-radius: 3px; overflow: hidden; }
.progress.slim { height: 4px; background: #e9eef5; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; }
.progress-mark { position: absolute; top: -2px; width: 2px; height: 11px; background: var(--amber); }
.progress-row { display: flex; flex-direction: column; gap: 3px; min-width: 140px; }
.mini-progress { display: flex; gap: 3px; margin-bottom: 3px; }
.mini-progress .seg { height: 5px; width: 14px; border-radius: 1px; background: #e4e9f1; }
.mini-progress .seg.on { background: var(--green); }
.mini-progress .seg.doing { background: var(--primary); }
.mini-progress .seg.late { background: var(--red); }
.health-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.health-green { background: var(--green); }
.health-amber { background: var(--amber); }
.health-red { background: var(--red); }
.health-gray { background: #cbd5e1; }

/* kv & notes */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 7px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 11.5px; }
.kv dd { margin: 0; }
.note {
  margin-top: 14px;
  padding: 11px 13px;
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  color: #475569;
  font-size: 13px;
}

/* phases & milestones */
.phase-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px 10px;
  margin-bottom: 12px;
  background: #fff;
}
.phase-block:last-child { margin-bottom: 0; }
.phase-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line-soft);
}
.phase-head > div:first-child { min-width: 220px; }
.phase-progress { flex: 1; max-width: 220px; }
.milestone-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(140px, 0.6fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
}
.milestone-row:last-child { border-bottom: 0; }
.milestone-row:hover { background: #f8fbff; }
.milestone-main { display: flex; align-items: flex-start; gap: 11px; }
.ms-dot { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); margin-top: 7px; flex: none; }
.ms-dot.gray { background: #cbd5e1; }
.ms-dot.blue { background: var(--primary); }
.ms-dot.green { background: var(--green); }
.ms-dot.red { background: var(--red); }
.ms-dot.amber { background: var(--amber); }
.milestone-bar { display: flex; align-items: center; gap: 8px; }
.milestone-bar .progress { flex: 1; }
.milestone-actions { display: flex; align-items: center; gap: 4px; }
.gate-note { margin: -3px 0 8px 30px; color: var(--muted); font-size: 12px; font-style: italic; }

/* tabs */
.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 5px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tab-link:hover { background: #f4f7fb; color: var(--text); text-decoration: none; }
.tab-link.active { background: var(--primary-soft); color: var(--primary-dark); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tab-in 0.15s ease-out; }
@keyframes tab-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* toolbar & filters */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; }
.toolbar-search { flex: 1 1 260px; max-width: 420px; }
.toolbar-search input { background: #f8fafc; }
.toolbar select { width: auto; min-width: 130px; }
.toolbar-count { margin-left: auto; white-space: nowrap; }
.filter-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.seg-buttons { display: inline-flex; background: #f1f5f9; border-radius: 7px; padding: 3px; gap: 2px; }
.seg-btn { border: none; background: transparent; padding: 5px 12px; border-radius: 5px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg-btn:hover { text-decoration: none; color: var(--text); }
.seg-btn.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); font-weight: 650; }

/* links & updates */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.link-list li:last-child { border-bottom: none; }
.link-list li a { font-weight: 500; }
.update-item { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.update-item:first-of-type { border-top: none; }
.update-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }

/* assignments */
.assign-row { display: grid; grid-template-columns: minmax(140px, 1fr) 90px 90px auto; gap: 8px; align-items: center; margin-bottom: 8px; }

/* phase -> milestone picker */
.ms-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* task hierarchy */
tr.task-child td:first-child { padding-left: 32px; }
tr.task-child td { background: #f8fafc; }
.table tbody tr.task-child:hover td { background: #f1f5f9; }
.child-link::before { content: "↳ "; color: #94a3b8; font-weight: 400; }

/* resources */
.legend-row { display: flex; gap: 16px; margin-bottom: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.lg-ok { background: #dcfae6; border: 1px solid #a6f4c5; }
.lg-warn { background: #fef0c7; border: 1px solid #fedf89; }
.lg-over { background: #fee4e2; border: 1px solid #fecdca; }
.lg-todo { background: #cbd5e1; }
.lg-doing { background: #60a5fa; }
.lg-done { background: #16835b; }
.lg-blocked { background: #d64545; }
.lg-ms { background: #7c3aed; transform: rotate(45deg); width: 8px; height: 8px; }
.resource-table th, .resource-table td { white-space: nowrap; }
.resource-table .sticky-col { position: sticky; left: 0; background: #fff; z-index: 2; }
.resource-table th.sticky-col { background: #f8fafc; z-index: 3; }
.resource-table .week-col { text-align: center; font-size: 12px; min-width: 46px; }
.util-ok { background: #f0fdf4; }
.util-warn { background: #fffaeb; color: #b54708; }
.util-over { background: #fef3f2; color: #b42318; font-weight: 700; }

/* gantt */
.gantt-toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 16px; }
.gantt-card { padding: 0; overflow: hidden; }
.gantt-loading { padding: 60px; text-align: center; color: var(--muted); }
.gantt-shell { display: flex; align-items: stretch; }
.gantt-left { flex: none; border-right: 1px solid var(--line); background: #fff; }
.gantt-left-head { display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 600; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); }
.gantt-left-row { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.gantt-left-row.task { cursor: pointer; }
.gantt-left-row.task:hover { background: #f8fbff; }
.gantt-left-row.task .task-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-left-row.task .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gantt-left-row.task.parent .task-name { font-weight: 700; color: #1e293b; }
.gantt-left-row.task.depth-1 { padding-left: 32px; }
.gantt-left-row.task.depth-1 .task-name { color: #475569; }
.gantt-left-row.phase { background: #f8fafc; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.gantt-left-row.phase .phase-name { font-weight: 700; font-size: 13px; }
.gantt-right { overflow-x: auto; overflow-y: hidden; flex: 1; }
.gantt-svg { display: block; }
.gantt-svg text { font-family: inherit; }
.gantt-month { font-size: 12px; font-weight: 600; fill: #334155; }
.gantt-sub { font-size: 11px; fill: #667085; }
.gantt-day { font-size: 10px; fill: #94a3b8; }
.gantt-today { font-size: 11px; fill: var(--red); font-weight: 600; }
.gantt-bar { cursor: pointer; }
.gantt-bar:hover rect { filter: brightness(0.96); }
.gantt-bar-label { font-size: 10px; fill: #667085; }
.gantt-nodate { font-size: 11px; fill: #94a3b8; }
.gantt-ms-label { font-size: 11px; fill: #7c3aed; }
.bar-todo { fill: #cbd5e1; }
.bar-doing { fill: #60a5fa; }
.bar-blocked { fill: #f87171; }
.bar-done { fill: #34d399; }
.bar-canceled { fill: #e2e8f0; }
.bar-progress { fill: #2563eb; opacity: 0.5; }
.bar-parent { fill: #1e293b; }
.bar-parent-progress { fill: #0ea5e9; opacity: 0.7; }
.gantt-svg .bar-done + .bar-progress, .gantt-svg .bar-done ~ .bar-progress { opacity: 0.55; }

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 20px 18px 48px; }
  .milestone-row { grid-template-columns: 1fr; }
  .assign-row { grid-template-columns: 1fr 1fr; }
  .ms-picker { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .app-header { padding: 0 18px; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 18px 0 40px -30px rgba(16, 24, 40, 0.5);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open { overflow: hidden; }
  .sidebar-head .sidebar-close { display: inline-flex; }
  .menu-toggle { display: inline-flex; }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .flash { left: 16px; right: 16px; top: 72px; max-width: none; }
}

@media (max-width: 600px) {
  h1 { font-size: 24px; }
  .page-head { padding: 16px; }
  .page-head h1 { font-size: 24px; }
  .container { padding: 16px 14px 40px; }
  .app-header { padding: 0 14px; height: 58px; }
  .app-header-title strong { max-width: 180px; }
  .app-header-eyebrow { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .page-head { gap: 12px; flex-direction: column; align-items: stretch; }
  .page-head .actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head .actions .btn, .page-head .actions form { width: 100%; }
  .milestone-row { padding-left: 0; padding-right: 0; }
  .phase-head { flex-wrap: wrap; }
  .phase-head > div:first-child { min-width: 0; }
  .filter-form { margin-left: 0; width: 100%; }
  .toolbar-count { width: 100%; margin-left: 0; }
  .tabs { border-radius: 8px; }
}

@media (max-width: 430px) {
  .app-header-title strong { max-width: 150px; }
}
