:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
}

.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  margin: 0 auto;
  padding: 32px 24px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.header h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header h1 svg {
  width: 24px;
  height: 24px;
}

.header p {
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }

.btn-outline {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}
.btn-ghost:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.btn-icon {
  width: 36px;
  padding: 0;
}

.btn-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-row-del {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s;
}
.btn-row-del:hover {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}
.btn-row-del svg { width: 14px; height: 14px; }

.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid hsl(var(--border));
  flex-wrap: wrap;
}

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

.field label {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid hsl(var(--input));
  border-radius: 6px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color-scheme: light dark;
}
.input:hover { border-color: hsl(var(--border)); }
.input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2); }

.stats-strip {
  display: flex;
  gap: 32px;
  margin-left: auto;
}

.stat {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}
.stat-value {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
  margin-top: 2px;
  font-family: 'Geist Mono', monospace;
}

.gantt {
  display: flex;
}

.gantt-names {
  width: 280px;
  min-width: 200px;
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  z-index: 3;
  position: relative;
}

.col-resize {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  bottom: 0;
  cursor: col-resize;
  z-index: 4;
  background: transparent;
  transition: background-color 0.15s;
  touch-action: none;
}
.col-resize::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 28px;
  background: transparent;
  border-radius: 1px;
  transition: background-color 0.15s;
}
.col-resize:hover::before,
.col-resize.active::before { background: hsl(var(--ring)); }
.col-resize:hover, .col-resize.active { background: hsl(var(--ring) / 0.08); }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing * { cursor: col-resize !important; }

.gantt-name-header {
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.3);
}

.gantt-name-row {
  height: 56px;
  padding: 0 8px 0 8px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  gap: 4px;
}
.gantt-name-row:last-child { border-bottom: none; }

.row-color {
  width: 8px;
  height: 28px;
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
}

.row-grip {
  width: 18px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground) / 0.5);
  cursor: grab;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
  touch-action: none;
}
.row-grip:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.row-grip:active { cursor: grabbing; }
.row-grip svg { width: 14px; height: 14px; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  flex-shrink: 0;
  border: none;
  padding: 0;
  letter-spacing: 0;
  outline: none;
  line-height: 1;
}
.avatar.unassigned {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: 1px dashed hsl(var(--border));
  font-size: 14px;
  font-weight: 400;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  outline: none;
  border-radius: 999px;
  transition: transform 0.1s, box-shadow 0.15s;
}
.avatar-stack:hover { transform: scale(1.04); }
.avatar-stack:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
.avatar-stack > .avatar + .avatar { margin-left: -8px; }
.avatar-stack .avatar {
  box-shadow: 0 0 0 2px hsl(var(--background));
}
.avatar-stack .avatar.unassigned {
  box-shadow: none;
}
.avatar-stack:hover .avatar.unassigned { color: hsl(var(--foreground)); border-color: hsl(var(--muted-foreground)); }
.avatar-stack-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  padding: 0 4px 0 6px;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.popover {
  position: fixed;
  z-index: 50;
  background: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 25px hsl(0 0% 0% / 0.12), 0 4px 8px hsl(0 0% 0% / 0.08);
  padding: 6px;
  width: 240px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}
.popover.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.popover-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  padding: 4px 6px 6px;
}
.popover-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid hsl(var(--input));
  border-radius: 6px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin: 0 0 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.popover-input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2); }
.popover-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 240px;
  overflow-y: auto;
}
.popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 6px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: hsl(var(--foreground));
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  transition: background-color 0.1s;
}
.popover-item:hover, .popover-item:focus-visible { background: hsl(var(--accent)); outline: none; }
.popover-item .pop-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.popover-item .pop-check {
  margin-left: auto;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: background-color 0.1s, border-color 0.1s, color 0.1s;
}
.popover-item .pop-check svg { width: 12px; height: 12px; }
.popover-item.checked .pop-check {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.popover-item.checked { background: hsl(var(--accent) / 0.5); }
.popover-hint {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  padding: 4px 6px 2px;
  text-align: right;
}
.popover-item.muted { color: hsl(var(--muted-foreground)); }
.popover-item.muted svg { opacity: 0.7; }
.popover-divider { height: 1px; background: hsl(var(--border)); margin: 4px 2px; }

.gantt-row.dragging-row,
.gantt-name-row.dragging-row {
  background: hsl(var(--accent));
  opacity: 0.55;
}

.row-input {
  flex: 1;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 14px;
  font-family: inherit;
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.row-input:hover { background: hsl(var(--accent)); }
.row-input:focus { background: hsl(var(--background)); border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2); }

.gantt-tl-wrap {
  flex: 1;
  overflow-x: auto;
}
.gantt-tl-wrap::-webkit-scrollbar { height: 8px; }
.gantt-tl-wrap::-webkit-scrollbar-track { background: transparent; }
.gantt-tl-wrap::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 4px;
}
.gantt-tl-wrap::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.5); }

.gantt-tl {
  position: relative;
}

.gantt-header {
  height: 56px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
  position: relative;
}

.gantt-months {
  height: 24px;
  display: flex;
  border-bottom: 1px solid hsl(var(--border));
  position: relative;
}

.gantt-month {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-right: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
}

.gantt-days {
  height: 32px;
  display: flex;
}

.gantt-day {
  width: 32px;
  min-width: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  border-right: 1px solid hsl(var(--border));
  text-transform: uppercase;
  font-weight: 500;
}

.gantt-day.weekend { background: hsl(var(--muted) / 0.5); }

.gantt-day .day-num {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.1;
  font-family: 'Geist Mono', monospace;
}

.gantt-day.weekend .day-num { color: hsl(var(--muted-foreground)); }

.gantt-day .day-wd { font-size: 9px; margin-top: 2px; letter-spacing: 0.04em; }

.gantt-day.today .day-num { color: hsl(var(--foreground)); }
.gantt-day.today {
  background: hsl(var(--primary) / 0.06);
  position: relative;
}

.gantt-rows { position: relative; }

.gantt-row {
  height: 56px;
  display: flex;
  border-bottom: 1px solid hsl(var(--border));
  position: relative;
}
.gantt-row:last-child { border-bottom: none; }
.gantt-row:hover { background: hsl(var(--muted) / 0.2); }

.gantt-cell {
  width: 32px;
  min-width: 32px;
  border-right: 1px solid hsl(var(--border) / 0.6);
}

.gantt-cell.weekend { background: hsl(var(--muted) / 0.4); }

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: hsl(var(--primary));
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

.gantt-bar {
  position: absolute;
  top: 14px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  z-index: 2;
  color: #fff;
  transition: filter 0.15s, transform 0.05s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.gantt-bar.has-avatar { padding-left: 4px; }
.gantt-bar:hover { filter: brightness(1.08); }
.gantt-bar.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.bar-avatars {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  pointer-events: none;
}
.bar-avatars > .bar-avatar + .bar-avatar { margin-left: -6px; }

.bar-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  letter-spacing: 0;
  line-height: 1;
}

.bar-avatars-more {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  padding: 0 2px 0 5px;
  letter-spacing: -0.02em;
}

.bar-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.bar-unassigned {
  background-image: repeating-linear-gradient(135deg,
    hsl(var(--muted-foreground) / 0.55),
    hsl(var(--muted-foreground) / 0.55) 6px,
    hsl(var(--muted-foreground) / 0.4) 6px,
    hsl(var(--muted-foreground) / 0.4) 12px);
}
.gantt-bar-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
}
.gantt-bar-handle::after {
  content: '';
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 12px;
  background: rgba(255,255,255,0.5);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.15s;
}
.gantt-bar:hover .gantt-bar-handle::after { opacity: 1; }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}
.empty-state svg { width: 32px; height: 32px; margin: 0 auto 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

.footer-hint {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid hsl(var(--border));
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.2);
  flex-wrap: wrap;
}

.kbd {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.tooltip {
  position: fixed;
  z-index: 100;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  font-family: 'Geist Mono', monospace;
  max-width: 280px;
}
.tooltip.visible { opacity: 1; }
.tooltip-title {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  padding: 0 0 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid hsl(var(--border));
  white-space: normal;
  line-height: 1.3;
}

.tooltip-row { display: flex; gap: 6px; align-items: center; }
.tooltip-label { color: hsl(var(--muted-foreground)); font-size: 11px; }

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 20px;
  position: relative;
}
.tab {
  position: relative;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -1px;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
}
.tab::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background-color 0.15s;
}
.tab:hover { color: hsl(var(--foreground)); }
.tab.active { color: hsl(var(--foreground)); }
.tab.active::after { background: hsl(var(--foreground)); }
.tab:focus-visible { color: hsl(var(--foreground)); }
.tab svg { width: 15px; height: 15px; }
.tab-badge {
  font-size: 10px;
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.tab-badge.zero { display: none; }

.view { display: none; }
.view.active { display: block; }

.workload-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ws-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ws-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}
.ws-value {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: 'Geist Mono', monospace;
  color: hsl(var(--foreground));
}
.ws-value.danger { color: hsl(var(--destructive)); }
.ws-value.sub {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
  font-family: inherit;
}

.wl-grid {
  display: flex;
}

.wl-people {
  width: 280px;
  min-width: 200px;
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  position: relative;
}

.wl-people-header,
.wl-tl-header {
  height: 56px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}

.wl-person {
  padding: 14px 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.wl-person:last-child { border-bottom: none; }

.wl-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}
.wl-avatar.unassigned {
  background: transparent;
  border: 1px dashed hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

.wl-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.wl-name {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 6px;
}
.wl-name .conflict-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--destructive));
  flex-shrink: 0;
}
.wl-name.unassigned { color: hsl(var(--muted-foreground)); font-weight: 500; }

.wl-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}
.wl-stats strong {
  color: hsl(var(--foreground));
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
}
.wl-stats .danger { color: hsl(var(--destructive)); }

.wl-util {
  margin-top: 6px;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: hsl(var(--muted));
  overflow: hidden;
  position: relative;
}
.wl-util-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: hsl(var(--foreground));
  border-radius: 2px;
  transition: width 0.2s;
}
.wl-util-fill.over { background: hsl(var(--destructive)); }

.wl-tl-wrap {
  flex: 1;
  overflow-x: auto;
}
.wl-tl-wrap::-webkit-scrollbar { height: 8px; }
.wl-tl-wrap::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 4px; }

.wl-tl {
  position: relative;
}

.wl-days {
  height: 56px;
  display: flex;
  background: hsl(var(--muted) / 0.3);
  border-bottom: 1px solid hsl(var(--border));
}

.wl-day {
  width: 32px;
  min-width: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  border-right: 1px solid hsl(var(--border));
  text-transform: uppercase;
  font-weight: 500;
}
.wl-day.weekend { background: hsl(var(--muted) / 0.5); }
.wl-day .day-num {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  font-family: 'Geist Mono', monospace;
}
.wl-day.weekend .day-num { color: hsl(var(--muted-foreground)); }
.wl-day .day-wd { font-size: 9px; margin-top: 2px; }

.wl-row {
  position: relative;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
}
.wl-row:last-child { border-bottom: none; }

.wl-cell {
  width: 32px;
  min-width: 32px;
  border-right: 1px solid hsl(var(--border) / 0.6);
}
.wl-cell.weekend { background: hsl(var(--muted) / 0.4); }
.wl-cell.overload {
  background: hsl(var(--destructive) / 0.08);
}

.wl-bar {
  position: absolute;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.wl-bar.conflict,
.gantt-bar.conflict {
  /* removed red ring, warning icon added inside bar */
}

.bar-warn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-left: auto;
  border-radius: 50%;
  background: hsl(var(--destructive));
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
.bar-warn svg {
  display: block;
  width: 10px;
  height: 10px;
}

.gantt-bar.dep-source {
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px hsl(var(--ring)), 0 1px 2px rgba(0,0,0,0.1);
}
.gantt-bar.dep-target-hover {
  filter: brightness(1.12);
  box-shadow: 0 0 0 2px hsl(var(--info, var(--ring))), 0 1px 2px rgba(0,0,0,0.1);
}

.dep-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: hsl(var(--background));
  border: 2px solid hsl(var(--foreground));
  cursor: crosshair;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.15s, transform 0.1s;
  pointer-events: none;
}
.dep-handle.dh-right { right: -7px; }
.dep-handle.dh-left { left: -7px; }
.gantt-bar:hover .dep-handle,
.gantt-bar.dep-source .dep-handle {
  opacity: 1;
  pointer-events: auto;
}
.dep-handle:hover { transform: translateY(-50%) scale(1.2); }

.gantt-bar.related {
  box-shadow: 0 0 0 2px hsl(var(--ring)), 0 1px 3px rgba(0,0,0,0.12);
  filter: brightness(1.06);
  z-index: 4;
}
.gantt-bar.related.conflict {
  box-shadow: 0 0 0 2px hsl(var(--destructive)), 0 0 0 4px hsl(var(--ring) / 0.45), 0 1px 3px rgba(0,0,0,0.12);
}
.dep-overlay path.dep-line.related {
  opacity: 1;
  stroke-width: 2;
  stroke: hsl(var(--ring));
}

.dep-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.dep-overlay path.dep-line {
  fill: none;
  stroke: hsl(var(--foreground));
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
  opacity: 0.55;
  pointer-events: stroke;
  cursor: pointer;
  transition: opacity 0.12s, stroke-width 0.12s, stroke 0.12s;
}
.dep-overlay path.dep-line:hover {
  opacity: 1;
  stroke-width: 2;
  stroke: hsl(var(--destructive));
}
.dep-overlay path.dep-line.hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  opacity: 1;
  pointer-events: stroke;
}
.dep-overlay path.dep-active {
  fill: none;
  stroke: hsl(var(--ring));
  stroke-width: 1.8;
  stroke-dasharray: 5 4;
  opacity: 0.85;
}

@media (max-width: 720px) {
  .app { padding: 16px 12px; }
  .header h1 { font-size: 20px; }
  .gantt-names { width: 200px; min-width: 200px; }
  .stats-strip { gap: 16px; }
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}
input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.print-container { display: none; }

@media print {
  body.printing > *:not(.print-container) { display: none !important; }
  body.printing .print-container {
    display: block !important;
    background: #fff;
    color: #000;
  }
  @page { size: A4 landscape; margin: 8mm; }
  .print-page {
    page-break-after: always;
    color: #000;
    background: #fff;
    font-family: 'Geist', -apple-system, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-page:last-child { page-break-after: auto; }
  .print-head {
    border-bottom: 1px solid #000;
    padding-bottom: 3mm;
    margin-bottom: 3mm;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .print-title { font-size: 14pt; font-weight: 600; }
  .print-meta { font-size: 9pt; color: #555; font-variant-numeric: tabular-nums; }
  .print-body { display: flex; align-items: flex-start; }
  .print-names { border-right: 1px solid #888; box-sizing: border-box; }
  .print-names-head {
    border-bottom: 1px solid #000;
    font-size: 8pt;
    color: #555;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f4f4f4;
    box-sizing: border-box;
  }
  .print-days { display: flex; border-bottom: 1px solid #000; }
  .print-day {
    border-right: 1px solid #ddd;
    height: 44px;
    font-size: 7pt;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #f4f4f4;
  }
  .print-day.weekend { background: #e8e8e8; }
  .print-day .day-num { font-size: 11pt; font-weight: 600; color: #000; font-family: 'Geist Mono', monospace; line-height: 1.1; }
  .print-day .day-wd { font-size: 7pt; color: #777; text-transform: uppercase; }
  .print-day .day-mon { font-size: 6pt; color: #999; text-transform: uppercase; letter-spacing: 0.05em; }
  .print-name-row {
    height: 28px;
    border-bottom: 1px solid #e6e6e6;
    padding: 0 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9pt;
    box-sizing: border-box;
  }
  .print-task-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 6px;
    color: #000;
  }
  .print-task-who {
    color: #666;
    font-size: 7.5pt;
    white-space: nowrap;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .print-rows { position: relative; }
  .print-row {
    height: 28px;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    position: relative;
    box-sizing: border-box;
  }
  .print-cell {
    border-right: 1px solid #ececec;
    height: 100%;
    box-sizing: border-box;
  }
  .print-cell.weekend { background: #f4f4f4; }
  .print-bar {
    position: absolute;
    top: 3px;
    height: 22px;
    border-radius: 3px;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 8pt;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.15);
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-bar.clip-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 10px;
    background-image: linear-gradient(90deg, rgba(0,0,0,0.18) 0, rgba(0,0,0,0.18) 4px, transparent 4px);
  }
  .print-bar.clip-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding-right: 10px;
  }
  .print-tl { overflow: hidden; }
  .print-foot {
    font-size: 7pt;
    color: #999;
    margin-top: 2mm;
    text-align: right;
  }
}
